Jump to content
Sign in to follow this  
kutya

dead group check

Recommended Posts

Having problem with a check if one whole group is dead. Tried the most logical solution to me:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? ((!alive soldier1) && (!alive soldier2) && ... (!alive soldierX)) : some command

But it seems that if you put too much && or || in a single check, it wouldnt work. I've got 7 soldiers.

EDIT: Managed to solve the problem. Made {killed}eventhandlers to all squad members, and counted how many of them died. It's functional, but I'd like to avoid using global variables, so I'm still interested for a better solution.

Share this post


Link to post
Share on other sites

You could use count and units...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? count UNITS groupName == 0 : some command; Exitor...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? count UNITS group unitName == 0 : some command; Exit

But it seems that if you put too much && or || in a single check, it wouldnt work.

Not that I know of, but it does get harder to spot mistakes!

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  

×