GuideZ 1 Posted August 13, 2012 I have a bunch of units lined up, and have them firing on a radio trigger. I would like to do something like: Unit1 fire "m16a4"; sleep 2.0; Unit2 fire "m16a4"; sleep 2.0; But both units fire at almost exactly the same time when I preview the mission. Do I have to export the mission in order to get the sleep functionality, or am I missing something? I also tried something like: Unit1 fire "m16a4"; waitUntil {sleep 2.0; Unit1 fire "m16a4"}; Unit2 fire "m16a4"; As it stands right now, I have 8 units firing on separate radio commands. A little annoying. Here is what I want my final outcome to be: I setup 8 units in a line, 50 meters between each one. I want them to fire three shots each, with the next unit firing only when the previous unit fires first. Share this post Link to post Share on other sites
f2k sel 145 Posted August 13, 2012 this null=[] spawn { Unit1 fire "m16a4"; sleep 2.0; Unit2 fire "m16a4"; sleep 2.0;} or this where you can just add units to the array null=[] spawn {{ _x fire "m16a4"; sleep 2.0;} foreach [uni1,unit2,unit3];} Share this post Link to post Share on other sites
GuideZ 1 Posted August 13, 2012 (edited) Omnigosh, I had to lookup "spawn" to see what it does. I would have never guessed :p , I will give that code a try. Spawn "Starts running a new script (SQF). Additional arguments are passed in local _this variable. *edit* For those wondering, here was the final output: null=[] spawn {{ _x fire MWeap; sleep 2.0; _x fire MWeap; sleep 2.0; _x fire MWeap; sleep 3.0;} foreach [Fire1,Fire2,Fire3,Fire4,Fire5,Fire6,Fire7,Fire8];} Edited August 13, 2012 by GuideZ Share this post Link to post Share on other sites
samatra 81 Posted August 14, 2012 Some script scopes don't allow use of sleep and will throw errors. If this is the case, then just wrap your code into spawn and it will work. Share this post Link to post Share on other sites