whiztler 137 Posted May 22, 2014 (edited) Below case is a script that runs at the beginning of a mission: if (!isServer) exitWith {}; trueVar = false; waitUntil {trueVar}; After 1+ hour into the mission: trueVar = true; publicVariableServer "trueVar"; When the trueVar init is broadcasted to the server, the server will be dealing with lots of AI's, combat, etc. FPS drops but no lower than 17. Is it possible that due to server lag or the fact that the game is already been at it for over an hour that the waitUntil {tueVar}; is no longer working? Anyone experienced this before? Edited May 22, 2014 by whiztler Share this post Link to post Share on other sites
Lala14 135 Posted May 22, 2014 Not sure if its a typo but do you notice the spelling mistake? waitUntil {tueVar}; waitUntil {trueVar}; Share this post Link to post Share on other sites
whiztler 137 Posted May 22, 2014 Thanks, the snippet is just an example. fixed Share this post Link to post Share on other sites
cuel 25 Posted May 22, 2014 There used to be a max threshold of 10,000 iterations in a loop, I am not sure if it's still in nor if waitUntil is affected by it. If it's one hour away you might want to add a sleep or it's checked every frame. waitUntil{sleep 5; trueVar}; Share this post Link to post Share on other sites
Tajin 349 Posted May 22, 2014 You could also use a publicVariableEventhandler instead. Share this post Link to post Share on other sites
neokika 62 Posted May 22, 2014 There used to be a max threshold of 10,000 iterations in a loop, I am not sure if it's still in nor if waitUntil is affected by it.If it's one hour away you might want to add a sleep or it's checked every frame. waitUntil{sleep 5; trueVar}; Not entirely correct. Loops, are only limited to 10k iterations within a Non-Schedule Environment, for example, code running within a event handler. Also, see Threads for more information about the Scheduled / Non-Scheduled Environment. Also, waitUntil does not run every frame, because it is also caught within the Scheduled Environment. Going back to initial question, it should still work, should not be dependent on time after mission start. Although, what you are trying to achive, should be done though a public variable event handler. /** Server */ // Some variable TAG_myVariable = false; // The public variable event handler, that will execute, everytime defined variable is modified over the network "TAG_myVariable" addPublicVariableEventHandler { // Log the variable name and it's new value ["Variable (%1) has changed and is now (%2)", _this select 0, _this select 1] call BIS_fnc_logFormat; }; /** Client */ // Set a new value to the variable we added a event handler to TAG_myVariable = true; // Broadcast value over to the server, causing the event handler to execute and log the name and new value of the variable publicVariableServer "TAG_myVariable"; Share this post Link to post Share on other sites
whiztler 137 Posted May 22, 2014 (edited) Thanks guys. Always keen to learn new things about scripting for Arma. Edited May 22, 2014 by whiztler Share this post Link to post Share on other sites
barbolani 198 Posted May 22, 2014 Hi neokika, could you please check this thread? http://forums.bistudio.com/showthread.php?177982-surfaceIsWater-and-others It is related to the same thing, I think, and I'm curious about what's the best solution in that case... Share this post Link to post Share on other sites
cuel 25 Posted May 22, 2014 Also, waitUntil does not run every frame, because it is also caught within the Scheduled Environment. Yes. Someone ought to change the wiki. Share this post Link to post Share on other sites