RizlaUK 4 Posted February 5, 2016 Hi, I'm trying to add a command to a trigger condition in the 2d editor but can't seem to get the syntax correct, can anybody help with this please? This is what i'm trying to add to prevent air vehicles activating my alarm trigger count (thisList unitsBelowHeight 2) > 0 at the moment i just have alarmToggle; in the condition box. I've tried count (thisList unitsBelowHeight 2) > 0; alarmToggle; I'm not too good with this so any help would be great. Regards Rizla Share this post Link to post Share on other sites
killzone_kid 1333 Posted February 5, 2016 Hi, I'm trying to add a command to a trigger condition in the 2d editor but can't seem to get the syntax correct, can anybody help with this please? This is what i'm trying to add to prevent air vehicles activating my alarm trigger count (thisList unitsBelowHeight 2) > 0 at the moment i just have alarmToggle; in the condition box. I've tried count (thisList unitsBelowHeight 2) > 0; alarmToggle; I'm not too good with this so any help would be great. Regards Rizla Maybe instead of count (thisList unitsBelowHeight 2) > 0; alarmToggle; try count (thisList unitsBelowHeight 2) > 0 && alarmToggle Share this post Link to post Share on other sites
RizlaUK 4 Posted February 6, 2016 Maybe instead of try count (thisList unitsBelowHeight 2) > 0 && alarmToggle The syntax errors are gone, but now the alarm doesn't sound when Opfor are within the trigger area. Share this post Link to post Share on other sites
killzone_kid 1333 Posted February 6, 2016 alarmToggle should be true for trigger to detect and false for trigger to not to detect. Most efficient expression in this case would be: alarmToggle && {count (thisList unitsBelowHeight 2) > 0} This way, right part of the expression will not be evaluated at all if alarmToggle is false Share this post Link to post Share on other sites
RizlaUK 4 Posted February 6, 2016 alarmToggle should be true for trigger to detect and false for trigger to not to detect. Most efficient expression in this case would be: This way, right part of the expression will not be evaluated at all if alarmToggle is false I got the alarm triggers from an example mission and they are setup as below; 1. named trgAlarm type=none, activation=none, repeatedly, present, condition=alarmToggle && {count (thisList unitsBelowHeight 2) > 0}; 2. type=none, activation=Opfor, repeatedly, present, condition=this, on acc=alarmToggle = true; publicVariable "alarmToggle"; 3. type=none, activation=Opfor, repeatedly, not present, condition=this, on acc=alarmToggle = false; publicVariable "alarmToggle"; If i have alarmToggle; in the condition box of the first trigger, the alarm activates but air vehicles also set it off. Share this post Link to post Share on other sites
killzone_kid 1333 Posted February 6, 2016 this is not going to work because thisList will always be empty for the first trigger, as you set it to detect nothing. make 1 trigger, instead of 3. set it to detect opfor repeatedly and for condition write: this && {count (thisList unitsBelowHeight 2) >0} 1 Share this post Link to post Share on other sites
RizlaUK 4 Posted February 6, 2016 Thanks killzone_kid - that works perfectly now. Regards Rizla Share this post Link to post Share on other sites