falconx1 13 Posted July 8, 2013 (edited) How can i change this script to continue only after waves_east < AIWaveCount and time is greater than SetupTime var i originaly made it to function different but now i want to give players a chance to have time to buy gear save it etc before the AI waves start coming //SetupTime would be based on seconds only. SetupTime = (paramsArray select 5); while {waves_east < AIWaveCount} do { not sure but is this right? SetupTime = (paramsArray select 5); while {waves_east < AIWaveCount || time > SetupTime} do { Edited July 8, 2013 by falconx1 Share this post Link to post Share on other sites
Johnson11B2P 3 Posted July 8, 2013 Have you ever thought to use the sleep command? (http://community.bistudio.com/wiki/sleep) This will suspend the .sqf script in place then your script will continue. Share this post Link to post Share on other sites
falconx1 13 Posted July 8, 2013 yea but that would require more modding of other sqf pages in this case i believe its best to use time . is the bottom code i posted correct ? Share this post Link to post Share on other sites
Mr_B_A_Baracus 10 Posted July 8, 2013 I'm sure I had a problem with (<condition1> || <condition2>) before and I ended up changing it to (<condition1> || {<condition2>}) and I'm sure it started working, something to do with lazy evaluation, could anyone explain this easily? Share this post Link to post Share on other sites
Deadfast 43 Posted July 8, 2013 How can i change this script to continue only after waves_east < AIWaveCount and time is greater than SetupTime var || is OR, you want &&. Share this post Link to post Share on other sites
Johnson11B2P 3 Posted July 8, 2013 Okay if you want to use time how will you get the time then? SetupTime variable can be set to what 120 for 2 minutes. But you want to see if the time is greater than SetupTime. The time command (http://community.bistudio.com/wiki/time) only returns the number in seconds since the mission started so we can't use that. So maybe create a local variable that adds one to itself and then in your code check to see if that local variable is greater than SetupTime. _time = 0 _time = _time + 1 ; This will increase the variable by one every time but you will need a while or For loop to make _time increase itself. The condition should look like this. while {waves_east < AIWaveCount && _time > SetupTime} do { //Codes goes here }; Share this post Link to post Share on other sites