XOSPECTRE 40 Posted August 1, 2019 hello. I have problem to create marker on absolutely random location I can create marker but I want create it on random location on map I use this: BLACK_SITE1 = createMarker ["BLACK_SITE1", [6859,7318,0]]; BLACK_SITE1 setMarkerType "hd_dot"; "BLACK_SITE1" setMarkerSize [0, 0]; and I need some number somewhere what put this marker randomly enywhere on map or at least at random distance from its created location.. Share this post Link to post Share on other sites
beno_83au 1369 Posted August 1, 2019 Look here, at the very first link. Share this post Link to post Share on other sites
XOSPECTRE 40 Posted August 1, 2019 I try this many times its just not working … I mean I cant implement it. don't know what im doing wrong .. BLACK_SITE1 = [] call BIS_fnc_randomPos; does nothing Share this post Link to post Share on other sites
Maff 251 Posted August 1, 2019 (edited) _randomPositionOnMap = [] call BIS_fnc_randomPos; BLACK_SITE1 = createMarker ["BLACK_SITE1", _randomPositionOnMap]; BLACK_SITE1 setMarkerType "hd_dot"; BLACK_SITE1 setMarkerSize [0, 0]; // Are you sure you want the marker to be 0 size? - Or - _randomPositionAroundPosition = [[[[6859,7318,0], 1500]], ["water"]] call BIS_fnc_randomPos; BLACK_SITE1 = createMarker ["BLACK_SITE1", _randomPositionAroundPosition]; BLACK_SITE1 setMarkerType "hd_dot"; BLACK_SITE1 setMarkerSize [0, 0]; // Are you sure you want the marker to be 0 size? Edited August 1, 2019 by Maff I always miss out brackets in the second example. Always! 2 Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted August 1, 2019 For an absolutely random position as stated in the first post one could use something like this: _rndMapPos = [(worldSize / 2),(worldSize / 2),0] getPos [random (worldSize / 2) * 1.4142,random 360]; //simple test for "_i" from 1 to 100 do { _rndMapPos = [(worldSize / 2),(worldSize / 2),0] getPos [random ((worldSize / 2) * 1.4142),random 360]; _markerstr = createMarker [str _rndMapPos, _rndMapPos]; _markerstr setMarkerShape "ICON"; _markerstr setMarkerType "mil_dot" ; }; Again, this will return a position that can be anywhere on the map, can be on water, far away from any landmass etc. Cheers 2 Share this post Link to post Share on other sites
XOSPECTRE 40 Posted August 1, 2019 Thank you so much guys really appreciate your help. Sometimes I just don't understand scripting Share this post Link to post Share on other sites