Jump to content

Home

Scripting an Animation


Fallen Guardian

Recommended Posts

Alright, so I know how to get an animation to work via a script, however, what I need is an animation number to insert into the script. What I'm looking for is the animation of a character standing up after they have been knocked unconscious. I've searched nwscript for this, but there is nothing named to make it seem like it would relate. Can anyone help?

Link to comment
Share on other sites

Two things.

 

First, there is a knockdown effect:

// 134: Create a Knockdown effect
// This effect knocks creatures off their feet, they will sit until the effect
// is removed. This should be applied as a temporary effect with a 3 second
// duration minimum (1 second to fall, 1 second sitting, 1 second to get up).
effect EffectKnockdown();

 

So if you did something like this:

ApplyEffectToObject(1, EffectKnockdown(), oTarget, 12.0);

...the target object would be knocked down and get up after ten seconds. That way you don't have to mess around with the animations.

 

If you do want/need to use animations, though, this should work seamlessly:

DelayCommand(5.0, AssignCommand(oTarget, ActionPlayAnimation(10085, 1.0, -1.0)));
DelayCommand(6.0, AssignCommand(oTarget, ActionPlayAnimation(10079, 1.0, -1.0)));
DelayCommand(14.0, AssignCommand(oTarget, ActionPlayAnimation(10086, 1.0, -1.0)));
DelayCommand(15.0, AssignCommand(oTarget, ActionPlayAnimation(10006, 1.0, 1.0)));

The is the knock down animation, second is the knocked down loop, third is the getting up animation, last is just the default idle animation - I've put that in there to prevent any glitches. Feel free to adjust the delays, of course - just make sure there's exactly one second between 1 & 2 and 3 & 4. And you can break it up into two scripts, if you need it during dialogue and don't know the exact length - get rid of the delay on 3 and change 4's to 1.0 and have that fire on the getting up node.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...