Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
DÄZ

[SOLVED] Delete a marker by trigger

Recommended Posts

hi,
I have a small problem, my current script generates 100 markers randomly on map, each markers and attached to a trigger, I name my markers using:

_markerName = format ["Zone_BCM_%1", floor (random 200)];

I would like, once the conditions of the trigger filled, to delete the marker attached to the trigger.

example: I have fulfilled the condition of the trigger attached to the marker "Zone_BCM_54"
How to delete it?

I thought about:

deleteMarker format ["Zone_BCM_%1", ??? ];


Thank you in advance, and sorry for my english.

  • Haha 1

Share this post


Link to post
Share on other sites

how about first storing the markers to an array and then deleting them? like this:


 

markersArray = []; // init

// Create markers:
_markerName = format ["Zone_BCM_% 1", floor (random 200)];
markersArray pushback _markerName;

// Delete markers:
{
 deleteMarker _x;
} foreach markersArray;
markersArray = []; // reset

 

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

thx

 

I did not know this possibility, I will test, I'll let you know

Share this post


Link to post
Share on other sites

It's almost that!! I do not know if it comes from my scripts. Whatever the trigger activate just the 1st marker spawn on map is delete

Share this post


Link to post
Share on other sites

Oh bonne mère!

Just create your trigger on the marker and "text" it with the marker name:

_markerName = format ["Zone_BCM_% 1", floor (random 200);

_marker = createMarker [_markerName, position blabla];

 

Then use setTriggerText:

_trg = createTrigger ["EmptyDetector", getMarkerPos _markerName];

_trg setTriggerArea blabla.......;

_trg setTriggerText _markerName;  // never mind that doesn't appear in game.

 

in on activation, just add: deleteMarker (triggerText thisTrigger)

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

thx,

 

I test this

Share this post


Link to post
Share on other sites
23 hours ago, pierremgi said:

Oh bonne mère!

Just create your trigger on the marker and "text" it with the marker name:

_markerName = format ["Zone_BCM_% 1", floor (random 200);

_marker = createMarker [_markerName, position blabla];

 

Then use setTriggerText:

_trg = createTrigger ["EmptyDetector", getMarkerPos _markerName];

_trg setTriggerArea blabla.......;

_trg setTriggerText _markerName;  // never mind that doesn't appear in game.

 

in on activation, just add: deleteMarker (triggerText thisTrigger)

 

 

 

 

hi, it works perfectly. Thank you very much for the help

Share this post


Link to post
Share on other sites

×