Krowkie 10 Posted September 19, 2010 (edited) Hi, I made a noobish script to make all my guys inside my base initiate the animations, this is the script: {_x playMove "AmovPercMstpSnonWnonDnon_idle56kliky"} forEach [w1,w2,w3,w4,w5,w6,w7,w8,w9,10,w11,w12,w13,w14,w15,w16,w17,w18,w19,w20,w21,w22,w23,w24,w25] ; {_x playMove "ActsPercSnonWnonDnon_carFixing2"} forEach [eng3,eng4]; {_x playMove "AinvPknlMstpSnonWrflDnon_medic1"} forEach [med1]; {_x playMove "AinvPknlMstpSnonWrflDr_medic5"} forEach [med2]; {_x playMove "sitUnarm_L_relaxing"} forEach [eng1]; {_x playMove "aidlpercmstpsraswrfldnon_idlesteady01n"} forEach [guard1,guard5,guard6]; {_x playMove "aidlpercmstpsraswrfldnon_idlesteady02n"} forEach [guard3,guard7]; {_x playMove "aidlpercmstpsraswrfldnon_idlesteady03n"} forEach [guard2,guard4,guard8]; {_x playMove "UnaErc_UnaErcPoslechVelitele"} forEach [eng2]; then I put execVM "USanimations.sqf" in my init.sqf, can anyone help me? Edited September 19, 2010 by Krowkie Share this post Link to post Share on other sites
CarlGustaffa 4 Posted September 19, 2010 (edited) At the top of the script, try waitUntil {time > 0} or add a small sleep. Not sure if it helps. If you get an error message due to the waitUntil, you may have to spawn the contents as well (unsure). I.e. [] spawn { waitUntil {time > 0}; ...contents of the script... }; Edited September 19, 2010 by CarlGustaffa Share this post Link to post Share on other sites
Krowkie 10 Posted September 19, 2010 At the top of the script, try waitUntil {time > 0} or add a small sleep. Not sure if it helps.If you get an error message due to the waitUntil, you may have to spawn the contents as well (unsure). I.e. [] spawn { waitUntil {time > 0}; ...contents of the script... }; waitUntil dind't seem to help, it's strange though. It says: error playmove, type number expected object but sometimes w1 up to w9 do the animation and nobody else does anything... Share this post Link to post Share on other sites
AZCoder 921 Posted September 20, 2010 w10 in your array just says '10', probably why the first 1 to 9 work. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted September 20, 2010 Nicely spotted :) Given his type number expected object error I was looking for a typo like that but didn't catch it. Share this post Link to post Share on other sites
Krowkie 10 Posted September 20, 2010 w10 in your array just says '10', probably why the first 1 to 9 work. Thanks! Never saw it. Share this post Link to post Share on other sites
rübe 127 Posted September 20, 2010 Why do you even assign a global variable to all of these units. Considering that they most likely are in one group anyway, you could replace that monster array with something like: { ... } forEach (units trainingGroup); ... assuming that you "named" that group "trainingGroup" (or whatever). You might consider to write a little function for this, passing the group to the function, so you could reuse that thing at some later point. Sure, maybe you'd like to have some units, for example the leader, just standing still: { ... } forEach (_this - [(leader _this)]); ... assuming that _this referes to some group passed to your function. Or you might wanna filter out higher ranks, or do something different based on the units rank, which would allow to easily set this up in the editor in a more meaningful way. Then simply call this function from the init-line of the groups leader: _nul = (group this) call TAG_groupExercice; At least for "bulk"-animations, I'd consider such a solution (in there you could also position the single units in some nice manner per scripting, so you wouldn't need to care much in the editor). You could also easily randomize the single animations, by either selecting at random from an array or by a switch on a random number. Just in case... :D Share this post Link to post Share on other sites