[Solved] Custom Animation for Placeables?

How do I trigger a “dead” or “default” animation of a placeable via script?

I’ve seen the custom content guide (which misses to describe the open/close animation for placeables btw.) and now I think the standard animations are most probably hardcoded and there is no way to add a custom animation.

But I’m thinking about abusing the default set of animations. It would be nice to find a way to trigger these via script. Is there any way to get this work?

Not as far as I know.

The rules are summarised here.

The good news is that you can put anything you like into the model for activated / deactivated and open / close, so every placeable has up to four scriptable appearances (not counting “dead”).

Assuming latest EE, you can alias animations to trigger any you’d like. This works for any object type. Simply add all the animations you want to the model, with any name you want (follow resref naming rules). Then, in a script you can do ReplaceObjectAnimation(oObj, "existing_anim", "my_new_anim");. Then, any time that object needs to play existing_anim for whatever reason, it will play my_new_anim instead. Scripts can play the activate/deactivate animations on demand, so you can simply do something like…

// Replace the default activate animation with default dead animation
ReplaceObjectAnimation(oPlc, "on", "dead");
// Play the "activate" animation
AssignCommand(oPlc, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
// Restore old activate animation
DelayCommand(0.3f, ReplaceObjectAnimation(oPlc, "on", ""));

I already feared that there will be a hardcoded restriction. Four is by far not enough, I need 11. :slight_smile:

Thanks.

Maybe I should change to the EE eventually? :slight_smile: