Jump to content
Sign in to follow this  
twisted

Count markers on map

Recommended Posts

hi. I am trying to make a script automatically sets up a marker where a certain group logic is placed. but i read that each marker needs a unique name.

i found something very useful for making unique names.

http://forums.bistudio.com/showthread.php?138485-Is-it-possible-to-have-dynamically-named-variables

so i reckon if i can count all markers on map, then name the newest marker something like marker+(totalmarkers+1) each would be guaranteed uniue.

my question is....... How do i count all the markers on the map?

Share this post


Link to post
Share on other sites

There is no command to count all markers. But you can just use a variable instead:

in the init.sqf set this:

total_markers = 0;

now in our marker creation script:


Marker_index = total_markers;

_marker_name = format["Marker_%1",Marker_index];

_marker = createMarker [_marker_name, _markerpos];

///  Set all your other marker properties here...

total_markers = total_markers + 1;

Now each time you run it it will update the marker_index and provide each marker a new name.

Share this post


Link to post
Share on other sites

awesome. works perfectly! thank you very much.

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  

×