Jump to content
thefluffyraisin

Have AI stop an animation when they detect an enemy:

Recommended Posts

Hello everyone! So I've recently been making a mission and am running into a little trouble. I want to have an enemy play an animation (In the mission an enemy is cleaning a car), and have him cancel the animation and attack when someone is detected. For the animation itself I'm using:

[this,"REPAIR_VEH_STAND", "ASIS"] call BIS_fnc_ambientAnim;

This command works fine and has the unit do as I want, but then I tried to get him to stop by using this command in a trigger:

s1 switchMove ""; (s1 being the unit name)

Though this does cancel the animation, the unit is frozen and does not attack or move. For the record I've been ALL over the forums and I can't figure out what I'm doing wrong. If someone could shed some light it would be greatly appreciated!

Share this post


Link to post
Share on other sites

Yeah so I tried that and it helped partially! He does shoot my if I walk directly in front of him but for some reason he isn't able to turn. Any ideas?

Share this post


Link to post
Share on other sites

try enableAI "MOVE" aswell

Share this post


Link to post
Share on other sites
Yeah so I tried that and it helped partially! He does shoot my if I walk directly in front of him but for some reason he isn't able to turn. Any ideas?

try this put a waypoint, in the field where it says: "On Act" put this: [this,"REPAIR_VEH_STAND", "FULL", {triggerActivated tri5}] call BIS_fnc_ambientAnimCombat;

Put a trigger with any name, example ("tri5") , set present blufor or opford or any faction that is the enemy in your mission.

sory for my english!

Share this post


Link to post
Share on other sites

I appreciate your help but I'm a bit lost! Who do I attach the waypoint to, and what does the trigger do? I just figured that if I put a trigger that was activated by Bluefor when detected by OpFor, there would be some sort of code that returns them to their normal state. So far with the code I currently have, he stops the animation and tries to turn toward me to shoot me but he simply isn't able to turn.

---------- Post added at 19:53 ---------- Previous post was at 19:52 ----------

try enableAI "MOVE" aswell

I actually tried adding that as well, but still the same result. The unit can lay down and draw his weapon, but he tries to turn in my direction to shoot me but he can't. He's only partially frozen.

---------- Post added at 20:43 ---------- Previous post was at 19:53 ----------

Guys I figured it out. All I did was put down a trigger that said:

[s1,"STAND", "ASIS"] call BIS_fnc_ambientAnimCombat;

The unit pretty much returns to it's default state. Thanks for the help though everyone.

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

×