KeiwaM 1 Posted January 30, 2023 So I've been working all morning on a short little thing that will make an AI play an animation and exit it when shot at/near. I've found a lot of help through old posts on here and I've ended up with this. [this,"STAND1","ASIS"] call BIS_fnc_ambientAnim; this addEventHandler ["FiredNear", { _this call BIS_fnc_ambientAnim__terminate; this removeEventHandler [_thisEvent, _thisEventHandler] }]; And while the script technically works, I'm having a weird AI issue afterwards. The AI sort of tracks me as I run around him, but he makes these weird upper-body flicks. If I stand still, he will shoot either to the left or right of me. The AI hits maybe 1 in 30 shots at me this way. It's really frustrating, makes the AI useless and I can't figure out if it's the script or not. Video of the AI's reaction. https://www.youtube.com/watch?v=vhbopQQsNsA Hoping for help! Share this post Link to post Share on other sites
KeiwaM 1 Posted January 30, 2023 I have just tested this on a regular placed AI with no init or scripts, and it switches between behaving normal and behaving like this. Not sure why Share this post Link to post Share on other sites
honger 113 Posted January 30, 2023 Out of curiosity, why not use BIS_fnc_ambientAnimCombat to have AI exit the animation when in danger? 1 Share this post Link to post Share on other sites
KeiwaM 1 Posted January 30, 2023 3 hours ago, honger said: Out of curiosity, why not use BIS_fnc_ambientAnimCombat to have AI exit the animation when in danger? The reason I don't like this is because it doesn't function with my mission. ambientAnimCombat will exit the animation whenever the AI spots a threat - meaning even if that threat is 300 meters away in a dark night, where realistically he wouldn't be seen, the AI will leave their animation to look in their direction and shoot. I found the solution however. For anyone who needs it in the future, this is how; [this,"STAND1","ASIS"] call BIS_fnc_ambientAnim; this addEventHandler ["FiredNear", { (_this select 0) call BIS_fnc_ambientAnim__terminate; (_this select 0) removeEventHandler [_thisEvent, _thisEventHandler] }]; 1 Share this post Link to post Share on other sites