Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
FinalSin

Check Presence Of Specific Unit

Recommended Posts

The triggers are really cool for checking whether an entire side is present or not present, but can you check the presence of a unit by name? Is there a function for that?

Share this post


Link to post
Share on other sites

If you want to check if someone is alive/existing at all you can use the alive command. For example using !alive nameOfSomeDude in the condition field of a trigger.

If you want to check if someone is present within a trigger area you can check for specific unit(s) in the area covered by the trigger with the thisList variable.

For example if you want to activate a trigger if player5 that is a BLUFOR soldier is in an area, then set up the trigger as usual to BLUFOR PRESENT, and change the condition field to:

this && player5 in thisList

The trigger can only become true (activate) if all conditions are true.

Share this post


Link to post
Share on other sites

That's a good one I've never seen that before (thislist) used in that way.

You can also just group the trigger to the unit.

Share this post


Link to post
Share on other sites

In a similar vein, I have a IED trigger that needs to go off when any BLUFOR unit is present, EXCEPT for a designated role "A_SASR_13b"

Set trigger as Blufor Present repeatedly, with

Condition

this && !("A_SASR_13b" in thisList) && (alive charge10)

I think the second bit is totally incorrect !("A_SASR_13b" in thisList). How do I get the trigger to go off for any Blufor except this unit? getting confused, thought I'd be using the != boolean check, but can't get it to work. I'm sure its somehting really simple.... :bounce3:

Oh and this is on a dedicated server, and all blufor units (including the one mentioned ) are Players

---------- Post added at 03:46 AM ---------- Previous post was at 03:25 AM ----------

Nevermind, worked it out! :yay::yay:

this && ({_x isKindOf "A_SASR_13b"} count thislist) < 1 && (alive charge10) 

Edited by gnarly_rider

Share this post


Link to post
Share on other sites
Sign in to follow this  

×