OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: UH60MG on 09 Mar 2008, 11:42:00

Title: Clear!
Post by: UH60MG on 09 Mar 2008, 11:42:00
Is there a way to make an AI group that is in "COMBAT" mode think the area is free of enemies and then go back into "SAFE" mode?

Title: Re: Clear!
Post by: Mandoble on 09 Mar 2008, 12:09:11
You might try to setup its combat mode to BLUE and its behaviour to CARELESS.
Title: Re: Clear!
Post by: Wolfrug on 09 Mar 2008, 12:24:22
Random idea that popped into my head

Use the findNearestEnemy (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=f#559) command to find the nearest enemy of the group leader (who should be aware of all the enemies of the group), then set that enemy to setCaptive true (which is the equivalent of changing their side to something not-enemy, I think). After that, run the findNearest enemy command again, set that enemy to captive etc. etc until findnearestenemy return null = no contacts.

Of course, that means there're bunches of enemies out there that are setcaptivated, but you could save them in an array and un-captivate them when necessary. Depending on what kind of situation it is you need this for? Also, using reveal + setcaptive true might be necessary, since it usually takes a while otherwise for AI commanders to grok that something's changed. This should lead to the AI commander saying "clear!" after a while. Note they won't return to safe mode automatically, so you might need to tell them that separately.

Might work, might not?

Wolfrug out.