OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mad Pup on 28 Jan 2010, 00:23:17
-
Hi Mad Pup again (sorry for the sudden burst of questions), I would like to know, how to have a trigger, stop executing once an AI civilian is dead. For example, I make a trigger, that executes every time you enter it's boundries, and it has a civilian man in the middle. And once I kill that civilian, the trigger stops executing, even though you exit the boundries, and come back in.
-
I think that trigger editing should solve your problem.
Name your old trigger "atrigger"
Add new trigger.
Make it the same size as the one you want to execute while civilian is present.
Place it close to your old trigger.
Group the civilian with the new trigger, open it up and edit it to following:
Vehicle (can only be done when vehicle (i.e. soldier, civilian, Tank etc.) is grouped with trigger)
Once
Not Present
In "On Activation" field write "deleteVehicle atrigger" (of course, without the quotation marks).
____________________________________________________________________________________________
Hope that helps,
Krieg
-
Yay! It Worked! :D
Thanks Once Again Krieg! :good:
-
Just to help keep unnecssary trigger amounts down you could simply add the check inside the condition field.
Condition: this && (alive unitname)
That way the script will check for unit presence and the life status of a particular unit.
You could also do it this way...
Condition: ? (player distance unitname < 1) and !(alive unitname)
OnActivation: Deletevehicle triggername
You can adjust the distance to your requirements and execute additional code after the deletion by using a semicolon. (If you need to) It will also reduce the amount of triggers used throughout your mission as well as reduce the clutter formed by group lines.
-
Thanks savedbygrace! I'll look into it.
Mad Pup