Thorimus 2 Posted October 1, 2018 super simple question, why isn't this working? it simply does nothing, no error or anything. I'm using ACE and ACE extended animations, which is where the kk3 animation is from. {if (side = civilian) then {_x switchMove "kka3_hiphopdance"}} forEach allUnits; however, this still works: {_x switchMove "kka3_hiphopdance"} forEach allUnits; here is the full script, which also doesnt work: _arrdances = [["kka3_nighclubdance", 41], ["kka3_hiphopdance", 40], ["kka3_crazydrunkdance", 40]]; _randomdance = selectRandom _arrdances; ["THORMS ANIMATIONS", "EVERYBODY DANCE", { { _x switchMove (_randomdance select 0); _x sleep (_randomdance select 1); }forEach allUnits; }] call Ares_fnc_RegisterCustomModule; Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted October 1, 2018 {if (side = civilian) Can't work. Side requires an argument, check the syntax. The equal sign assigns a value to a variable, you need double equal signs for a comparison (==) or isEqualTo. Cheers 1 Share this post Link to post Share on other sites
Mr H. 402 Posted October 1, 2018 + it has to be: Quote if (side _x == civilian) then { etc. Share this post Link to post Share on other sites
Thorimus 2 Posted October 1, 2018 @Mr H. @Grumpy Old Man thanks. Any idea why the full script doesn't work? Share this post Link to post Share on other sites
Vauun 5 Posted October 1, 2018 _arrdances = [["kka3_nighclubdance", 41], ["kka3_hiphopdance", 40], ["kka3_crazydrunkdance", 40]]; _randomdance = selectRandom _arrdances; Can be simplified into _randomdance = selectRandom [["kka3_nighclubdance", 41], ["kka3_hiphopdance", 40], ["kka3_crazydrunkdance", 40]]; It'd also help if you posted the syntax for the function Ares_fnc_RegisterCustomModule. 1 Share this post Link to post Share on other sites
Harzach 2518 Posted October 1, 2018 1 hour ago, Vauun said: It'd also help if you posted the syntax for the function Ares_fnc_RegisterCustomModule. https://github.com/ArmaAchilles/Achilles/wiki/Custom-Modules Share this post Link to post Share on other sites
Vauun 5 Posted October 1, 2018 9 minutes ago, Harzach said: https://github.com/ArmaAchilles/Achilles/wiki/Custom-Modules Then looking at this, I'd check to make 100% certain that you're using the correct module category name and module name. Can't really diagnose without debug messages or an RPT. Share this post Link to post Share on other sites
Harzach 2518 Posted October 1, 2018 1 minute ago, Vauun said: Then looking at this, I'd check to make 100% certain that you're using the correct module category name and module name. Can't really diagnose without debug messages or an RPT. What is "correct"? It creates new categories/modules. You can name them whatever you want. You can even overwrite existing modules. Share this post Link to post Share on other sites
Vauun 5 Posted October 1, 2018 4 minutes ago, Harzach said: What is "correct"? It creates new categories/modules. You can name them whatever you want. You can even overwrite existing modules. Oh shit, I misinterpreted. My mistake. Share this post Link to post Share on other sites
Larrow 2822 Posted October 1, 2018 The initial assignment of the local variables will be out of scope to where/when the deferred code is executed, so they will be undefined. Depending on how the system runs the deferred code (scheduled vs unscheduled), the sleep may also be a problem/ignored. ["THORMS ANIMATIONS", "EVERYBODY DANCE", { _nul = [] spawn { selectRandom [["kka3_nighclubdance", 41], ["kka3_hiphopdance", 40],["kka3_crazydrunkdance", 40]] params [ "_anim", "_delay" ]; { _x switchMove _anim; _x sleep _delay; }forEach allUnits; }; }] call Ares_fnc_RegisterCustomModule; Share this post Link to post Share on other sites