Merad 10 Posted July 15, 2009 //Grabs all the objects within 1000 of SleepZone Marker Sleepers = nearestObjects [sleepZone,["All"],1000]; //Tells them to go to sleep. Foreach "Sleepers" disableAI "Move"; Foreach "Sleepers" disableAI "Target"; Foreach "Sleepers" disableAI "Autotarget"; What I'm trying to do is have all the units in a specific area frozen until the players trip a trigger. Unfortunatly the above doesn't work when I run it from the init.sqf Can anyone help? Thanks! Share this post Link to post Share on other sites
NeoArmageddon 957 Posted July 15, 2009 Ui... this kind of foreach is new to me.... try this Sleepers = nearestObjects [sleepZone,["Man","Car","Tank","Air"],1000]; { _x disableAI "Move"; _x disableAI "Target"; _x disableAI "Autotarget"; } foreach Sleepers; P.S. nearestobjects "ALL" will get everyhing... cars, tanks, fences, buildings... and thats not what you want^^ Share this post Link to post Share on other sites
moricky 210 Posted July 15, 2009 BTW: Better than disabling specific AI aspects is to turn it off completely using enablesimulation command ;) Share this post Link to post Share on other sites
NeoArmageddon 957 Posted July 15, 2009 @Gaia, BTW do you know if its possible to disable the new micro AI? I want to control civs via script but of they get in danger the ai is taking them over and they are ignoring my domove commands (behaviour is careless). Share this post Link to post Share on other sites
Starlight 10 Posted July 15, 2009 Would it not be better to have the trigger call a script that then places the AI on the map, that way no processing of them before they are triggered! Share this post Link to post Share on other sites
Merad 10 Posted July 16, 2009 It's a lot more difficult to spawn all this for me. The area in question has upwards of 80 AI units alone. Trying to figure out how to place each one in the specific formations they need to be in seems like a much more difficult task. Share this post Link to post Share on other sites
Starlight 10 Posted July 16, 2009 Do they have to be placed in very exacting positions or just small localised areas. I agree if you want exacting positions its laborious to do many with a script, but if general areas, then a load of markers on the map for each group is relatively easy. You could also use the editor to place them, then extract the position info from the mission file to put into your own script. Just depends on how big a mission you are building, if you have 2-3 towns with that many troops the performance could slow down a lot. Share this post Link to post Share on other sites
Merad 10 Posted July 17, 2009 Do they have to be placed in very exacting positions or just small localised areas.I agree if you want exacting positions its laborious to do many with a script, but if general areas, then a load of markers on the map for each group is relatively easy. You could also use the editor to place them, then extract the position info from the mission file to put into your own script. Just depends on how big a mission you are building, if you have 2-3 towns with that many troops the performance could slow down a lot. Exact. You have two sides fighting (sudden outbreak of fighting in a formation). I'm having a lot of trouble getting the given script to fire. Share this post Link to post Share on other sites