Jump to content
juandayz

1.6 Safezone

Recommended Posts

37 minutes ago, Aelenia said:

@DieTanx In mission.sqm it's also set to 100 (didn't change anything in there though)

 

class Item0
        {
            position[]={6325,304,7807};
            TRGDEF
            name="zonestary";
            expCond="(player distance zonestary) < 100;";
            expActiv="[""trader city Stary"",true,""enter""] call player_traderCity;";
            expDesactiv="[""trader city Stary"",true,""leave""] call player_traderCity;";
        };
        class Item1
        {
            position[]={4063,365,11664};
            TRGDEF
            name="zonebash";
            expCond="(player distance zonebash) < 100;";
            expActiv="[""trader city Bash"",true,""enter""] call player_traderCity;";
            expDesactiv="[""trader city Bash"",true,""leave""] call player_traderCity;";
        };
        class Item2
        {
            position[]={11447,317,11364};
            TRGDEF
            name="zoneklen";
            expCond="(player distance zoneklen) < 100;";
            expActiv="[""trader city Klen"",true,""enter""] call player_traderCity;";
            expDesactiv="[""trader city Klen"",true,""leave""] call player_traderCity;";
        };
        class Item3
        {
            position[]={1606,289,7803};
            TRGDEF
            name="zonebandit";
            expCond="(player distance zonebandit) < 100;";
            expActiv="[""Bandit Trader"",false,""enter""] call player_traderCity;";
            expDesactiv="[""Bandit Trader"",false,""leave""] call player_traderCity;";
        };
        class Item4
        {
            position[]={12944,210,12766};
            TRGDEF
            name="zonehero";
            expCond="(player distance zonehero) < 100;";
            expActiv="[""Hero Trader"",false,""enter""] call player_traderCity;";
            expDesactiv="[""Hero Trader"",false,""leave""] call player_traderCity;";
        };
        class Item5
        {
            position[]={12060,158,12638}; 
            TRGDEF
            name="zoneaircraft";
            expCond="(player distance zoneaircraft) < 100;";
            expActiv="[""Aircraft Trader"",false,""enter""] call player_traderCity;";
            expDesactiv="[""Aircraft Trader"",false,""leave""] call player_traderCity;";
        };

    expCond="(player distance zoneaircraft) < 100;";

 

these are your distances from safe zones---

 

change this to match what you place in your safe zone protections.  both of these should match

 

i actually have mine set to 15 meters further so you cant step in/out of safe zone and run back in as easy.

Share this post


Link to post
Share on other sites
3 hours ago, Randomuser5050450494 said:
7:44:26   Error Invalid number in expression
 7:44:26 File mpmissions\DayZ_Epoch_11.Chernarus\safezones.sqf, line 1
 7:44:26 Error in expression <\DayZ_Epoch_11.Chernarus\safezones.sqf"

Any ideas?

what is on line 1 in your safezones.sqf?

Share this post


Link to post
Share on other sites
3 hours ago, inneedofhelp said:

Is there any way to stop vehicles getting damaged in safe zones ?

I guess that shouldn't be that difficult. First you need a custom veh_handlDam.sqf. In there, search for:

_unit = _this select 0;
_selection = _this select 1;
_total = _this select 2;

Below that, paste in:

_vehicleSafeZones = [
	[[4064,11665,0],100],	// Bash
	[[6326,7809,0],200],	// Stary
	[[11447,11364,0],200],	// Klen
	[[12944,12766,0],100],	// Hero Camp
	[[1606,7803,0],100]		// Bandit camp
]; 

{
	if (_unit distance (_x select 0) < (_x select 1)) exitWith{};
} forEach _vehicleSafeZones;

You can define your own safezones in the _vehicleSafeZones array or if you have a safezone array already, use that instead.

[[4064,11665,0],100],    // Bash
The first numbers are the coordinates and the second part is the radius from that point. Means if a vehicle is in a maximum range of 100m of that point, it will be indestructable.

Share this post


Link to post
Share on other sites

hi your script seems to work fine with me apart from this error in my RPT , can you help me please

Quote

  Error position: <distance _z < _r) then {_state = true;};>
  Error 4 elements provided, 3 expected
File mpmissions\__CUR_MP.sauerland\safezone\16_safezone.sqf, line 243
Error in expression <
_r = _x select 1;
if ((vehicle player) distance _z < _r) then {_state = true;};>
  Error position: <distance _z < _r) then {_state = true;};>
  Error 4 elements provided, 3 expected
File mpmissions\__CUR_MP.sauerland\safezone\16_safezone.sqf, line 243
Error in expression <
_r = _x select 1;
if ((vehicle player) distance _z < _r) then {_state = true;};>
  Error position: <distance _z < _r) then {_state = true;};>
  Error 4 elements provided, 3 expected
File mpmissions\__CUR_MP.sauerland\safezone\16_safezone.sqf, line 243
Error in expression <
_r = _x select 1;

 

also here is my 16_safezone.sqf

Quote

/*
   by: http://infiSTAR.de || http://DayzAntiHack.com
   *updated on 13.12.2016 by juandayz for epoch 1.6 community
    //all credits for infi   

How i install it?
    1. Copy paste the code of below into a file called 16_safezone.sqf - save the file.
    2. Paste this 16_safezone.sqf into mpmissioms\instance_11.chernarus\custom\
    3. Open your init.sqf
    4. At the very bottom of the file add this line:  [] execVM "custom\16_safezone.sqf";
    5. Save the init.sqf and restart your server.
*/
USE_CANBUILD = true;        // if you don't want to define your own positions
USE_TraderCity = false;    //    if you don't want to define your own positions (Epoch 1.0.5)
USE_POSITIONS = true;    // to use own positions and radius
USE_AI_REMOVER = true;    // use this to remove Missionbots (AI) within 100m of a player if the player is in a SafeZone
USE_AntiSteal = false;    // use this to block opening gear if another player is within 3m!
USE_SPEEDLIMIT = false;    // very secret function, nobody is supposed to find out what it does.
    SPEEDLIMIT = 25;        // Only used if USE_SPEEDLIMIT is true.
USE_SIGNS = true;        // use this to build signs around the SafeZone
LOG_EnterLeave = false;    // This will log to your .rpt when a player enters or leaves a SafeZone! (only works with infiSTAR.de Admintools / AntiHack)
/* You can use USE_CANBUILD or/and (works together) the custom positions below (USE_POSITIONS) [position or zone,radius] */
_infiSZ =
[
    [[15502,87,17015,0],200,true],//Seedorf
    [[13166,176,6611,0],200,true],//Oberdorf
    [[24710,409,21741,0],200,true],//Oberberg
    [[16983,300,1774,0],200,true],//bandit
    [[11045,179,15671,0],200,true],//hero
    [[15351.9,0.0569839,18520.6,0],200,true],//AircraftDealer
    [[2504,271,3870,0],200,true],//Wholesale1
    [[230,140,22703,0],200,true]//Wholesaler

];

{
    DZE_SafeZonePosArray set [(count DZE_SafeZonePosArray), [(_x select 0), (_x select 1)]];
} forEach _infiSZ;

if (isServer) exitWith


{
    if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    //    _object = createVehicle ['SignM_FARP_Winchester_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    //    _object setVehicleInit 'this setObjectTexture [0,''Addons\SafeZones\sign.paa''];';
                    _object setDir _dir;
                };
            };
        } forEach _infiSZ;
    };
};
waitUntil {((!isNil 'dayz_animalCheck') || (!isNil 'dayz_medicalH') || (!isNil 'dayz_slowCheck') || (!isNil 'dayz_gui'))};
if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };
[_infiSZ] spawn {
    _infiSZ = _this select 0;
    _startSafeZone =
    {
        if (isNil 'outNow') then
        {
            _msg = 'You entered a Safe Zone!';
            hint _msg;
            taskHint [_msg, [0,1,0,1], 'taskDone'];
            inNow = nil;
            outNow = true;
            
            if (LOG_EnterLeave) then
            {
                PVDZ_send = [player,'SafeZoneState',[1]];
                publicVariableServer 'PVDZ_send';
            };
        };
        player_fired = {
            deleteVehicle (nearestObject [_this select 0,_this select 4]);
            cutText ['You can not fire in a SafeZone!','WHITE IN'];
        };
        //wild_spawnZombies = {};
        zombie_generate = {};
        
        fnc_usec_damageHandler = {};
        player removeAllEventHandlers 'handleDamage';
        player addEventHandler ['handleDamage', {false}];
        player allowDamage false;
        _veh = vehicle player;
        _szs = _veh getVariable ['inSafeZone',0];
        if (_szs == 0) then
        {
            _veh setVariable ['inSafeZone',1,true];
            if (player != _veh) then
            {
                _veh removeAllEventHandlers 'Fired';
                _veh addEventHandler ['Fired', {_this call player_fired;}];
                {
                    _x removeAllEventHandlers 'Fired';
                    _x addEventHandler ['Fired', {_this call player_fired;}];
                } forEach (crew _veh);
                fnc_veh_handleDam = {false};
                _veh removeAllEventHandlers 'HandleDamage';
                _veh addeventhandler ['HandleDamage',{ _this call fnc_veh_handleDam } ];
                _veh allowDamage false;
            };
        };
        _notInSafeZone =
        [
    
            'MAAWS','RPG7V','M136','RPG18','STINGER',
            'MeleeBaseball','MeleeHatchet','MeleeCrowbar','MeleeMachete','MeleeFishingPole','MeleeSledge',
            'MeleeBaseBallBatNails','MeleeBaseBallBatBarbed','MeleeBaseBallBat'
        ];
        _cwep = currentWeapon player;
        if (_cwep in _notInSafeZone) then
        {
            _swep = '';
            {
                if ((getNumber (configFile >> 'CfgWeapons' >> _x >> 'Type')) == 2) exitWith
                {
                    _swep = _x;
                };
            } forEach (weapons player);
            if (_swep == '') then
            {
                player playActionNow 'PutDown';
                _iPos = getPosATL player;
                _radius = 1;
                _removed = ([player,_cwep,1] call BIS_fnc_invRemove);
                if (_removed == 1) then
                {
                    _item = createVehicle ['WeaponHolder', _iPos, [], _radius, 'CAN_COLLIDE'];
                    _item addWeaponCargoGlobal [_cwep,1];
                };
            }
            else
            {
                player selectweapon _swep;
            };
        };
    };
    _endSafeZone =
    {
        if (isNil 'inNow') then
        {
            if (str fnc_usec_damageHandler == '{}') then
            {
                _msg = 'You left the Safe Zone!';
                hint _msg;
                taskHint [_msg, [1,0,0.1,1], 'taskFailed'];
            };
            inNow = true;
            outNow = nil;
            
            if (LOG_EnterLeave) then
            {
                PVDZ_send = [player,'SafeZoneState',[0]];
                publicVariableServer 'PVDZ_send';
            };
        };
        //wild_spawnZombies = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\wild_spawnZombies.sqf';
        zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";
        //
        
        player_fired = {
            _this call compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';
            _unit = _this select 0;
            _weapon = _this select 1;
            _muzzle = _this select 2;
            _mode = _this select 3;
            _ammo = _this select 4;
            _magazine = _this select 5;
            _projectile = _this select 6;
            _screenToWorld = screenToWorld [0.5,0.5];
            _near = _screenToWorld nearEntities ['AllVehicles',100];
            {
                if (isPlayer _x) then
                {
                    _szs = _x getVariable ['inSafeZone',0];
                    if (_szs == 1) then
                    {
                        deleteVehicle (nearestObject [_unit,_ammo]);
                    };
                };
            } forEach _near;
        };
        
        fnc_usec_unconscious = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\fn_unconscious.sqf';
        object_monitorGear = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\object_monitorGear.sqf';
        fnc_veh_handleDam = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\veh_handleDam.sqf';
        
        _veh = vehicle player;
        _szs = _veh getVariable ['inSafeZone',0];
        if (_szs == 1) then
        {
            _veh setVariable ['inSafeZone',0,true];
            if (player != _veh) then
            {
                _veh removeAllEventHandlers 'HandleDamage';
                _veh addeventhandler ['HandleDamage',{ _this call fnc_veh_handleDam } ];
                _veh allowDamage true;
            };
        };
        
        _end = false;
        if (isNil 'gmadmin') then
        {
            _end = true;
        }
        else
        {
            if (gmadmin == 0) then
            {
                _end = true;
            };
        };
        if (_end) then
        {
            player allowDamage true;
            fnc_usec_damageHandler = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\fn_damageHandler.sqf';
            player removeAllEventHandlers 'HandleDamage';
            player addeventhandler ['HandleDamage',{_this call fnc_usec_damageHandler;} ];
        };
    };
    while {1 == 1} do
    {
        if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };
        _state = false;
        if (isNil 'USE_POSITIONS') then { USE_POSITIONS = false; } else { if (typename USE_POSITIONS != 'BOOL') then { USE_POSITIONS = false; }; };
        if (USE_POSITIONS) then
        {
            {
                _z = _x select 0;
                _r = _x select 1;
                if ((vehicle player) distance _z < _r) then {_state = true;};
            } forEach _infiSZ;
        };
        if (isNil 'USE_CANBUILD') then { USE_CANBUILD = true; } else { if (typename USE_CANBUILD != 'BOOL') then { USE_CANBUILD = true; }; };
        if (USE_CANBUILD) then
        {
            if (isNil 'canbuild') then { canbuild = true; } else { if (typename canbuild != 'BOOL') then { canbuild = true; }; };
            if (!canbuild) then {_state = true;};
        };
        if (isNil 'USE_TraderCity') then { USE_TraderCity = true; } else { if (typename USE_TraderCity != 'BOOL') then { USE_TraderCity = true; }; };
        if (USE_TraderCity) then
        {
            if (isNil 'isInTraderCity') then { isInTraderCity = false; } else { if (typename isInTraderCity != 'BOOL') then { isInTraderCity = false; }; };
            if (isInTraderCity) then {_state = true;};
        };
        if (_state) then
        {
            inSafeZone = true;
            call _startSafeZone;
            {
                if (!isNull _x) then
                {
                    if !(isPlayer _x) then
                    {
                        deletevehicle _x;
                    };
                };
            } forEach ((vehicle player) nearEntities ['zZombie_Base',50]);
            
            if (isNil 'USE_AI_REMOVER') then { USE_AI_REMOVER = false; } else { if (typename USE_AI_REMOVER != 'BOOL') then { USE_AI_REMOVER = false; }; };
            if (USE_AI_REMOVER) then
            {
                {
                    if ((!isNull group _x) && (getPlayerUID _x == '')) then
                    {
                        deleteVehicle _x;
                    };
                } forEach (player nearEntities ['Man',100]);
            };
        }
        else
        {
            inSafeZone = false;
        };
        uiSleep 2;
        if (!inSafeZone) then
        {
            call _endSafeZone;
        };
    };
};
if ((USE_AntiSteal) || (USE_SPEEDLIMIT)) then
{
    [] spawn {
        _USE_AntiSteal = USE_AntiSteal;
        _USE_SPEEDLIMIT = USE_SPEEDLIMIT;
        _speedlimit = SPEEDLIMIT;
        while {1 == 1} do
        {
            if (inSafezone) then
            {
                if (_USE_AntiSteal) then
                {
                    _cnt = {isPlayer _x && _x != player} count (player nearEntities [['CAManBase'],4]);
                    if ((_cnt > 0) && (!isNull (findDisplay 106))) then
                    {
                        (findDisplay 106) closedisplay 0;
                        closeDialog 0;closeDialog 0;closeDialog 0;
                        _log = format['%1 You are not allowed to open Gear while near another player!',name player];
                        cutText [_log,'PLAIN'];
                        hint _log;
                    };
                };
                if (_USE_SPEEDLIMIT) then
                {
                    _obj = vehicle player;
                    if !(_obj isKindOf 'Plane') then
                    {
                        _speed = abs speed _obj;
                        if ((_obj != player) && (_speed > _speedlimit)) then
                        {
                            _vel = velocity _obj;
                            _x = 0.8;
                            if (_speed > 50) then {_x = 0.1;};
                            _velNew = [(_vel select 0) * _x, (_vel select 1) * _x,(_vel select 2) * _x];
                            _obj SetVelocity _velNew;
                        };
                    };
                };
            }
            else
            {
                uiSleep 2;
            };
            uiSleep .01;
        };
    };
}; 

 

 

Share this post


Link to post
Share on other sites

Hello guys I am getting this error in 1.0.6.2 it was working fine in 1.0.6.1 does anybody know what i need to do to fix this? Thanks.

{
DZE_SafeZonePosArray set [(count DZE_Saf>
16:18:48   Error position: <DZE_SafeZonePosArray set [(count DZE_Saf>
16:18:48   Error Undefined variable in expression: dze_safezoneposarray
16:18:48 File mpmissions\DayZ_Epoch_11.Chernarus\scripts\safezone\safezone.sqf, line 40
16:18:48 Error in expression <, 
[[8001.09,2899.08,0],20,true] 
];

Share this post


Link to post
Share on other sites

Thanks ebayShopper that indeed was the problem thanks for pointing that out now I have discovered my server provider has updated the servers but clearly haven't updated the community package.

On a default 1.0.6.2 mission file there was no issue I would never of known without you're help thanks for everything.

Share this post


Link to post
Share on other sites
1 hour ago, BetterDeadThanZed said:

I got this working. Another question - does this prevent loot from spawning and does it remove zombies from the safezone?

This script won't prevent loot or zombies from spawning in a safezone, it will delete zombies that have spawned in a 50m radius of the player though.

Epoch by default won't spawn loot or zombies in a safezone, in 1.0.6.3 I have changed this to be a toggle.

Share this post


Link to post
Share on other sites
7 hours ago, salival said:

This script won't prevent loot or zombies from spawning in a safezone, it will delete zombies that have spawned in a 50m radius of the player though.

Epoch by default won't spawn loot or zombies in a safezone, in 1.0.6.3 I have changed this to be a toggle.

1.0.6.3? When will this come out and what sort of things are being added/fixed?

Share this post


Link to post
Share on other sites
1 hour ago, Hooty said:

1.0.6.3? When will this come out and what sort of things are being added/fixed?

No idea, a few months away maybe.

There's going to be an Arma 2 corepatch "soon" acording to Bohemia so we may need to fix some things with it.

I will be taking ownership and posting about any up coming updates to Epoch personally on here and on discord (you server admins REALLY should be on discord)

Share this post


Link to post
Share on other sites

I've added the script and it works perfectly on 1.0.6.2 , however, I can't get the signs to populate around the safe zones.  I believe I need to be adding in actual coordinates to the script but I am not sure of the placement.  Can I stick them all within the [   ]'s and use commas to separate them ... or do I need to create a separate entry for each new location?  

Here is the bit of the script I am using:

Spoiler

USE_SIGNS = true;        // use this to build signs around the SafeZone
LOG_EnterLeave = true;    // This will log to your .rpt when a player enters or leaves a SafeZone! (only works with infiSTAR.de Admintools / AntiHack)
/* You can use USE_CANBUILD or/and (works together) the custom positions below (USE_POSITIONS) [position or zone,radius] */
_infiSZ =
[
    [[6325.6772,7807.7412,0],150,true],//stary
    [[4063.4226,11664.19,0],150,true],//bash
    [[11447.472,11364.504,0],150,true],//klen
    [[1606.6443,7803.5156,0],150,true],//bandit
    [[12944.227,12766.889,0],150,true],//hero
    [[4361.4937,2259.9526,0],50,true],//wholesalerSouth
    [[12060,12640,0],200,true]//air dealear
];

{
    DZE_SafeZonePosArray set [(count DZE_SafeZonePosArray), [(_x select 0), (_x select 1)]];
} forEach _infiSZ;

if (isServer) exitWith


{
    if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;
                };
            };
        } forEach _infiSZ;
    };
};

I was asked to check my server rpt file and came up with a few instances of :

Spoiler

   21:22:04 UnExpected call of CreateVehicle for 'Logic', pos(0.000000.2,1.252131.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!
21:22:29 UnExpected call of CreateVehicle for 'Logic', pos(0.000000.2,1.239050.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!   ]

They all have different time stamps and coordinates, and total maybe 6 instances of errors.

I know the script calls for the signs to be published as vehicles ... Is that the issue?   Or do I just need to add coordinate location numbers within the    [ ]    after the     _location  call?

Spoiler

_location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;

 

Share this post


Link to post
Share on other sites
18 minutes ago, xDUKEx said:

I've added the script and it works perfectly on 1.0.6.2 , however, I can't get the signs to populate around the safe zones.  I believe I need to be adding in actual coordinates to the script but I am not sure of the placement.  Can I stick them all within the [   ]'s and use commas to separate them ... or do I need to create a separate entry for each new location?  

Here is the bit of the script I am using:

  Reveal hidden contents

USE_SIGNS = true;        // use this to build signs around the SafeZone
LOG_EnterLeave = true;    // This will log to your .rpt when a player enters or leaves a SafeZone! (only works with infiSTAR.de Admintools / AntiHack)
/* You can use USE_CANBUILD or/and (works together) the custom positions below (USE_POSITIONS) [position or zone,radius] */
_infiSZ =
[
    [[6325.6772,7807.7412,0],150,true],//stary
    [[4063.4226,11664.19,0],150,true],//bash
    [[11447.472,11364.504,0],150,true],//klen
    [[1606.6443,7803.5156,0],150,true],//bandit
    [[12944.227,12766.889,0],150,true],//hero
    [[4361.4937,2259.9526,0],50,true],//wholesalerSouth
    [[12060,12640,0],200,true]//air dealear
];

{
    DZE_SafeZonePosArray set [(count DZE_SafeZonePosArray), [(_x select 0), (_x select 1)]];
} forEach _infiSZ;

if (isServer) exitWith


{
    if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;
                };
            };
        } forEach _infiSZ;
    };
};

I was asked to check my server rpt file and came up with a few instances of :

  Reveal hidden contents

   21:22:04 UnExpected call of CreateVehicle for 'Logic', pos(0.000000.2,1.252131.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!
21:22:29 UnExpected call of CreateVehicle for 'Logic', pos(0.000000.2,1.239050.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!   ]

They all have different time stamps and coordinates, and total maybe 6 instances of errors.

I know the script calls for the signs to be published as vehicles ... Is that the issue?   Or do I just need to add coordinate location numbers within the    [ ]    after the     _location  call?

  Reveal hidden contents

_location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;

 

Fixed with the help of  Schalldampfer &  theduke.

had to drop my [] execVM "safezone\16_safezone.sqf"; to the very bottom of my init file.

Share this post


Link to post
Share on other sites

Could someone help me change the distance between each sign?  Right now they are spaced so close to each other it's a bit much.  I was thinking maybe one sign every 75m in the radius.  I'm not sure which part of the code controls that.   Thanks!

 

Spoiler

if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;
                };

 

Share this post


Link to post
Share on other sites
1 hour ago, xDUKEx said:

Could someone help me change the distance between each sign?  Right now they are spaced so close to each other it's a bit much.  I was thinking maybe one sign every 75m in the radius.  I'm not sure which part of the code controls that.   Thanks!

 

  Hide contents

if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object = createVehicle ['SignM_UN_Base_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    _object setVehicleInit 'this setObjectTexture [0,''safezone\sign.jpg''];';
                    _object setDir _dir;
                };

 

im not 100% sure what exact number you would need to get what you want. but i would guess it would be this line

for '_i' from 0 to 360 step (270 / _radius)*2 do

change the 270 to something else (anything from 0 to 360, probably 180 would do half the diameter)

and see what that does.

Share this post


Link to post
Share on other sites
48 minutes ago, theduke said:

im not 100% sure what exact number you would need to get what you want. but i would guess it would be this line

for '_i' from 0 to 360 step (270 / _radius)*2 do

change the 270 to something else (anything from 0 to 360, probably 180 would do half the diameter)

and see what that does.

I tried it on 180 but it doesn't seem to have done anything.

Share this post


Link to post
Share on other sites
15 minutes ago, salival said:

I tested that change on my test server, @thedukeis correct, I had mine up at about 800+ before I really noticed a difference.

Yea, you need a higher number not a lower number.   I started noticing a significant change around

for '_i' from 0 to 360 step (600 / _radius)*2 do

Share this post


Link to post
Share on other sites
Just now, xDUKEx said:

Yea, you need a higher number not a lower number.   I started noticing a significant change around

for '_i' from 0 to 360 step (600 / _radius)*2 do

lol gota love arma logic glad you got it sorted out

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Supporters
  • Discord

×
×
  • Create New...