Jump to content
Sign in to follow this  
Binary

Counting players in a marker area

Recommended Posts

Hello people smile_o.gif

I'm in need of a very specific script.. The script needs to do the following:

When a player (only players, not AI) enters an area defined by a marker, a message should pop op on screen displaying "<Playername> have arrived"

<Playername> should be the name of the player (his in-game profile name).

AND

As each player arrives in this area a text-box should show "1/8 players have arrived" etc. (followed by 2/8, 3/8 and so on).

Any ideas? I've tried searching forums but no luck so far..

Share this post


Link to post
Share on other sites

You may want to try a trigger setup like this:

trigger.gif

It's constantly being triggered by itself (that's what the tests and resettings of the "loop" variable do), because otherwise a regular presence trigger will not re-fire if a matching unit is already in its radius (i.e. once a player enters the zone, the next player will not activate the trigger again).

Then it goes through the list of units in the trigger area (the content of the thislist array), and checks whether the unit is human or not (via the isPlayer command). It takes the name of each player, and adds it to an array. In this example that array is constantly being displayed on the screen, but I'm sure you'll be able to tweak this setup to suit your demands.

Share this post


Link to post
Share on other sites

I'am don't think that's good:

format["%1", loop]=false

when i'am use that in ofp, it often crash game...

format["%1", loop] can be "scalar bool array string ..." it no good

smile_o.gif

maybe that beter:

Condition:

isnil "loop"

On Act:

.....; loop=nil

On Dea:

....; loop=true

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  

×