MagicBra Posted August 17, 2013 Posted August 17, 2013 Hi, I'm trying to figure out how to turn off or on a unit AI inside a script. My goal is to simulate the fact that damages units can still being alive but can't move nor fire. By using the trigger system it can be achieved by using "Unit AI off" actions. For now the only option I've found in the SSE is to add a Hold task + set ROE options to hold fire. But still the program uses cycles on those units. Have you got any ideas/solutions ? :) Thx VEAF - Virtual European Air Force- www.veaf.org Association européenne de simulation évoluant sur DCS, BMS et ArmA3. Nous rejoindre : http://www.veaf.org/fr/association/formulaire-de-contact
Grimes Posted August 17, 2013 Posted August 17, 2013 1.2.5 added a way to do it via scripting, but we haven't been able to update the wiki because the wiki is on lockdown. Use Controller.setOnOff(Controller self, boolean value) The boolean value defines what you want to do with the unit, false == off, true == on. Unit.getByName('whatever'):getController():setOnOff(false) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
MagicBra Posted August 17, 2013 Author Posted August 17, 2013 Thanks for the fast reply :) I've tried it. Sadly it doesn't work the same way. To test it, I've placed a group of moving Abrams on a road. After 10 sec I set a unit AI to off with a trigger. The unit stops and the other units of the group continue. After 20 sec I sets the second unit AI off by script and all the group stops. It works the same way when i use a scripted 'AI OFF' on any unit all the group stops. I've attached the .miz to the post.test AI off.miz VEAF - Virtual European Air Force- www.veaf.org Association européenne de simulation évoluant sur DCS, BMS et ArmA3. Nous rejoindre : http://www.veaf.org/fr/association/formulaire-de-contact
Recommended Posts