Author Topic: Custom animations with playThread not playing  (Read 1753 times)

Trying to play a custom animation when the right mouse button is clicked.

Code: [Select]
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);

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.

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?

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?

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.

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.

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.
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);

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);

Sorry, yes it's on the item. That ammo thing sounds like it would work, I'll do some looking up on it and see if I can figure it out. Thanks:)

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.

I'll have to look up DtsConstructor... but I did know about DSQ, as that's what a lot of search results came up for when people would make custom anims, however I don't know much lol and it seemed like more work than needed.

I apologize about locking some useful topics. The responses I got either helped me solve the problem I had or made it seem like what I wanted to do wasn't really perfectly possible for BL so I figured that's all I needed and locked them out of a sort of courtesy :P but I suppose I can unlock some.


Thanks for all the help! I know I've been posting kind of a lot of topics.

The DtsConstructor/DSQ stuff is for players, not for items. So you wont need to worry about that.