OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 1stJemHadar on 22 Aug 2002, 14:46:15
-
Hi everyone.
I need some help with a mission I'm working on.
You see, I have a script which checks the status of the different objectives.
Now, if the player get's too close to a gamelogic that I have placed on the map, I wan't the player to loose the mission. But what is the command for use in scripts that makes the player loose the game?
Thanks.
-
Can't see anything in the comref. Can't you just create a trigger with a condition that doesn't let the unit get within a certain distance and if he does then the trigger (loose) will be activated?
Or have I misunderstood what you're doing?
-
The way I generally do it looks a bit like this:
Script
...
? player distance logic < 50: loose = true
...
Trigger
Radius: 0,0
Condition: none
Type: End Loose
Condition Field: loose
That will activate the trigger as soon as loose becomes true (which happens in the script, if the player is less than 50m from logic)
The specific name loose isn't important, this is just a variable. You can use whatever name you like (apart from a few reserved words).
Just rememeber to define the variable (ie. put loose = false) in your init.sqs or in the init field of a unit somewhere ;)
-
mikeb -
Normally I could do that, but I do not believe I can use only triggers in this case. That is, it there isn't some way to deactivate a trigger.
Sui -
Great, thanks ;D
That solved my problem.
-
No Worries mate :)
Do you think you could use the Problem Solved button please (Top right by the quote button).
That way the lovely and talented FAQ Guys will see that this topic's been solved when they come round collecting for the Editing Depot. Thanks ;)
-
Oh, certainly. Didn't know such a button existed.