Jump to content
Sign in to follow this  
Theel

Find a unit's current animation

Recommended Posts

Is it possible to find a unit's current animation? Like if I set a unit's animation with playmove or switchmove, and then have an if statement be true when they are no longer in that animation is it possible? Is there a workaround if not...? any ideas would help.

Share this post


Link to post
Share on other sites

No.

Quote[/b] ]Is there a workaround if not...?  any ideas would help.

Explain precisely what you intend to do... There are many workarounds in OFP...

Share this post


Link to post
Share on other sites

I'm working on a series of scripts. I'm editing the scripts in scripts.pbo for my mod. When a player dies instead of dieing I'm setting his health back to 0 and forcing an animation on him. Then adding an action for a medic to be able to take him out of this forced animation. The problem is when he is on the ground in the forced animation and dies again another action is added and there is no way to die, because his health keeps going back to 0. I want an if statement that checks his current animation to see if he is in the forced animation, if he is then it won't setdammage 0 and he will just die.

So far its been working except for the previous problem and the forced animation isn't looping right, and once a medic uses the action, the "wounded" unit gets out of the animation, but then goes back into it and finishes the animation.

I thought about setting the unit as a captive, and checking to see if he was a captive, but I don't know how to do that either. Also captive stops the AI from shooting at you which I don't want.

*Edit* I tried out using Captive, because I found a way to check for captive status. Using captive would work except for the AI doesn't shoot the unit after setting captive to false again. Why is the AI not shooting even with captive false?

Share this post


Link to post
Share on other sites

yes, setcaptive a unit is a good way to check unit states in game, i'm using it very often, for wound or chemical scripts for example. It avoids the script to be launched several times on the same unit.

Quote[/b] ]*Edit* I tried out using Captive, because I found a way to check for captive status.  Using captive would work except for the AI doesn't shoot the unit after setting captive to false again.  Why is the AI not shooting even with captive false?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nameofunit setcaptive false

does work for me. Maybe you should check that the first script (that forces the animation and setcaptive the unit true) isn't launched several times. If you use eventhandlers, you may notice that the "dammage" eventhandler may be fired several times for the same wound and then launch several time the same script on the same unit.

Share this post


Link to post
Share on other sites

Great points. I'm starting to notice that OpFlash wasn't made for a medic system that:

1) On death a player activates a script that adds an action.

2) A medic can use the action and "revive" the "dead" soldier.

3) The medic has 2 mins to "revive" the "dead" soldier.

Now the only problem lies with AI not shooting at the guy after "_unit setcaptive false" is in. I'll do more tests. Thank you very much for your help so far.

Just an out there question, know where to find any released models for round parachutes that have LOD hitboxes? I know that FDF's square ones do, but I'm unable to find any round ones.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×