Jump to content
magicpanda

Rules for 'detected by' triggers

Recommended Posts

I'm having trouble getting this trigger to run repeatedly and wondered what the rules are governing the detected by condition.

 

It seems to never fire more than once. 

 

I run into the trigger area with lots of separate groups (EOS). I'm detected once, get the shells and the hint. However if I move around being detected by different groups it never fires again. Am I missing something?

m1trg = createTrigger ["EmptyDetector", getMarkerPos "Artyspawn"];
m1trg setTriggerArea [600, 600, 0, false];
m1trg setTriggerActivation ["WEST", "EAST D", true];
m1trg setTriggerStatements ["this", "mortargunner1 commandArtilleryFire [getposatl (thislist select 0), '8Rnd_82mm_Mo_shells', 2]; hint 'Incoming!'",""];
m1trg setTriggerTimeout [10, 10, 10, false];

 

Share this post


Link to post
Share on other sites

Welp after messing with Zeus, it seems the rules for repeating Detected by triggers are really messed up. Not touching this method with a bargepole.

Share this post


Link to post
Share on other sites

Couldn't let this go... so I did some more testing, after about 30 seconds of hiding out of sight the trigger deactivates.

 

I have a theory, just need some syntax help, to see if it's possible to pass a location from a trigger to a script or if there is a better way?

 

Here is the vague plan/concept

 

m1trg = createTrigger ["EmptyDetector", getMarkerPos "Artyspawn"];
m1trg setTriggerArea [1000, 1000, 0, false];
m1trg setTriggerActivation ["WEST", "EAST D", TRUE];
m1trg setTriggerStatements ["this && alive mortargunner1",                                                                                //condition
" hint 'Incoming!'; passedtriggerPostion = [getposatl (thislist select 0)]; 0 = execVM [passedtriggerPostion] mortargunner1Loop.sqf",      //on Trigger Activation        
"detectedB = false; hint 'escaped detection"];                                                                                            //deactivated.

sqs...

 

detectedB = true;


while {detectedB = true && alive mortargunner1} do { 


mortargunner1 commandArtilleryFire [passedtriggerPostion], '8Rnd_82mm_Mo_shells', 2];


sleep 5;


mortargunner1 commandArtilleryFire [passedtriggerPostion], '8Rnd_82mm_Mo_Flare_white', 1];


sleep 5;


mortargunner1 commandArtilleryFire [passedtriggerPostion], '8Rnd_82mm_Mo_shells', 2];


};

 

Share this post


Link to post
Share on other sites

If your're using "getPosATL" you don't need [ ] around it, and you could just do it directly in the script call, i.e.:

0 = [(getPosATL (thisList select 0))] execVM "mortargunner1Loop.sqf";

*You also had the arguments and the "execVM" flipped.

Share this post


Link to post
Share on other sites

Cracked it cheers Jshock, could be better. Might be better to pass the unit somehow so the mortar tracks and then make the gunner a bit less accurate.

 

Trigger

m1trg = createTrigger ["EmptyDetector", getMarkerPos "Artyspawn"];
m1trg setTriggerArea [1000, 1000, 0, false];
m1trg setTriggerActivation ["WEST", "EAST D", TRUE];
m1trg setTriggerStatements ["this && alive mortargunner1", "hint 'Incoming!'; 0 = getPosATL (thisList select 0) execVM 'mortargunner1Loop.sqf';", "detected_B = false; hint 'escaped detection';"];

 

 

while {detected_B} do { 


sleep 2;
mortargunner1 commandArtilleryFire [_this, "8Rnd_82mm_Mo_shells", 2];
hint 'mortar round 1 Fired';


sleep 4; //increase to simulate enemy radioing position


mortargunner1 commandArtilleryFire [_this, "8Rnd_82mm_Mo_shells", 2];
hint 'mortar round 2 Fired';

sleep 4; //increase to simulate enemy radioing position


mortargunner1 commandArtilleryFire [_this, "8Rnd_82mm_Mo_shells", 2];
hint 'mortar round 3 Fired';
};

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

×