HazJ 1288 Posted June 3, 2018 Hi all, Okay so. I have multiple different code/functions for finding flat area/position, etc... What I am after now is different. I want to find a random position on the map which is flat. I got this far. The problem is that the trees/bushes/etc sometimes appear. I tried selectBestPlaces command but not having much joy. I think the expression is incorrect. I saw in another thread that someone clears the area by checking if trees/bushes are there using nearestTerrainObjects. I don't really want to do this if possible. Tried isFlatEmpty as well. It is just Tanoa... When it does work. It isn't always consistent. It can works once and then the other 10 tests or so no position is found. Any suggestions? Share this post Link to post Share on other sites
7erra 629 Posted June 3, 2018 Have you tried BIS_fnc_findSafePos? I don't know if terrain objects are also included in the objDist param. Share this post Link to post Share on other sites
HazJ 1288 Posted June 3, 2018 Yeah. I tried that. No luck. Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted June 3, 2018 You can also place grasscutters all over the place. For trees/large bushes have you tried to delete them or is that not desired? Cheers Share this post Link to post Share on other sites
HazJ 1288 Posted June 3, 2018 Rather not delete them if possible. Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted June 3, 2018 8 minutes ago, HazJ said: Rather not delete them if possible. Well you could also just hide them if that's wanted: _stuff = nearestTerrainObjects [player, ["HIDE","ROCKS","TREE","BUSH","SMALL TREE"], 20]; {_x hideObjectGlobal true} forEach _stuff; No idea otherwise, except further tweaking of the selectBestPlaces command, which can be a bit finicky. Cheers Share this post Link to post Share on other sites
HazJ 1288 Posted June 3, 2018 What would the expression be for go at open area. No trees, etc around. Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted June 3, 2018 16 minutes ago, HazJ said: What would the expression be for go at open area. No trees, etc around. Something like this: {deletemarker _x} foreach allMapMarkers; _centerPos = getArray (configfile >> "CfgWorlds" >> worldName >> "centerPosition"); _allMeadows = selectBestPlaces [_centerPos,(worldSize / 2) * 1.4142,"(1 - forest) * (1 - hills) * (1 - sea) * (1 - trees) * (1 + meadow) * (1 - houses)",50,100]; _allMeadows = _allMeadows apply {_x#0}; { _marker = createmarker [str _x, _x]; _marker setmarkertype "mil_flag"; _marker setmarkercolor "ColorRed"; _marker setmarkertext format ["Flat %1",_forEachIndex]; } forEach _allMeadows; Additionally you could check for nearTerrainObjects as shown above. Cheers 4 Share this post Link to post Share on other sites
HazJ 1288 Posted June 3, 2018 Thanks Grumpy. Will try that out later tonight when I get home. 1 Share this post Link to post Share on other sites
HazJ 1288 Posted June 3, 2018 Works great @Grumpy Old Man! Thank you. There is rare chance it will get a position near rocky area or on a slope, etc but gives me something to improve! Thanks again! 1 Share this post Link to post Share on other sites
kibaBG 49 Posted January 14 @Grumpy Old Man Is there a possibility to find flat terrains using BIS_fnc_randomPos, not BIS_fnc_findSafePos, because I want to find flat place in a forest and clear it from trees (for some forest camps :))? Share this post Link to post Share on other sites