Jump to content
Sign in to follow this  
sproyd

Detection Script Help - Detected by Trigger not working

Recommended Posts

I'm building a sniper mission where I want to bring in reinforcements if the sniper is detected. My first attempt was to have reinforcements with a waypoint synced with a Trigger. The Trigger was a simple Switch Trigger with a standard dropdown BLUFOR Detected by OPFOR condition. It doesn't seem to work and checking the BIS description here it sounds like its based on knowsAbout levels which are in turn based on several factors including distance - which in the case of the sniper could be quite a way.

So I want to build a script where the trigger is activated if any OPFOR unit detects the Player to the point where they'd be likely to call reinforcements. IRL they aren't going to wait until they positively ID their target and see the whites of his eyes if they are being fired upon by a high calibre sniper rifle - they would call armored backup ASAP.

I am thinking something along the lines of below for the trigger activation

if (((any OPFOR/EAST) knowsabout Player) > 1.49)

then

{

true

}

Does this look right? And how would I code the any OPFOR/EAST section?

Thanks, Merci, Gracias, Arigatoo

Share this post


Link to post
Share on other sites

Okay I've resorted to doing it just for one of the enemy groups called group1... but this script isn't working

{if ((_x knowsabout Player) > 1.49)

then

{

playerdetected=true

}

} foreach (units group1);

Share this post


Link to post
Share on other sites

assuming your group is set group1 = group this then it should be like this

playerdetected=false;{if ((_x knowsabout Player) > 1.49)  then  { playerdetected=true  }  } foreach (units group1); playerdetected

Share this post


Link to post
Share on other sites

hi

it should be something like

TAG_fnc_doTheyKnow = compileFinal
"{
 playerDetected=false;

 {
   if ((_x knowsAbout player) > 1.49)  then
   {
     playerDetected = true;
   };
 }
 forEach (units _this);

 playerDetected;
}";  


if isServer then
{
 _null = [] spawn
 {
   waitUntil { sleep 0.1; group1 call TAG_fnc_doTheyKnow };
   // now they knows... do something...
 };
};

if u wish to do it repeatedly

if isServer then
{
 _null = [] spawn
 {
   while { true } do
   {
     waitUntil { sleep 0.1; group1 call TAG_fnc_doTheyKnow };
     // now they knows... do something...
     sleep 30;
   };
 };
};

Edited by LoonyWarrior

Share this post


Link to post
Share on other sites
assuming your group is set group1 = group this then it should be like this

playerdetected=false;{if ((_x knowsabout Player) > 1.49)  then  { playerdetected=true  }  } foreach (units group1); playerdetected

hang on isn't that my exact script from post num. 2? It doesn't work.

I resorted to the old enemy1 & enemy2 & enemy3 way of doing things...

Share this post


Link to post
Share on other sites

not quite your missing playerdetected=false; ; playerdetected

the trigger is set false playerdetected=false; until the script becomes true and the variable sent to the trigger playerdetected still false until script sets it true

Edited by F2k Sel

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  

×