Home   Help Search Login Register  

Author Topic: End mission if u take too long?  (Read 777 times)

0 Members and 1 Guest are viewing this topic.

Gooner861

  • Guest
End mission if u take too long?
« on: 20 Aug 2004, 14:43:32 »
Hi there,

In a mission im making i have the player making a choice of going sumwhere to fight or staying to attack a camp nearby a town.

Now wot i want to do is if the player decides to get in a chopper to fight at another location, i want to prevent the player being able to change his mind and decide to go on and clear the camp near the town ur in.

So i dunno how that can be dun, cud u script sumthing where say the player has say 1 minute to get on the chopper, if he takes longer than the mission is over.

Sorry if this sounds rushed. In a hurry.

Cheers

Gooner

Offline Mud_Spike

  • Contributing Member
  • **
Re:End mission if u take too long?
« Reply #1 on: 20 Aug 2004, 15:34:37 »
The elapsed mission time (in seconds) is returned by the 'time' command/variable.

If you assign a variable when the player has one minut to get in the chopper (in a trigger, script, waypoint, wherever) like so:
Code: [Select]
getin_chopper_timeout = time + 60
And then have a trigger with the condition:
Code: [Select]
getin_chopper_timeout < time
you can have that trigger perform the End - Loose (or whatever it is) action.




Gooner861

  • Guest
Re:End mission if u take too long?
« Reply #2 on: 20 Aug 2004, 18:45:20 »
Well you see what i have is a have a main trigger, which the player activates and than he is given a choice to call in a chopper or not.

So i think wot i'll have to do is put all that code in the choppers LOAD waypoint, when it arrives to pick me up.

Cheers

Gooner

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:End mission if u take too long?
« Reply #3 on: 20 Aug 2004, 19:42:40 »
Be aware of using time though...
It is reset to 0 after a savegame is loaded...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mud_Spike

  • Contributing Member
  • **
Re:End mission if u take too long?
« Reply #4 on: 20 Aug 2004, 20:36:47 »
Thats good info, HK, you should add that as a comment to the command reference entry.


Gooner861

  • Guest
Re:End mission if u take too long?
« Reply #5 on: 20 Aug 2004, 20:58:48 »
So if sumone loads a savegame the timer wont work?

Rokket

  • Guest
Re:End mission if u take too long?
« Reply #6 on: 21 Aug 2004, 05:25:50 »
Don't know if this will help, I don't fully understand, but it's from the old UBER Ref guide:

==================
At first,you need write "Description.ext" like this.
***************************************
TitleParam1 = "TimeLimit:";
ValuesParam1[] = {600,900,1200,1500,1800};
DefValueParam1 = 600;
TextsParam1[] = {"10 min","15 min","20 min","25 min","30 min"};
***************************************
then,you can choose time limit when starting game.
and put trigger
--Type:End #1
--Condition:Time >= Param1
(Command"Time" is reference to how many seconds passed since starting game.)
Then,game will end if time comes.
This is a beginner course.

Now,you can show selectable menu on ServerSetup screen by "Description.ext".
and its possible also at Param2.
For example,if you want selectable TimeZone menu,
write "description.ext" like this.
***************************************
TitleParam2 = "TimeZone:";
ValuesParam2[] = {6,12,18};
DefValueParam2 = 2;
TextsParam2[] = {"Morning","Noon","Evening"};
***************************************
next, put trigger for init.
--Cond:true
--OnAct:SkipTime Param2
(Dont forget to set Time of Intel to "0:00")
then,you can choose time zone at ServerSetup screen.

==================

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:End mission if u take too long?
« Reply #7 on: 21 Aug 2004, 16:51:41 »
Quote
So if sumone loads a savegame the timer wont work?
The timer on the trigger works, yes.

But the 'command' time has a bug that when ever a saved game is reloaded the time value it gives resets back to 0...

So, if using a script that bases some of it's 'actions' to time it will get screwed after savegame reload...

Surely, the example given in the second post won't probably get screwed so badly as not many use their 'only' savegame in the beginning...

Quote
Thats good info, HK, you should add that as a comment to the command reference entry.
Oh, it isn't there allready...
Well, should be added then...


regarding the question:
I'm a bit 'lost' what you want exactly, but in the most simpliest way you could use a timeout trigger.

Make a trigger that covers the area where player and the chopper are, then put the trigger on timeout 60/60/60, activated by the player side, and write in the condition field: vehicle player in thisList
Then, in the on activation field you put the variable controlling the 'bad' end for the mission and set it to true, like my_badend=true.
Then, make a end trigger, like end#2 or something (assuming you use the end#1 for the 'good' end) with condition my_badend in it's condition field...
Now, in theory ( ::) ), the timeout trigger should 'trig' if the player is in the trigger area after 60 seconds and then 'trig' the 'bad' end trigger...
But as I said, in theory, no guarantees that it will work...

As for not allowing the player to go and 'clean' the closest town, it depends on whether you want the location to be available for 'cleaning' later on in the mission or not...
If not, you could use a variable that is set to true when the player selects the other location than the closest town and when that variale is set to true, all the enemies in the closest town would be deleteVehicled...
That is of course a bit crappy way of doing this if the briefing states that there's enemy activity in that town and when you fly over it with the chopper there's no enemies there at all... ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:End mission if u take too long?
« Reply #8 on: 21 Aug 2004, 17:27:28 »
Quote
As for not allowing the player to go and 'clean' the closest town, it depends on whether you want the location to be available for 'cleaning' later on in the mission or not...
If not, you could use a variable that is set to true when the player selects the other location than the closest town and when that variale is set to true, all the enemies in the closest town would be deleteVehicled...
That is of course a bit crappy way of doing this if the briefing states that there's enemy activity in that town and when you fly over it with the chopper there's no enemies there at all...  

u can do wat bis did in their mision.... if u go 2 far from the mision area a spetznatz appears n shot u ::);D

or u can use the daytime command as this doesnt reset everytime... somin like that i think

Code: [Select]
_taam = daytime
@daytime = (_taam +1/60)
watever

not sure bout the sec lin tho :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gooner861

  • Guest
Re:End mission if u take too long?
« Reply #9 on: 21 Aug 2004, 18:55:47 »
Thanks for the help guys, im gonna give it a whirl now. I'll get back to u soon.

Gooner

Nulear_Man

  • Guest
Re:End mission if u take too long?
« Reply #10 on: 22 Aug 2004, 16:10:34 »
YOu COuld Also Do this
TimeLimitSecs = 1200
~TimeLimitSecs
EndMission

;the endMission command may not be correct (it should force end of mission)