56Curious 23 Posted July 29, 2017 Hello, I want to activate a trigger when, after counting the current amount of units present, will activate after say, 3/4 of total is BLUFOR, for example. This is similar to the sector control modules work with the defined amount of units present to switch. More info can be provided if needed, - Curious Share this post Link to post Share on other sites
Nikander 122 Posted July 29, 2017 private _trg = createTrigger ["EmptyDetector", SECTOR_POS]; _trg setTriggerActivation ["ANY", "PRESENT", true]; _trg setTriggerStatements [ "count (thisList select {side _x isEqualTo west})/count thisList isEqualTo 0.75", "hint '3/4 BLUFOR'", "" ]; Define your sector coordinates as 'SECTOR_POS' for the above code. I hope this helps 1 Share this post Link to post Share on other sites
56Curious 23 Posted July 30, 2017 hey Nik thanks for replying! One thing, getting an error at 16 hours ago, Nikander said: west})/count where the /count is causing an error. I tried removing it and fixing the condition, but still get it? Share this post Link to post Share on other sites
Nikander 122 Posted July 30, 2017 6 hours ago, 56Curious said: One thing, getting an error Let me guess what that error might be - oh yes, silly me, it has to be the infamous zero divisor error occurring when nobody is in the trigger area Here, let me fix that for you private _trg = createTrigger ["EmptyDetector", SECTOR_POS]; _trg setTriggerActivation ["ANY", "PRESENT", true]; _trg setTriggerStatements [ "count thisList > 0 && {count (thisList select {side _x isEqualTo west})/count thisList isEqualTo 0.75}", "hint '3/4 BLUFOR'", "" ]; Share this post Link to post Share on other sites
56Curious 23 Posted July 30, 2017 Ah, I had another error via drawIcon3D at the time and couldn't see that seperated one untill I checked RPT files aha. Thank you :D Share this post Link to post Share on other sites