jimm 10 Posted September 9, 2010 Hi I have a few scripts that work great if i put the code in the ini line of the units. what i have been trying to do is have these scripts launched from a trigger. for example i have a trigger that is activated by east present . i list all units within the trigger radius then try running the script for each unit in the list. i have spent many hours trying many things but have had no luck so far. any help appreciated. cheers Share this post Link to post Share on other sites
CarlGustaffa 4 Posted September 9, 2010 I'm guessing {0 = [_x] execVM "yourscript.sqf"} forEach thislist In the script, _unit = _this select 0; would be the unit sent. However, I would prefer 0 = [thislist] execVM "yourscript.sqf" instead. In the script, _list = _this select 0; would be the whole list. Running scripts on each unit creates a lot of unwanted overhead, naturally depending on the complexity of the script. If you can get away with looping over only group leaders, you can reduce a lot of overhead. Share this post Link to post Share on other sites
jimm 10 Posted September 9, 2010 thanks for your help :) this is what i have spent 4 or 5 hours over the last few nights trying to do. thanks also for the tip on keeping overhead expense low makes sense :) Share this post Link to post Share on other sites