Jump to content
Sign in to follow this  
roguetrooper

How to transform this check into a trigger-condition?

Recommended Posts

There are 64 playable units on my map. When one player gains a certain amount of score, a trigger shall be activated.

It could be done with a clumsy trigger, checking for all players separately. But 64 are to much.

(score player1 >= x) or (score player2 >= x) ... or (score playerN >= x)

is not very convenient for 64 units.

Could somebody think of some elegant and short check construction containing "forEach" / "allunits" (or whatever is necessary) that works as a trigger CONDITION?

Share this post


Link to post
Share on other sites

Maybe

{(score _x) > 1000} count playableUnits > 0

Or if you want somehing to happen to that special player,

(score player) > 1000

But both triggers and "player" are local to each client, so that trigger would only be true for the client where it happened. If you want stuff to happen for everyone or only the server you could do this on the activation field:

myCustomPV = player; publicVariable "myCustomPV";

And then handle that publicVariable with a publicVariableEventHandler where you want it to be handled

It all depends on what you want to do :) If whoever reached a certain score doesn't matter, you could just set the PV to true and have another trigger with a condition containing the name of that PV.

Edited by cuel

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  

×