chneemann 0 Posted May 26, 2016 Hi, I want to use a script many times in one mission. That's not a problem, but in this script I create a marker. And markernames seems to be public names even when I add an "_" before. That's why I had the idea to create a random name for the marker. something like _randomnumber = round(random 50); Markername+%_randomnumber = createMarker ["Markername+%_randomnumber", position AAF_HQ]; sleep 10; Markername+%_randomnumber setmarkerpos (getpos leader _grp1) But of Course >Markername+%_randomnumber< will not work. Any idea? Share this post Link to post Share on other sites
Greenfist 1863 Posted May 26, 2016 You could format the name like this: createMarker ["Markername" + (str _randomnumber), position AAF_HQ]; or of course with the actual format command. But I can't see why the variable name should be random. Maybe just use _marker? Only 51 possible random names may create conflicts though. How about something like random 100000 without rounding? Share this post Link to post Share on other sites
gc8 970 Posted May 26, 2016 one way to have unique marker name is use the position: _pos = position AAF_HQ; _marker = "Markername" + (str _pos); createMarker [_marker,_pos]; _marker setmarkerpos (getpos leader _grp1); 1 Share this post Link to post Share on other sites
bad benson 1733 Posted May 26, 2016 i usually use the position as a name since i assume there's only going to be one marker at that position at a time. _pos = getpos AAF_HQ; createMarker [str _pos, _pos]; EDIT: goddamn ninjas! :ph34r: 1 Share this post Link to post Share on other sites
sarogahtyp 1105 Posted May 26, 2016 if there are more markers at same position (very unlikely) then u could do this to avoid double marker names: _unique_name = false; while(!_unique_name) { _randomnumber = floor random 100000; _name = "Markername" + (str _randomnumber); if(!(_name in allMapMarkers)) then {_unique_name = true;}; } createMarker [_name, position AAF_HQ]; 2 Share this post Link to post Share on other sites
kylania 567 Posted May 26, 2016 The marker is always going to be at the position of the AAF_HQ right? Why not just place it on the map (or spawn it once) and move it as the HQ moves instead of randomly creating it every time? 1 Share this post Link to post Share on other sites