Home   Help Search Login Register  

Author Topic: "Detected by" Trigger revealing units multiple times. Not working  (Read 1302 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Hi all.

I am working on a mission where I want the player (who is a high commanding major) to "reveal" all enemy units that are detected by his side in a large trigger. What I'm after is to simulate that the player should get icons of enemy positions and movement on the map, if those are detected by his side. This should work as "continous radio reports" by his fellow groups.
To do this I have a trigger that works like this. Player is BLUFOR.

OPFOR detected by BLUFOR
Repetedly
Condition: this
OnActivation: {player reveal _x} foreach thislist

My problem is that the trigger only activates once, meaning that only the first OPFOR unit detected by BLUFOR is revealed to the player (icon appears on the map). The trigger is set on repetedly, so why doesn't all units that are detected thereafter, appear on the map. They are obviously detected, but not revealed.

Cheers.

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
OPFOR detected by BLUFOR
Repetedly
Condition: this
OnActivation: givemetargets = true
OnDeactivation: givemetargets = false
TRIGGERNAME = tr_spy


in your init.sqf add the following code:
Code: [Select]
[]spawn
{
   while {true} do
   {
      if (givemetargets) then
      {
         {player reveal _x} foreach list tr_spy;
         Sleep 2;
      };
      Sleep 1;
   };
};

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Thanks Mandoble.

I just tried spawning a new trigger every time and also deleting the old one through a script. This seems to work well to.

trigger = createTrigger ["EmptyDetector", position player]
trigger setTriggerActivation ["OPFOR", "WEST D", true]
trigger setTriggerArea [10000, 10000, 0, false]
trigger setTriggerStatements ["this", "{player reveal _x} foreach thislist; deletevehicle trigger; triggerused = true; trigger = ObjNull", ""]
exit

In the editor I have placed a repetedly trigger activated by "triggerused" which starts this script again.

Cheers.

Laggy

And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.