Poet 0 Posted May 10, 2003 2nd post in here today! I promise I got a pretty darned slick Mini-Campaign on the way though. How can I set a time limit for the Player in a Single Player Mission set off by a trigger? E.g - Player boards chopper, Timer starts - Player shoots lots of stuff. If the player doesnt kill everything in 5 minutes, then the mission ends... Sounds simple, and I trawled these forums, and all my guides again, but can only find how to set time limits for MP missions. Again, any help would be appreciated. Thanks Poet. Share this post Link to post Share on other sites
RED 0 Posted May 10, 2003 Make a trigger with this following in its condition field: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">player in choppername<span id='postcolor'> In the onactivation field: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">[time in seconds] exec "timer.sqs"<span id='postcolor'> Now make the script file with this in it: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _time = _this select 0 _i = 0 #loop ~1 _i = _i + 1 ?_i < _time: goto "loop" endtrigger = true <span id='postcolor'> Now make a trigger with "endtrigger" in the condition field and trigger type "end1" RED Share this post Link to post Share on other sites
Poet 0 Posted May 10, 2003 Thanks for the help and the quick response again RED! Certainly on the ball today. Â But, Â Can't get it to work. I have set it up exactly as above. But nothing happens. I have the player getting in the rear of the Chinook ( sniping from the rear of a BAS machine, is there anything more fun? ), with an AI as pilot. Will that affect it? ( though I also tested with the player getting in as pilot ... ) I have both Triggers I created set to Activation "None" though I tried with "Anybody" as well, and neither seem to work. I tried with "player in choppername" and "playername in choppername" ... I tried creating a new mission with just those triggers and the script etc, just in case anything in my mission was messing it up, and it still wouldnt work. Hope you can help! Poet. Share this post Link to post Share on other sites
RED 0 Posted May 10, 2003 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _timevar = _this select 0 _i = 0 #loop ~1 _i = _i + 1 ?_i < _timevar: goto "loop" endtrigger = true <span id='postcolor'> I made a mistake in the script, use this one. RED Share this post Link to post Share on other sites
Poet 0 Posted May 10, 2003 Great Work RED! I went cross-eyed staring at the script trying to work it out. Thanks once again! Share this post Link to post Share on other sites
sanctuary 19 Posted May 10, 2003 Is it not easier to just use a small trigger and have a west or east or resistance unit , so you put at Activation West or East or Resistance and in the Min Max Average case you put 300 (300 seconds = 5 mn) and in Type you put Ending1 or 2 or 3 ... ? Share this post Link to post Share on other sites
smogmorph 0 Posted May 10, 2003 That's the best method if you want the timer to start when you start the mission. He wants the timer to start when he enters the chopper, therefore RED's script is alot better. Share this post Link to post Share on other sites
iNeo 0 Posted May 10, 2003 Why can't the variable be called _time? Share this post Link to post Share on other sites
RED 0 Posted May 10, 2003 Because _time is the time from when the script was activated. RED Share this post Link to post Share on other sites
toadeater 0 Posted May 11, 2003 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (smogmorph @ 10 May 2003,10:54)</td></tr><tr><td id="QUOTE">That's the best method if you want the timer to start when you start the mission. He wants the timer to start when he enters the chopper, therefore RED's script is alot better.<span id='postcolor'> You can get it to work in a trigger by putting: player in heli in the trigger's condition field instead of using activated by. Share this post Link to post Share on other sites