OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wadmann on 04 Feb 2004, 20:36:47
-
As the title implies, I would like to have all of the dead units deleted after I leave the battle area. I have three areas of conflict: a small village, a town, and a jungle camp. After leaving the area, how do I clean up the prior area of the remaining dead units?
I was thinking of either using a WP or trigger and when the player reaches a point away from the last battle, the script would then activate.
Can I just use a condition in a trigger and activate it this way:
Cond: "!alive _x" foreach thislist
Act: "deletevehicle _x" foreach thislist
Is there a better way to acheive my goal? Thanks in advance.
Wadmann
-
Make a trigger fire after YOU have left the trigger area:
!(player in thislist) && finished
(where "finished" is set TRUE in some other trigger, like when all EAST units are dead or alike).
ya could setup two triggers w the same size, one returning true the "finished" condition
then the other trigger (with those conditions) could go like:
"DeleteVehicle _X" foreach ThisList
see if it works m8
-
Thanks for the reply Tomb! :D
I thought that I was on the right track but I did not think that I had it exactly right. I will try this when time permits.
One question on variables used as a condition:
Do they need to be declared "False" in an init or are they false by default until made true?
I have seen missions where the creator has defined the variables as "false" in the init but I thought that I read that they are false by default. As many replies that I have seen that ask one to use variables like in this instance and no one has ever stated to declare them false beforehand, I assume that they must be false by default.
Wadmann
-
Undefined/uninitialised variables are NOT false. Or true.
If the game meets an undefined variable, it treats the whole expression as false. So if you have a trigger
Condition: this and var1 and (not var2)
it will not fire until var2 has been set to false. This could be done in init.sqs or somewhere else.
In other words, if var1 or var2 are undefined then
this and var1 and (not var2)
is false.
Sometimes you need to define (declare) a variable as false in init.sqs, but sometimes you don't. It depends on how the variable is being used.