fawlty 27 Posted August 3, 2021 Guys I'm trying to enable ai path for all enemy ai within the radius of a trigger. I've used this to delete after leaving a played area call{{deleteVehicle _x} forEach nearestObjects [junk_1, ["all"], 75];} (junk_1 being the trigger name) but want to enable path as we approach a zone Thanks Share this post Link to post Share on other sites
johnnyboy 3744 Posted August 3, 2021 This might be what you are looking for: {_x enableAI "PATH";} foreach thislist 1 1 Share this post Link to post Share on other sites
fawlty 27 Posted August 3, 2021 Thanks Johnny, I used this in the condition, (Opfor present) this && player inArea thisTrigger and it worked great. Save me using modules for each ai to move. 1 Share this post Link to post Share on other sites
fawlty 27 Posted August 3, 2021 Any suggestions of disabling ai path once the player leaves the trigger zone? I tried disableAI "PATH" with another trigger plus this or player inArea thisTrigger No Go Share this post Link to post Share on other sites
pierremgi 4740 Posted August 4, 2021 You may use the same trigger, repeatable (so on deact works) thisList can't be used on deact, so you may pass a variable on AIs who have path enabled, then script for them at deact: cond: this && player inArea thisTrigger on act: {_x enableAI "PATH"; _x setVariable ["pathEnabled",TRUE] } forEach thisList on deact: {_x disableAI "PATH"; _x setVariable ["pathEnabled",nil] } forEach (allUnits select { !isNil {_x getVariable "pathEnabled"} }) 3 Share this post Link to post Share on other sites
fawlty 27 Posted August 4, 2021 Hey Pierre, Getting a invalid number in expression error, so it's a no-go. Share this post Link to post Share on other sites
pierremgi 4740 Posted August 4, 2021 1 hour ago, fawlty said: Hey Pierre, Getting a invalid number in expression error, so it's a no-go. Tested. That works for me. Probably by copying / pasting the code and as usual, an invisible character added by this page. 1 Share this post Link to post Share on other sites
fawlty 27 Posted August 4, 2021 Right again Pierre, must have been a copy and past issue. Checked it out this morning and works as it should. Thanks again for you help. Share this post Link to post Share on other sites