Jump to content
Sign in to follow this  
alleycat

Kill any player exiting a trigger?

Recommended Posts

I have recently tried to get a very simple method of zone restriction to work. Instead of using ZORA I was looking for something simpler. If any player of a specific group (or side) exits a trigger area, his name should be displayed in a hint and he should be killed with setdammage. However creating a trigger with any group member NOT PRESENT does not fire the desired output.

Share this post


Link to post
Share on other sites

bump as I really would like to find a solution for this.

Share this post


Link to post
Share on other sites

I make 2 triggers, 1 is for messaging who is leaving.

1st trigger:

present this

on act:

Hint "%1 is leaving the battlefield, get back or you will be killed!"

On deactivation: hint "" (so it shows exactly when they leave)

2nd trig:

present this (usually do a timeout of say 45 seconds til they are killed)

so if they are in the trigger for 45 seconds (condition this)

on act:

player setdamage 1;

Make sure both triggers are on repeat

Share this post


Link to post
Share on other sites
Hint "%1 is leaving

This references the unit that fired the trigger automatically? Very practical. thx for the info

---------- Post added at 11:19 AM ---------- Previous post was at 10:13 AM ----------

Also would "player setdamage" work on the specific player that exited or any? I am talking about MP.

Share this post


Link to post
Share on other sites
This references the unit that fired the trigger automatically? Very practical. thx for the info

Umm... no that wouldn't. It would simply print: "%1 is leaving"

%1 is used within the format command as a placeholder, like:

hint format["%1 has activated the trigger!", name (thislist select 0)];

Would print: "kylania has activated the trigger!", usually*.

For what you're wanting to do, you'd put various triggers around your zone to block off the areas, not a single central trigger.

Share this post


Link to post
Share on other sites

Activation PRESENT on side you want to scan (WEST or whatever you want)

"condition" field:

not (player in thislist)

"on activation" field:

player setDammage 1; hint "You left the area";

But the message will be shown only to killed player

Share this post


Link to post
Share on other sites

why not just make 1 oval shaped trigger and set to not present? that way anybody that leaves the trigger will die?

i dont see the need for making numerous triggers to check if their in them, when you can check if there out of them.

Share this post


Link to post
Share on other sites
why not just make 1 oval shaped trigger and set to not present? that way anybody that leaves the trigger will die?

i dont see the need for making numerous triggers to check if their in them, when you can check if there out of them.

that wouldnt do anything. not present is the condition, not part of the action statement

Share this post


Link to post
Share on other sites
that wouldnt do anything. not present is the condition, not part of the action statement

not sure i understand what you mean, what has been offered already is using PRESENT as the condition. i see it being alot easier to do

trigger

repeatedly

not present

anybody

countdown 20

act:

player setdamage 1

and im sure theres a way to return an array of units outside of the trigger. maybe something like ! (in thislist)

Share this post


Link to post
Share on other sites
not sure i understand what you mean, what has been offered already is using PRESENT as the condition. i see it being alot easier to do

trigger

repeatedly

not present

anybody

countdown 20

act:

player setdamage 1

actually that makes sense. but there is no "anybody" command that I'm aware of. but this is ok, because I believe the OP really wants only a certain subset of units to apply to this rule anyway. So now the problem is, youre seeing if a unit in one list, is not in another...and this is terrible as far as cpu cycles go considering this is a constant process. so it seems as though it would be more efficient to put an event handler on each object, and saying when they get so far away from a point, then kill them

the only alternative is creating a trigger for each unit that you're monitoring...but this can get equally costly in cpu time...i definitely suggest something that notifies you

and im sure theres a way to return an array of units outside of the trigger. maybe something like ! (in thislist)

also, something you should understand about '!', is that is a boolean operator. which means it applies to other booleans. in some languages you can apply it to objects, or primitive data types that are not booleans, but the point is, it returns a boolean itself, regardless of what it is applied to. so applying !, to in thisList basically doesn't do anything because in needs an object to test against, but if we modified it, we could say if(!(obj in thisList)), and this would return true if the object is not in the list. but it still requires an object and an array to pass into in. point I'm trying to make is that you can't negate an array, and get another array, it doesn't work that way

Edited by GDICommand

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  

×