metalhead897 0 Posted January 1, 2007 I Searched OFPEC and here and can't find a damn thing about this (I really don't have time to look hard enough). Basically, i have a simple script that repeats an animation loop so that they don't get up and change animations. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop1 guy1 switchmove "sitting1"; guy2 switchmove "crouchrest"; guy3 switchmove "effectstandsitdown"; guy4 switchmove "standrest"; ~5 //Repeats this part again 3 times However I'm not great with C++ im still learning it. So I don't know the syntax to break this loop, when another script becomes active. I want this script to exit when another is active, so that they change animation and move about ( i have all the waypoints and such set up) and get in position when they are attacked. Assume the other script is called "scramble.sqs", and #FormUp is the function inside that script. I tried <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(FormUp = TRUE): goto "exit" exit and <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#FormUp goto Loop1exit .... Share this post Link to post Share on other sites
The-Architect 0 Posted January 2, 2007 Got to put a condition in. In your first script have something like this within the loop, at the start usually or wherever you need it. ? BreakLoop : GoTo "Exit" At the bottom of your script have this, #Exit Exit In your new script you meet the condition. Breakloop = True That's it. Share this post Link to post Share on other sites
metalhead897 0 Posted January 2, 2007 Thanks for that, all works fine now. Share this post Link to post Share on other sites
sickboy 13 Posted January 2, 2007 ... You Could try: [] execVM "swmove.sqf"; content of swmove.sqf:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_run"]; _run=true; while{_run} do {   while{_run} do   {     guy1 switchmove "sitting1";     guy2 switchmove "crouchrest";     guy3 switchmove "effectstandsitdown";     guy4 switchmove "standrest";     sleep 5;     if(FormUp)then{_run=false;};   }; }; I nested the while loop in another while loop, because of the fact that while loops terminate after 10.000 cycles, just in case Share this post Link to post Share on other sites