Joe98 92 Posted June 3, 2016 I placed 50 markers on the map to allow me to start at 50 places at random. As the mission starts I want to delete the 50 markers. The markers are named marker0 to marker49. To delete the first marker the command is: deleteMarker "marker0"; How can I write a command to delete the 50 markers with one command instead of 50 commands? Share this post Link to post Share on other sites
kylania 568 Posted June 3, 2016 Adapting the example from the Biki: { private "_a"; _a = toArray _x; _a resize 6; if (toString _a == "marker") then { deleteMarker _x; } } forEach allMapMarkers; Or just a for 0 to 49 loop deleting them all. for "_i" from 0 to 49 do { deleteMarker format["marker%1", _i]; }; 4 Share this post Link to post Share on other sites
FR-Helios 28 Posted June 3, 2016 {deleteMarker _x} forEach allMapMarkers; ;) Share this post Link to post Share on other sites
sarogahtyp 1109 Posted June 3, 2016 {deleteMarker _x} forEach allMapMarkers; ;) this deletes every marker on map even those which could be needed. Share this post Link to post Share on other sites
R3vo 2654 Posted June 3, 2016 {deleteMarker _x} forEach ["marker0","marker1","markerN"]; kylania 's way however is the best solution for your problem. Share this post Link to post Share on other sites
Von Quest 1163 Posted June 3, 2016 There are invisible markers you can use too. Forget the name, but it's the purple ring ones. You can also just set the alpha channel to 0 as well as an option if you need to keep them. Share this post Link to post Share on other sites
serena 151 Posted June 3, 2016 Function delete all markers with names starting from given template: Fn_DeleteMarkersStartingWith = { { if (_x find _this == 0) then { deleteMarker _x} } forEach allMapMarkers }; For example: // Removes markers "MySuperMarker_123", "MySuperMarker_A", "MySuperMarker_SomethingElse" "MySuperMarker_" call Fn_DeleteMarkersStartingWith; 1 Share this post Link to post Share on other sites
kylania 568 Posted June 3, 2016 Neat way to check that using the new syntax for find, serena! Note that find is case sensitive. Share this post Link to post Share on other sites
Joe98 92 Posted June 4, 2016 Thanks for the responses. It turns out that the invisible marker is the best solution! My plan was to be able to see the marker in the editor but not be able to see the markers in-game. The correct name is: Markers-System-Empty . 1 Share this post Link to post Share on other sites