k0rd 3 Posted April 12, 2014 (edited) 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 April 12, 2014 by k0rd Share this post Link to post Share on other sites
f2k sel 164 Posted April 12, 2014 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
k0rd 3 Posted April 12, 2014 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
f2k sel 164 Posted April 12, 2014 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
k0rd 3 Posted April 12, 2014 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
f2k sel 164 Posted April 12, 2014 Just tested it and it's working as is no changes. Share this post Link to post Share on other sites
k0rd 3 Posted April 12, 2014 (edited) 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 April 12, 2014 by k0rd Share this post Link to post Share on other sites
f2k sel 164 Posted April 12, 2014 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
k0rd 3 Posted April 12, 2014 thanks for your help - everything is working right now. Share this post Link to post Share on other sites