MacRae 12 Posted June 30, 2013 Im Trying to loop an sitting animation because of the fact once the timer runs out the player stands up? Im just wondering is there anyway to add an Initialization script for the script to repeat? Share this post Link to post Share on other sites
samatra 85 Posted June 30, 2013 In init line: nul = this spawn {while{true} do {this switchMove "SomeAnimation"; sleep 2;};}; This will play "SomeAnimation" each 2 seconds. Share this post Link to post Share on other sites
MacRae 12 Posted June 30, 2013 Thankyou SaMatra - But do i replace "SomeAnimation" with the name of my animation? Share this post Link to post Share on other sites
samatra 85 Posted June 30, 2013 Yes, of course. You can as well change 2 seconds to whatever you need so animation will be smooth. Share this post Link to post Share on other sites
kylania 568 Posted June 30, 2013 (edited) Could also do it like BIS did in one of their missions: removeAllWeapons this; this setBehaviour "CARELESS"; 0 = this spawn { waitUntil {time > 0}; _this switchMove "InBaseMoves_HandsBehindBack2"; while {alive _this} do { waitUntil {animationState _this != "InBaseMoves_HandsBehindBack2"}; _this switchMove "InBaseMoves_HandsBehindBack2"} }; Edited June 30, 2013 by kylania 1 Share this post Link to post Share on other sites
MacRae 12 Posted June 30, 2013 So Kylania, Do i put that into the Initialization ? Share this post Link to post Share on other sites
kylania 568 Posted June 30, 2013 Of the unit, yeah. Share this post Link to post Share on other sites
MacRae 12 Posted June 30, 2013 When i pase that in it says: Missing ; Share this post Link to post Share on other sites
kylania 568 Posted June 30, 2013 Oops, had a stray " in there! Recopy it now. heh Share this post Link to post Share on other sites
MacRae 12 Posted June 30, 2013 Thanks so much for your help, but that is not what im looking for sadly :/ Share this post Link to post Share on other sites
Conscisior 0 Posted May 20, 2016 Could also do it like BIS did in one of their missions: removeAllWeapons this; this setBehaviour "CARELESS"; 0 = this spawn { waitUntil {time > 0}; _this switchMove "InBaseMoves_HandsBehindBack2"; while {alive _this} do { waitUntil {animationState _this != "InBaseMoves_HandsBehindBack2"}; _this switchMove "InBaseMoves_HandsBehindBack2"} }; Sorry to resurrect an old post but how do I enable this animation to stop as soon as they hear/see people. Share this post Link to post Share on other sites
sarogahtyp 1108 Posted May 20, 2016 removeAllWeapons this; this setBehaviour "CARELESS"; 0 = this spawn { waitUntil {time > 0}; _this switchMove "InBaseMoves_HandsBehindBack2"; while {alive _this} do { if (toLower (behaviour _this) == "careless") then { waitUntil {animationState _this != "InBaseMoves_HandsBehindBack2"}; _this switchMove "InBaseMoves_HandsBehindBack2"; } else { _this switchMove ""; waitUntil { sleep 1; toLower (behaviour _this) == "careless"}; }; }; }; 1 Share this post Link to post Share on other sites
VedKay 2 Posted February 10, 2021 On 7/1/2013 at 7:39 AM, kylania said: Could also do it like BIS did in one of their missions: removeAllWeapons this; this setBehaviour "CARELESS"; 0 = this spawn { waitUntil {time > 0}; _this switchMove "InBaseMoves_HandsBehindBack2"; while {alive _this} do { waitUntil {animationState _this != "InBaseMoves_HandsBehindBack2"}; _this switchMove "InBaseMoves_HandsBehindBack2"} }; Hey there kylania. Apologies for dredging up an old post but I have a few questions regarding this cool little script. Would appreciate your input. So I've got this in a trigger's onAct, all is good. Is it possible to add in the "In" and "out" parts of the animations while keeping them in the loop as is here? And then secondly. By ticking the 'server only' checkbox in the trigger's options, is that enough to make it global and synced on a Dedi server? Or does something like (isMultiplayer && isDedicated) need to be slipped into the switchMove? Appreciate any help, Cheers, Ved Share this post Link to post Share on other sites
lucasvdb 0 Posted August 24, 2022 Ho can I make this code "global" so that I can call the script with the execution function? 🙂 Cheers Share this post Link to post Share on other sites
Melody_Mike 130 Posted August 29, 2022 Hi @lucasvdb; welcome to the forums! The effects of an animation command like switchMove are usually Global. That is, all players can see them. You see this marked at the top of the BIKI for every command. If you want to generalize the code so you can easily use it multiple times during a mission, you can make a Function out of it. 1 Share this post Link to post Share on other sites