Jump to content
Sign in to follow this  
lucilk

lhow to look for flat and clear ground

Recommended Posts

is there any script that checks if the ground of a location or marker is flat and there is no objects, i need this for a script where i have to make a helicopter force land but i need to postion him on a flat ground, but i dont know how to make the script look for a flat and clear area

Share this post


Link to post
Share on other sites

You could just have a large amount of markers set up on places you know are flat ground all over the map, and have it select the one closest.

You'd have to ask someone else how to do that, though.

Edited by loshon

Share this post


Link to post
Share on other sites

not a good ideea, as it will be used in calling some chopers for support and they need to land, i am sure there is a way just dont know what it is

Share this post


Link to post
Share on other sites

Maybe you could use the command: isFlatEmpty?

It seems to do what you want it to, although I'm not sure if it checks for objects (not in a position to test right now).

Share this post


Link to post
Share on other sites

You could combine 'isFlatEmpty' with an AND, and 'nearestobject' style command, with the distance command, where you check 'isflatempty' and whether the nearest object is above a certain distance.

Share this post


Link to post
Share on other sites
You could combine 'isFlatEmpty' with an AND, and 'nearestobject' style command, with the distance command, where you check 'isflatempty' and whether the nearest object is above a certain distance.

This will actually do both, you specify the maximum angle with the value in front of the Max Gradient comment currently set at 0.3 below, the higher the value the greater the slope is allowed to be. Set the local variable _preview to equal the object you want to move, and it checks to see if there is room to place it.

To see how it works, place in a loop that uses a hint to show the returned value in _isFlat, and set the position on yourself. Make _preview something bigger like a warfare building and run around. It will save the position values [x,y,z] in _isFlat only if the criterea is met. So I check the count _isFlat > 0 to tell me if it is returning a valid position.

_isFlat = (_start) isflatempty [
	(sizeof typeof _preview) / 2,	//--- Minimal distance from another object
	0,			//--- If 0, just check position. If >0, select new one
	0.3,			//--- Max gradient
	(sizeof typeof _preview),	//--- Gradient area
	0,			//--- 0 for restricted water, 2 for required water,
	false,			//--- True if some water can be in 25m radius
	_preview			//--- Ignored object
	];

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  

×