Worleman313 0 Posted March 16, 2007 K, how in the heck are you suppose to make a time limit for the game?? Every time i try to do it, it always seems to mess up! Could someone please help me??? Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted March 16, 2007 Multiplayer or Single Player? In SP, all you gotta do is this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _startTime = time; _timeLimitInSeconds = 600; while (time-_startTime < _timeLimitInSeconds) do { blah blah blah blah blah blah blah blah blah }; That while loop will time out after 600 seconds. Just one way of many to do it. Another way I can reccomend if you just want the script to wait and do nothing for that time limit or a condition is met (the code is probably a little wrong here, but spending some time with the wiki will fix you up): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _timeLimitInSeconds = 600; waitUntil {(time-_startTime < _timeLimitInSeconds) or (other condition)}; Share this post Link to post Share on other sites
Worleman313 0 Posted March 16, 2007 will that SP Time limit work for Mp Too?? Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted March 16, 2007 Someone else will have to answer that for sure, I'm not an MP editor. It probably should though, imo. As long as it's executed server side for something that needs to be synchronised. Share this post Link to post Share on other sites
DieAngel 0 Posted March 16, 2007 i would use a countdown trigger... Share this post Link to post Share on other sites
celery 8 Posted March 16, 2007 This is the most accurate way I've done it so far: Place at the end of init.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;Time limit in seconds _time = 1800 ?!local server:goto "check" ending = 0 publicvariable "ending" #servercheck ?time >= _time:goto "serverend" ~0.01 goto "servercheck" #serverend ending = 1 publicvariable "ending" #check ?ending == 1 : goto "end" ~0.01 goto "check" #end ;only if the mission has an outro, the outro script should contain the ending command ;if there is no outro, replace with end=true [] exec "outro.sqs" exit To trigger the real end of the mission, make a trigger with "End1" as one of the selections and a condition of end=true, the end section of your timer or outro script should have that same command to activate it. In my maps the activation box has forceEnd as a command to make sure, I'm not sure if it's needed. The above is superior to triggers because it ends the game almost at the exact same time for all players, whereas triggers aren't known to be so precise (1-2 second margin of error compared to 5-20 seconds). Share this post Link to post Share on other sites