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

How do I kill players that leave an area?

Recommended Posts

In a multiplayer map, if someone leaves a city I want them to die.

I tried by making a city-sized trigger with "Anybody not present", conditioned on "!(player in thisList)", and spawned an arty shell over their head.

It works fine in solo testing, but if I play with other people, when one person leaves the city, a bomb is spawned over EVERY player's head. Now they're all mad at me. Please help.

Share this post


Link to post
Share on other sites

There might be more elegant ways instead of using triggers, but dunno any ^^

I think the condition is correct, since "player" always addresses only the local instance, in other words, if a particular player leaves the trigger it should not be necessarily true on every other machine. What exactly did u written in the activation field?

Try this: Trigger "Anybody present", condition "player in thislist"

And on Deactivation, i.e., once the player leaves the trigger area and is not in the list anymore, write

player setDamage 1

That should do the trick.

Edited by Bon

Share this post


Link to post
Share on other sites

When a trigger activates on any client, it activates on every client & the server (even if the conditions are not met locally).

Share this post


Link to post
Share on other sites
When a trigger activates on any client, it activates on every client & the server (even if the conditions are not met locally).

:butbut:

Got it. I can fix this by moving the "if (player in thisList)" bit from the Condition field to the On Activation field.

Share this post


Link to post
Share on other sites

Would it be easier to set minefields surrounding the city?

Share this post


Link to post
Share on other sites
:butbut:

Got it. I can fix this by moving the "if (player in thisList)" bit from the Condition field to the On Activation field.

You could use this for on activation too:

{_x setDamage 1) forEach thisList

Share this post


Link to post
Share on other sites
You could use this for on activation too:

{_x setDamage 1) forEach thisList

That works for units inside an area, but I don't think thisList will ever give you a list of units outside an area.

Share this post


Link to post
Share on other sites

I made a paintball mission once in ArmA1 that used this.

I started out by looking at the code in the wizzard. I think it was the deathmatch templete pbo. That might give you an example of how BIS did it in the canned missions.

Share this post


Link to post
Share on other sites

In ArmA (1), thisList for a not present trigger returned the same unit as a present trigger (units on the chosen side within the trigger). I'm not sure how I came to that conclusion since that is an empty array.

Just did a quick test in ArmA 2, thisList returns an empty array (as expected above).

Edited by ceeeb

Share this post


Link to post
Share on other sites

hahahaha! sorry, but i can´t help to be amused, this is a very funny problem... LOL! you blew everyone up! ROFL!

haha...aaaahh.... *sigh*... ok, well, it´s VERY nice to know that triggers fire for all players even when only one has matching local conditions - this can be used to broadcast events over the net...

a player can have a complex script running on his side, and his side only, then when that script generates something that must affect everyone, it fires a trigger which executes a response-script for everybody... very useful bit of info, indeed

but still, LOL

you made me laugh! cheerz!

Share this post


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

×