Jump to content

Recommended Posts

anyone know how to find a flat aera the sze of x for example a 100x100 m area.

iam working on some dynamic compositions and i'am having trouble finding large enough areas for them..

also if i could find a flat level area that would be even greater also if its possible to avoid roads and other buildings.. iknow i'am askimg for alot but you think its possible, and if so, how??

Share this post


Link to post
Share on other sites

doh thank you, :)

so..

position isFlatEmpty [float minDistance,float precizePos,float maxGradient,float gradientRadius,float onWater,bool onShore,object skipobj]

i don't understand :( can someone maybe dumbify this for me??

Share this post


Link to post
Share on other sites

See "Example 1" under that link.

"Position" - position, around which you want to find good position for spawn composition;

"minDistance" - how far (at least) from nearest object good position must be. In your case - no less, as maximal composition horizontal dimension (perhaps plus some minimal free space, you want to keep between composition and nearest object), I think. In meters.

"precizePos" - if 0, only check, if "Position" is good. If > 0, find good position around "Position". Not quite sure, but IMHO in such case this means radius of the search in meters.

"maxGradient" - maximal acceptable height difference (terrain steepness) in...

"gradientRadius" - ...that radius. Eg 1 and 1 means, that you allow max steepness of 45 degrees (1 meter of height difference on 1 meter distance).

"onWater" - if position must be on water (0), or must be not on water (2). What with 1? Not sure. Possibly then it is not important, if on water or not.

"onShore" - false/true - if may be near shore, or not.

"skipobj" - object, that shouldn't be taken into account during free area search. In some situations it is useful to put there object itself, that has to be placed on good position.

Edited by Rydygier

Share this post


Link to post
Share on other sites

Here's how I find a safe position for a helo to land. Maybe it can be useful to you.

//Find a flat position around a marker & create an HPad there.
_flatPos = [getMarkerPos _LZMrk , 0, 400, 10, 0, 0.3, 0] call BIS_fnc_findSafePos;
_hPad = createVehicle ["Land_HelipadEmpty_F", _flatPos, [], 0, "CAN_COLLIDE"];

parameters:


_this select 0: center position (Array)
					Note: passing [] (empty Array), the world's safePositionAnchor entry will be used.
_this select 1: minimum distance from the center position (Number)
_this select 2: maximum distance from the center position (Number)
					Note: passing -1, the world's safePositionRadius entry will be used.
_this select 3: minimum distance from the nearest object (Number)
_this select 4: water mode (Number)
					0: cannot be in water
					1: can either be in water or not
					2: must be in water
_this select 5: maximum terrain gradient (average altitude difference in meters - Number)
_this select 6: shore mode (Number):
					0: does not have to be at a shore
					1: must be at a shore
_this select 7: (optional) blacklist (Array of Arrays):
					(_this select 7) select X: Top-left and bottom-right coordinates of blacklisted area (Array)
_this select 8: (optional) default positions (Array of Arrays):
					(_this select 8) select 0: default position on land (Array)
					(_this select 8) select 1: default position on water (Array)

Returns:
Coordinate array with a position solution.

Share this post


Link to post
Share on other sites

I just love this forum, everyone is so helpful and nice, compared to many other places on this big net :) Rydygier great dumndown help thanks :)

Share this post


Link to post
Share on other sites

I'am not at home right now to try it out, but something like this then ?? :

_distance = 300; // Distance from nearest object				(mindistance)
_AreaCamp = 100; // Size of composition						(precisepos)
_maxGrad = 4; // max height difference of _GradientRdius (wich is whole camp) 	(mafgradient)
_maxGradArea = _AreaCamp; // ??							(Gradientradius)
_Water = 2; // Not on water							(onwater)
_shore = false; // close to shore						(onshore)
_skipobj = []; // ??								(skipobj)

_GoodArea = isFlatEmpty [_distance,_AreaCamp,_maxGrad,_maxGradArea,_water,_shore,_skipobj];

makeing it super clear, so anyone who´s reading this thread in the future can understand..

---------- Post added at 23:45 ---------- Previous post was at 23:39 ----------

The the salt lakes is big and flat, but iäm making a dynamic mission, so i want to spawn camps here and there mannig them with units creating mission, be able to cleanup to keep server performace up etc etc :)

Share this post


Link to post
Share on other sites
I just love this forum, everyone is so helpful and nice, compared to many other places on this big net :)

It's all give and take friend. Some years from now, don't forget the new editors that need the help :). We're all in that position at some point or another, and everyone has to start somewhere.

Edited by Iceman77

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×