MiB_rus 0 Posted October 30, 2020 I am trying to use array in blacklist of BIS_fnc_randomPos. In array all Towns of map. My task: to make spawn everywhere, except for the area of cities. towns = (nearestLocations [[worldSize / 2, worldsize / 2, 0], ["NameCity", "NameVillage", "NameCityCapital"], worldSize]); townsPosSize = []; { townsPosSize pushBack [(locationPosition _x select 0), (locationPosition _x select 1), ((size _x) select 0)*3]; _name = format["mrk_%1", text _x]; _foo = createmarker [_name, [locationPosition _x select 0, locationPosition _x select 1]]; _foo setMarkerSize [((size _x) select 0)*3, ((size _x) select 0)*3]; _foo setMarkerShape "ELLIPSE"; _foo setMarkerBrush "SOLID"; _foo setMarkerColor "ColorRed"; } forEach towns; //test for "_i" from 1 To 200 do { _newPosTest = [nil, [townsPosSize,"water", [getPos player, 600]]] call BIS_fnc_randomPos; _nameT = format["mrk_%1", _i]; _fooT = createmarker [_nameT, _newPosTest]; _fooT setMarkerType "hd_dot"; _fooT setMarkerColor "ColorGreen"; }; But the function BIS_fnc_randomPos ignores this (area of cities). I also tried _newPosTest = [nil, [towns,"water"]] call BIS_fnc_randomPos; But the result is the same. "water" - works, towns - not works. Share this post Link to post Share on other sites
Tankbuster 1731 Posted October 30, 2020 I could never make it work either. I do remember reading ages ago that I was doing something wrong, but I don't remember exactly what. Share this post Link to post Share on other sites
Harzach 2505 Posted October 30, 2020 The code itself works fine, you just have corrupted characters. Copy/paste into a code block as in my screenshot above, delete the red dots, then copy/paste that edited code into your script or whatever. 1 Share this post Link to post Share on other sites
pierremgi 4736 Posted October 30, 2020 It's just a question about how you build your blacklist. Try: towns = (nearestLocations [[worldSize / 2, worldsize / 2, 0], ["NameCity", "NameVillage", "NameCityCapital"], worldSize]);townsPosSize = ["water",[getpos player,600]]; { townsPosSize pushBack [[(locationPosition _x)#0,(locationPosition _x)#1],((size _x)#0)*3]; _name = format["mrk_%1", text _x]; _foo = createmarker [_name, [locationPosition _x select 0, locationPosition _x select 1]]; _foo setMarkerSize [((size _x) select 0)*3, ((size _x) select 0)*3]; _foo setMarkerShape "ELLIPSE"; _foo setMarkerBrush "SOLID"; _foo setMarkerColor "ColorRed"; } forEach towns; for "_i" from 1 To 200 do { _newPosTest = [nil, townsPosSize] call BIS_fnc_randomPos; _nameT = format["mrk_%1", _i]; _fooT = createmarker [_nameT, _newPosTest]; _fooT setMarkerType "hd_dot"; _fooT setMarkerColor "ColorGreen"; }; 3 Share this post Link to post Share on other sites
Harzach 2505 Posted October 30, 2020 Yeah, I'm not firing on all cylinders lately and completely misunderstood the problem. @pierremgi's code works. 2 Share this post Link to post Share on other sites
MiB_rus 0 Posted November 2, 2020 Thank you @pierremgi Now code work. Share this post Link to post Share on other sites
codeivo 1 Posted November 24, 2020 how could I whitelist the townsPosSize with the same @pierremgi script? tried switching their place at the randomPos call but it gives me the error: 2 elements provided, 3 expected Share this post Link to post Share on other sites
pierremgi 4736 Posted November 24, 2020 In the code above, townsposSize is a variable (array) with all locations like ["NameCity", "NameVillage", "NameCityCapital"] Feel free to add or subtract existing location types for Arma3 . I mean existing on map... Not sure you can find a strongPointArea on Stratis, for example. For their positions, always use locationPosition and setPosition .... Not tested on existing locations. You can create your own locations. Share this post Link to post Share on other sites
Larrow 2779 Posted November 25, 2020 3 hours ago, pierremgi said: Not tested on existing locations. From memory( and I don't think it was ever changed ) vanilla locations are the name tag for the location on the map and not the actually town/city etc itself. Which makes them worthless as town/city area definitions. Share this post Link to post Share on other sites