Sign in to follow this  
~EL BARTO~

Safe Zone Relocate for Exile?

11 posts in this topic

Hi, i searching for a mod running with exile like the "safe zone relocate" found here:

https://github.com/oiad/safeZoneRelocate/blob/master/README.md

Maybe someone scripted it for exile and like to share it with the community...i can't find it in the hole forum yet...i tried to rescript it for exile but it will not run :rock:

 

Hallo.

Suche ein Script das Fahrzeuge in der Safezone nach dem Restart in eine Art Junkyard teleportiert, wie z.b. das hier:

https://github.com/oiad/safeZoneRelocate/blob/master/README.md

Habe auch schon selber probiert es für Exile zum Laufen zu bringen...leider ohne Erfolg.

Vllt. gibt es jemanden der so etwas hat und es hier mit uns allen teilen mag...wäre super nett.

 

Edited by ~EL BARTO~

Share this post


Link to post
Share on other sites
On 22.11.2017 at 1:13 PM, ~EL BARTO~ said:

Habe auch schon selber probiert es für Exile zum Laufen zu bringen...leider ohne Erfolg.

Geändert, getestet und für gut befunden. Wenn _useCustomPosition "true" ist - stehen deine Fahrzeuge in der @ _customPosition definierte Position.

Ansonsten werden die Fahzeuge 1km ausserhalb der Safezone positioniert. Safezones werden in _SafeZonePosArry definiert:

/*
	Safe Zone Relocate by salival (https://github.com/oiad)
	Adjusted for EXILE by WURSTKETTE
*/

private ["_safeZonePosArray","_customPosition","_customRadius","_maxDist","_nearVehicles","_objDist","_position","_safeZonePos","_safeZoneRadius","_useCustomPosition"];

_safeZonePosArray = [
	//[[X,Y],radius]
 	[[13336.1, 14475.8],100] 
];


_useCustomPosition = true; // Enable a custom position to move vehicles to (i.e a junk yard)
_customPosition = [23680.5,18419.4,0];  // Position for vehicles to be moved to if _useCustomPosition = true;
_customRadius = 5; // Minimum distance from the custom position to move vehicles to 
_maxDist = 1000; // Maximum distance from the safe zone position to find a safe position or custom position for relocation, setting this too low can make vehicles spawn very close to other vehicles.
_objDist = 15; // Minimum distance from the safe position for relocation to the center of the nearest object. Specifying quite a large distance here will slow the function and might often fail to find a suitable position.

{
	_safeZonePos = _x select 0;
	_safeZoneRadius = _x select 1;
	_nearVehicles = _safeZonePos nearEntities [["Air","LandVehicle","Ship"],_safeZoneRadius];
	{
		if (_useCustomPosition) then {
			_position = [_customPosition,_customRadius,_maxDist,_objDist,1,0,0,[]] call BIS_fnc_findSafePos;
		} else {
			_position = [_safeZonePos,_safeZoneRadius + 50,_maxDist,_objDist,if (_x isKindOf "Ship") then {2} else {0},0,0,[],[_safeZonePos,_safeZonePos]] call BIS_fnc_findSafePos;
		};
		_x setPos _position;
		
		diag_log format ["[SAFEZONE] %1 was moved out of a safe zone to: @%2 %3",typeOf _x,mapGridPosition _position,_position];
	} forEach _nearVehicles;
} forEach _safeZonePosArray;

Bitte, danke - Tschüss.

Edited by WURSTKETTE
  • Like 2

Share this post


Link to post
Share on other sites
Advertisement

Not sure where to add this server side.  I tried placing it in its own pbo in the addons folder of the @Exileserver called safezone_relocate.pbo

contents of safezone_relocate.pbo:

7304810d8ca1bc1937cf5e99f6bab669.png

config.cpp

Spoiler

class CfgPatches {
    class sz_relocate {
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {};
    };
};

class CfgFunctions {
    class sz_relocate {
        class A3CCustom {
            file = "SafeZone_Relocate\init";
            class init {
                postInit = 1;
            };
        };
    };
};

 

safeZoneRelocate.sqf

Spoiler

/*
    Safe Zone Relocate by salival (https://github.com/oiad)
    Adjusted for EXILE by WURSTKETTE
*/

private ["_safeZonePosArray","_customPosition","_customRadius","_maxDist","_nearVehicles","_objDist","_position","_safeZonePos","_safeZoneRadius","_useCustomPosition"];

_safeZonePosArray = [
    //[[X,Y],radius]
     [[4064,11665,0],510], // Bash
    [[6326,7809,0],510], // Stary
    [[6650.38, 5603.43],510],  //Zub
    [[12164.9,12630.4],510]    //Aircraft Trader
];


_useCustomPosition = true; // Enable a custom position to move vehicles to (i.e a junk yard)
_customPosition = [12671.4,9068.28,0] ;  // Position for vehicles to be moved to if _useCustomPosition = true;
_customRadius = 5; // Minimum distance from the custom position to move vehicles to 
_maxDist = 1000; // Maximum distance from the safe zone position to find a safe position or custom position for relocation, setting this too low can make vehicles spawn very close to other vehicles.
_objDist = 15; // Minimum distance from the safe position for relocation to the center of the nearest object. Specifying quite a large distance here will slow the function and might often fail to find a suitable position.

{
    _safeZonePos = _x select 0;
    _safeZoneRadius = _x select 1;
    _nearVehicles = _safeZonePos nearEntities [["Air","LandVehicle","Ship"],_safeZoneRadius];
    {
        if (_useCustomPosition) then {
            _position = [_customPosition,_customRadius,_maxDist,_objDist,1,0,0,[]] call BIS_fnc_findSafePos;
        } else {
            _position = [_safeZonePos,_safeZoneRadius + 50,_maxDist,_objDist,if (_x isKindOf "Ship") then {2} else {0},0,0,[],[_safeZonePos,_safeZonePos]] call BIS_fnc_findSafePos;
        };
        _x setPos _position;
        
        diag_log format ["[SAFEZONE] %1 was moved out of a safe zone to: @%2 %3",typeOf _x,mapGridPosition _position,_position];
    } forEach _nearVehicles;
} forEach _safeZonePosArray;

 

fn_init.sqf

Spoiler

diag_log "Loading Safe Zone Relocate";
call compile preprocessFileLineNumbers "SafeZone_Relocate\safeZoneRelocate.sqf";

diag_log "Safe Zone Relocate Loaded";

 

when I restart the server vehicles are still in the safe zone.

am I doing this wrong server side?

 

Share this post


Link to post
Share on other sites

Ur making it over complicated 
If you don't have a folder called custom, make one in the mission.pbo 
copy above to notepad ++  save the file as safezonerelocate.sqf change above to how you want it .. put that in custom folder ..
add this to init.sqf in the mission.pbo .. if you don't have init.sqf .. create one
[] execVM "custom\safezonerelocate.sqf";
repack your pbo .. done

Edited by Chainsaw Squirrel

Share this post


Link to post
Share on other sites
23 hours ago, Chainsaw Squirrel said:

Verschließen Sie Autos oder bleiben Sie unverriegelt

They're open, due to exile settings.

14 hours ago, Chainsaw Squirrel said:

add this to init.sqf in the mission.pbo .. if you don't have init.sqf .. create one

Don't! If you do this, everytime a player joins the server - the script get exectued. Therefor, once player joins the server all vehicles in safezone get ported!

initServer.sqf is what you're lookin for.

Edited by WURSTKETTE
  • Like 1

Share this post


Link to post
Share on other sites
49 minutes ago, WURSTKETTE said:

They're open, due to exile settings.

Don't! If you do this, everytime a player joins the server - the script get exectued. Therefor, once player joins the server all vehicles in safezone get ported!

initServer.sqf is what you're lookin for.

Thanks @WURSTKETTE

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.