Results 1 to 6 of 6

Thread: Function for free landing zone?

  1. #1

    Function for free landing zone?

    hi
    is it possible to find clear landing zone for helicopter?

    I tried this code but it often returns places at tree lines or inside forest.

    Code:
    _exp = "(1 + meadow) * (1 - forest) * (1 - trees)";
    _bestplace = selectBestPlaces [_pos,_radius,_exp,50,1];
    thx

  2. #2
    look into the command isFlatEmpty on the wiki, its more streamlined for open spaces

  3. #3
    Actually I need multible landingzones.. the isFlatEmpty allows to look for one only...

    thats why i tried to use selectbestplaces. But thanks anyway

  4. #4
    Quote Originally Posted by rrr44 View Post
    Actually I need multible landingzones..
    You can give the following function a try:

    fn_randomCirclePositions.sqf:
    Spoiler:


    Use the parameter "objDistance" to define the size of the needed area and set a reasonable max gradient with "maxGradient".
    Since the function doesn't guarantee to return the desired amount of positions, the strategy would be to call that function in a while loop until it does return enough positions, while loosening the restrictions every iteration (for example you could increase the search radius or up maxGradient slightly or something).

    If you need an example on how to use this function, you could look into my RUBE Fire Ants mission.
    scripting: RUBE library | missions: RUBE Fire Ants (SP)

  5. #5
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    i used this in my prareinforce v 1.2 script, works everytime, need function module:

    Code:
    _hPad = editorplaced_hPad_name;  // object we place at the found LZ.
    
    _findGoodSpot = true;
    _maxdist = 100;  // max initial range from below position to search for LZ.
    _LZpos = getPos player;  // position where a safe LZ should be found.
    while {_findGoodSpot} do {
    	_posTemp = [_LZpos, 0, _maxdist, 10, 0, 0.5, 0] call BIS_fnc_findSafePos;
    	_maxdist = _maxdist + 10;  // add to the range to check if no LZ found.
    	sleep 2;
    	_string = format _posTemp;
    	sleep 1;
    	if (!isNil ("_string")) then {
    		_hPad setPos _posTemp;  // place the hPad at the found LZ and exit while loop.
    		_findGoodSpot = false;
    	};
    };
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  6. #6
    Quote Originally Posted by ruebe View Post
    You can give the following function a try:

    fn_randomCirclePositions.sqf:
    Great script thanks! you wrote it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •