Home   Help Search Login Register  

Author Topic: Delete Dead Units After Leaving Area  (Read 541 times)

0 Members and 1 Guest are viewing this topic.

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Delete Dead Units After Leaving Area
« 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
Check out my Camouflage Collection! New items added 31 July 2005.

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Delete Dead Units After Leaving Area
« Reply #1 on: 05 Feb 2004, 01:46:52 »


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

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Delete Dead Units After Leaving Area
« Reply #2 on: 05 Feb 2004, 02:02:44 »
   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
Check out my Camouflage Collection! New items added 31 July 2005.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Delete Dead Units After Leaving Area
« Reply #3 on: 05 Feb 2004, 02:24:47 »
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.
« Last Edit: 05 Feb 2004, 02:25:54 by macguba »
Plenty of reviewed ArmA missions for you to play