Jump to content
Sign in to follow this  
k0rd

emptydetector with ANY activation acts funny?

Recommended Posts

Hi - so I couldn't get the following example to work as expected:


_trigger=createtrigger["emptydetector", _position]; //assume that _position is already set for the purposes of this example
_trigger setTriggerArea[500,500,0,true]; //1km^2
_trigger setTriggerActivation ["ANY", "PRESENT", false];
_trigger setTriggerStatements[this,"",""];

numRed = { side _x == east; } count list _trigger;
numGreen= {side _x == resistance;} count list _trigger;
numBlue = {side _x == west;} count list _trigger;

does not work at all.

_trigger=createtrigger["emptydetector", _position]; //assume that _position is already set for the purposes of this example
_trigger setTriggerArea[500,500,0,true]; //1km^2
_trigger setTriggerActivation ["EAST", "PRESENT", false];
_trigger setTriggerStatements[this,"",""];

numRed = { side _x == east; } count list _trigger;

works fine, but I have to make 3 triggers. Covering the whole of altis in 1km blocks, that is the difference between x and x*3 where x is close to 700.

I'm hoping there is a way to leverage activation ANY - or perhaps of an easier way to get an array of units within a certain area without using a trigger?

edit: also yes, I know the {side _x == east; } argument to count in the second example is redundant - I included it to illustrate that side _x == east is a valid filter

Edited by k0rd

Share this post


Link to post
Share on other sites

There are two issues and one that may be causing the problem.

_trigger setTriggerStatements[this,"",""]; should be _trigger setTriggerStatements["this","",""];

although it's not needed in this script.

second issue.

Your creating the trigger but triggers only check every half a second but this list is checked instantly so it never gets chance to store the units.

just place a sleep1; before the

sleep 1;// allow trigger to check for units.
numRed = { side _x == east} count list _trigger;
numGreen= {side _x == resistance} count list _trigger;
numBlue = {side _x == west} count list _trigger;

Share this post


Link to post
Share on other sites
There are two issues and one that may be causing the problem.

_trigger setTriggerStatements[this,"",""]; should be _trigger setTriggerStatements["this","",""];

although it's not needed in this script.

second issue.

Your creating the trigger but triggers only check every half a second but this list is checked instantly so it never gets chance to store the units.

just place a sleep1; before the

sleep 1;// allow trigger to check for units.
numRed = { side _x == east} count list _trigger;
numGreen= {side _x == resistance} count list _trigger;
numBlue = {side _x == west} count list _trigger;

thanks, yes this is true - i typed this example up on my phone. the true script does not get the counts instantly (every 5 seconds in a loop - it uses the results to update markers) and has the correct "this" in the statement.. still doesn't work in the first example but does in the second.

Share this post


Link to post
Share on other sites

This is working fine for me, tested in A2/OA

_position = getpos _this;

_trigger=createtrigger["emptydetector", _position];
 _trigger setTriggerArea[500,500,0,true];
    _trigger setTriggerActivation ["ANY", "PRESENT", false];
      _trigger setTriggerStatements["this","",""];

        sleep 1;

          numRed = { side _x == east } count list _trigger;
            numGreen= {side _x == resistance} count list _trigger;
              numBlue = {side _x == west} count list _trigger;
                hint format ["%1  %2  %3",numRed,numGreen,numBlue];

Share this post


Link to post
Share on other sites
This is working fine for me, tested in A2/OA

_position = getpos _this;

_trigger=createtrigger["emptydetector", _position];
 _trigger setTriggerArea[500,500,0,true];
    _trigger setTriggerActivation ["ANY", "PRESENT", false];
      _trigger setTriggerStatements["this","",""];

        sleep 1;

          numRed = { side _x == east } count list _trigger;
            numGreen= {side _x == resistance} count list _trigger;
              numBlue = {side _x == west} count list _trigger;
                hint format ["%1  %2  %3",numRed,numGreen,numBlue];

can you try in A3? :)

Share this post


Link to post
Share on other sites

Just tested it and it's working as is no changes.

Share this post


Link to post
Share on other sites
Just tested it and it's working as is no changes.

must be something i'm doing - strange that just changing "EAST" to "ANY" breaks mine :/

edit: thanks for your patience, i was using call compile format[" etc and had the wrong amount of quotes around this :)

Edited by k0rd

Share this post


Link to post
Share on other sites

I can't explain that, try it on a fresh map and test again. I had a map last night where sidechat wouldn't work.

Share this post


Link to post
Share on other sites

thanks for your help - everything is working right now.

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  

×