Blockland Forums > Modification Help
Custom animations with playThread not playing
(1/2) > >>
xS K I D z:
Trying to play a custom animation when the right mouse button is clicked.


--- Code: ---package itemShake
{
function Armor::onTrigger(%this,%obj,%slot,%val)
{
Parent::onTrigger(%this,%obj,%slot,%val);
if(%slot == 4 && %val)
{
if(%obj.getMountedImage(0) == ItemImage1.getID())
{
%obj.playThread(0, "ShakeEntry");
}
}
}
};
activatePackage(itemShake);
--- End code ---

I figure the problem is with the playThread method but I've looked at examples and resources and everything I try won't work :P so I just left it as is.
Shift Kitty:
How do you have your animations set up? Is there any more code than this? Is the animation tied to the item or the player itself?
xS K I D z:

--- Quote from: Shift Kitty on September 24, 2017, 02:08:22 PM ---How do you have your animations set up? Is there any more code than this? Is the animation tied to the item or the player itself?

--- End quote ---

Animations are made in Blender, in the model itself as a .dts file. I don't have it set "pre-loaded" anywhere if that's a thing. It would play the animation if I set it up as a stateSequence in a state, but I want the right-click to play the animation and as far as I know you can only do those kind of keybinds in a package/function. When I have mounted a specific 'datablock ShapeBaseImageData (ItemImage1)' and have right-clicked while on that image, I want the animation (ShakeEntry) to play.
Kyuande:
You need to have a DtsContructor to have the animations (Not sure if that's reaaally required) but they also need to be in DSQ animations, usually you cannot have them inside a model

Also please stop locking your topics in mod help - someone might have a better solution for you or someone might want to add something to the topic.
Shift Kitty:

--- Quote from: xS K I D z on September 24, 2017, 02:35:43 PM ---Animations are made in Blender, in the model itself as a .dts file. I don't have it set "pre-loaded" anywhere if that's a thing. It would play the animation if I set it up as a stateSequence in a state, but I want the right-click to play the animation and as far as I know you can only do those kind of keybinds in a package/function. When I have mounted a specific 'datablock ShapeBaseImageData (ItemImage1)' and have right-clicked while on that image, I want the animation (ShakeEntry) to play.

--- End quote ---
The most important question was whether it was part of the item or the player. Though it seems like you're doing it on the item.

That's when it becomes a bit trickier to play different animations on them. You can't just call playthread because that's for the player. And there's no way to just set the animation of a mounted image because it doesn't even have an object. So what you need to do is abuse the ammo related states. Make some states transition on 'no ammo', and have the right click function call on the player .setImageAmmo(0);
Navigation
Message Index
Next page

Go to full version