Home   Help Search Login Register  

Author Topic: Checking whether something with a probability of presence showed up or not...  (Read 411 times)

0 Members and 1 Guest are viewing this topic.

glottis

  • Guest
Hi guys.  I'm a first time poster, long time reader ;)  I checked around for the answer to this first, but couldn't find anything, so I apologise if this has been asked/answered before.

Anyway, my problem is that I have a number of trucks that have a 50% probability of presence.  The player's mission is to destroy all of the trucks that are present.  I need to know how to check whether the truck has been destroyed, but !alive does not do the job, because a truck is still counted as alive (for the purposes of that command anyway) if it didn't appear in this instance of the mission. So I need to know how you check if a truck, erm, exists i guess, so i can do an "if truck exists && is !alive then do stuff" kinda thing.

Oh, also...I can't just use 'not present' triggers because the trucks will be moving, and surrounded by units of the same side at the beginning.

I did think of one solution where you use the getlist command of a trigger, and the use a 'for each' thing on it, but I don't see how I can use a condition within the for loop - as in, I'd need it to be "for each unit in this trigger, if the unit is a ural, do some stuff"

Any help would be much appreciated.  Thanks...
glottis
« Last Edit: 30 Aug 2003, 15:54:04 by glottis »

glottis

  • Guest
OK, I've worked it out - you can just use the init field of the unit, which is only executed if the unit is present.

I dunno if i should just delete this topic, but I figured someone might search for it in the future...

Cheers anyway dudes :)