OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RangerX3X on 18 Aug 2005, 01:09:47
-
I want to be able to end a mission by the Platoon Leader calling for extraction by Radio whatever.
I want the trigger to check to see if both objectives in the mission - obj1 & obj2 have been completed then end the mission with end 1. If one or both objectives are not met, I want the request for extraction to end the mission with end 2 - mission failure.
Forgive the noobishness of the Q, however I am not exactly certain what to search for and do not have a ton of time to pour over tut's.
Any help would be appreciated - thanks!!!
;D
-
upon completion of each objective set a variable to true (say objective_1,objective_2)
2 triggers
both set to whatever radio you want, but the same for both
trigger 1
end1
condition:this and objective_1 and objective_2
trigger 2
end2
condition:this and not (objective_1 and objective_2)
-
Forgive me if Im wrong, but if undestand correctly, then what you have suggested Triggerhappy, should actually be;
trigger 2
end2
condition:this and not (objective_1 OR objective_2)
(does that work?)
Cause RangerX3X wanted it so that if one of the objectives were not met it would fail, not both....
I think then the whole thing has to change to:
condition:this and not ((objective_1) OR (objective_2))
-
Neither one work.
-
yes funkster is right, my code would execute if both objectives were not met
ranger, did you set the variables objective_1 and objective_2 to true upon completion of your objective
"1" setobjstatus "done";objective_1 = true
-
RangerX3X, these kind gentlemen have posted what is essentially the correct solution. It does work.
What did you do? How do you know it didn't work? The more you tell us, the better chance we have of helping you. ;)
-
1. "1" setobjstatus "done";objective_1 = true
This does not work in the game. It returns "unknown operator". If I remove the "set" it will take it.
2. "upon completion of each objective set a variable to true" I am not great with trigger conditions and had no idea what you meant was "objective_1 = true".
So what I have is this in the test:
c1 Civilian - Objective 1 is to kill him.
c2 Civilian - Objective 2 is to kill him.
Radio Alpha trigger to end the mission - fail if either one of the objectives is not met, and win if both are met.
For the 1st objective trigger I have this:
Condition: not alive c1
Action: "1" objstatus "done"; objective_1 = true
For the 2nd objective trigger I have this:
Condition: not alive c2
Action: "2" objstatus "done"; objective_2 = true
Both triggers work and produce the check marks on the objectives in the briefing book.
The triggers I set for Radio Alpha has this:
Activation: Radio Alpha
Type: End # 1
Condition: this and objective_1 and objective_2
Activation: Radio Alpha
Type: End # 2
Condition: this and not ((objective_1) OR (objective_2))
When I kill both c1 & c2 and then call Radio Alpha, it ends the mission with the End # 1. When I kill only one or the other, then call Radio Alpha, nothing happens. I am still in the mission and still have Radio Alpha available no matter how many times I select it. Same thing occurs if I try to call Radio Alpha having completed no objectives - it just sits there as if it never executed.
Test mission is attached.
-
erm, fogive my intruding, but isn't the correct term objstatus (http://www.ofpec.com/editors/comref.php?letter=O#objStatus), without the 'set'?
also, try modifying the brackets in the end triggers thus:
this and (not (objective_1) OR not (objective_2))
EDIT - it doesn't work because flashpoint doesn't yet recognise the variables objective_1 and objective_2. i defined them in the init line of c1 and it works now - see attached.
-
Works perfectly! Thank you very much. I appreciate the responses from everyone.
;D