Jump to content
Sign in to follow this  
galzohar

"kill everyone who enter zone" trigger

Recommended Posts

So I thought I had the simple solution, as it does seem to work most of the time:

Actication by <whoever I want to not enter>

Repeatedly

Present

onAct: {_x setDammage 1} forEach thislist;

The problem is that sometimes units seem to manage to get into the trigger area without getting killed. It seems to only happen when multiple units enter the trigger area quickly. My guess would be that if a unit walks in the trigger area while the "onAct" is still running, it will not activate the trigger and will not be in the trigger's list, though again this is only a guess and I don't really know what is causing it.

If anyone actually knows for sure what is causing this issue and can suggest a working fix I would much appreciate it.

Of course this issue isn't only related to "kill everyone" trigger but also to other things that rely on the list of units that are inside the trigger area.

Share this post


Link to post
Share on other sites

Yeah, its very simple:

Someone walks into the trigger area and activates it, in other words, set its status to "active". While active there is no chance to activate it again, it must be deactivated before, i.e., no unit of given side is within the trigger area.

Now what I don't know actually, is, how long a dead unit remains in the triggerlist.

Share this post


Link to post
Share on other sites

It seems while the trigger is active any unit that walks into it will add into its list, but it will not re-activate, however in another mission when I use the list of units in a trigger I had issues with it sometimes not working (though the issue is not necessarily in the trigger but again this is a rather simple script picking a random unit from the list and setting a waypoint on its position).

Edited by galzohar

Share this post


Link to post
Share on other sites

Instead of putting the damage code into the onAct field of the trigger put it into the Condition field:

call {if (count thislist > 0) then {{if (alive _x) then {_x setDamage 1}} forEach thislist};false}

This will check the trigger list two times a second and damage all units that are still alive.

The false ensures that the trigger condition will never be true, means it will never stop (no need for Repeatedly then).

Xeno

Share this post


Link to post
Share on other sites

You could have a loop in a script that would check objects near the trigger using

http://community.bistudio.com/wiki/nearestObject

If the nearest object was a man type object or something you could set it's damage to 1, or if you're needing to kill multiple people, you could have them all run scripts or something that checks the distance between them and the trigger (or marker) and kills them.

http://community.bistudio.com/wiki/distance

Share this post


Link to post
Share on other sites

Xeno's works great. But its nice to warn players before they get killed off :)

Share this post


Link to post
Share on other sites

Yeah I did Xeno's solution, though giving a hint in that case might not work on certain occasions, and some more complex solution would be needed. But at least it always kills them.

Share this post


Link to post
Share on other sites
Xeno's works great. But its nice to warn players before they get killed off :)

You can allways add a second (bigger) trigger and use a condition like this:

player in thislist

and display a hint in onAct.

Xeno

Share this post


Link to post
Share on other sites

Yeah, that's a nice solution, as that way only the invading player will get the hint.

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  

×