Jump to content
Sign in to follow this  
Poet

Setting a time limit in a sp mission?

Recommended Posts

2nd post in here today! wow.gif

I promise I got a pretty darned slick Mini-Campaign on the way though. tounge.gif

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

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

Thanks for the help and the quick response again RED!

Certainly on the ball today.   smile.gif

But,   sad.gif

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

</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

icon14.gificon14.gificon14.gif

Great Work RED!

I went cross-eyed staring at the script trying to work it out. tounge.gif

Thanks once again!

Share this post


Link to post
Share on other sites

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

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

Why can't the variable be called _time?

Share this post


Link to post
Share on other sites

Because _time is the time from when the script was activated.

RED

Share this post


Link to post
Share on other sites

</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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×