OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Knut Erik on 04 Feb 2003, 13:15:06
-
I've got a problem..
I have this mission where you are taken captive. You start in a chopper and is taken to a fieldcamp. I've made a trigger that is activated if "West not pressent". But this script will start at onse because I'm not in the zone before the chopper take me there.
My idea is that when the chopper reaces the waypoint "transport unload", the trigger will become true. But it cant become true!! It must became "this"
HOW DO I DO!
??? ??? ???
-
In the On Activation field of the Transport Unload waypoint, put the following code:
AtCamp = true
In your init.sqs script (create one if you don't have one), put the following code:
AtCamp = false
In your trigger's Condition field, put the following code:
this and AtCamp
Explanation: As long as the AtCamp boolean is false, the trigger's condition will not be met even though you are not present in the trigger's area. Once the helicopter's Transport Unload waypoint is activated, the boolean will become true, which will then allow the trigger to check if you are not present in its area. This will only work if the waypoint drops you off within the trigger's area, though. Otherwise, the trigger will activate the moment the waypoint is activated, which is not what you want.
-
Alternatively create two triggers in the same spot.
the first trigger will set AtCamp = 1 when your player enters. and activated once.
the second trigger will activate on (!(present) && Atcamp)
So you have four scenarios:
Player has not gotten to camp
AtCamp = 0
Present = 0
(2nd trigger (0 && 1) == 0)
Player has reached the camp
AtCamp = 1
Present = 1
(2nd trigger (1 && 0) == 0)
Player leaves the camp again
AtCamp = 1
Present = 0
(2nd trigger (1 && 1) == 1) -- trigger goes off
;;;;;;;;;;; This scenario would be impossible. but still safe
AtCamp = 0
Present = 1
(2nd trigger (0 && 1) == 0)
-
Thank you all! You solved my problem!!
Now i can continiue to creat my campaign.
I think i'l relase a demo soon, but for now...
Bye and thanks!
8)