Jump to content
Sign in to follow this  
Rejn

Checking if a group exsists/is alive

Recommended Posts

How can i get a trigger to check if a group exsists?/Is still alive?

For example.. I tried si being the groupname I want the trigger to check:

si==grpnull

however I think it only checks once ...

The group should it no longer exsist should then proceed to activate the trigger.

Any one know how to go about this? I was hoping this would be more efficient than the trigger checking if all units withinb the group are alive/dead.

I walso want to avoid list + counters as reinforcements are added to the group later on.

thanks.

Share this post


Link to post
Share on other sites

You cannot compare with "objNull", it's not comparable, only assignable.

To check whether a group is an actually existing group:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (!isNull _grp) then {...}

To check if there are any units alive:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (({alive _x} count units _grp) > 0) then {...}

Share this post


Link to post
Share on other sites

Set a trigger, make the size 20000 by 20000. Group it to the group leader and set it to whole group "not present".

If you want to monitor both alive and dead add another trigger like above and set it to whole group "present".

After that check the trigger value.

Share this post


Link to post
Share on other sites

Thanks guys! Great ideas and script thanks! biggrin_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×