Jump to content
Sign in to follow this  
metalcraze

Animations question

Recommended Posts

What I want is for units to play animations (like pushups) constantly, but as soon as the enemy is spotted I want them to get back to their normal AI routines.

That relates to the player too. Just in case the player will go killing their own that play anims (because when f.e. I set one waypoint with playMove and the second waypoint is "cycle" AIs don't react and keep playing the animation).

Share this post


Link to post
Share on other sites

I would do it this way:

1. Create a waypoint after the cycle

2. Place a Trigger with OPFOR detected by BLUFOR. Set Type to Switch and sync it with the cycle waypoint. Maybe place in the on act. Field unit switchmove "";

3. In case of friendly fire I would use the firednear eventhandler with switchmove "";

or set a variable to true with the firednear eventhandler and make it another condition for the trigger at 2. (this OR hasfired)

Edited by Melmarkian

Share this post


Link to post
Share on other sites

Doesn't work

When I do it like that and the trigger triggers the soldier indeed switches to the default animation, however he then immediately restarts playing the animation in the MOVE waypoint again. And only upon finishing playing it he moves to the last waypoint.

My waypoints are set this way:

WP0 Move: an1 playMove "UnaErcVelitelProslov1";

WP1 Cycle -> sync'ed to the switch trigger with an1 switchMove "" in trigger's on Act.;

WP2 Guard (a waypoint 100m away)

Share this post


Link to post
Share on other sites

Ok,

He plays it one more time after the switchtrigger. But this has worked:

1. Into init-field:

an2 addEventHandler ["AnimStateChanged", {an2 switchMove "UnaErcVelitelProslov1"}];

2. Trigger opfor detected by blufor with

an2 switchMove "";  an2 removeEventHandler ["AnimStateChanged", 0];

I used this for captives in one of my missions.

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  

×