Jump to content
  • 0

Help with "Safe Zones 1.6" by - Juandayz


xDUKEx

Question

Sorry if this post is in the wrong area on the forum ... I'm not sure if there would a better place to ask this question.

The Actual Script can be found here:

I've added the script and it works perfectly, 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;
    };
};

 

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

how did you call the script itself (maybe in init.sqf)?
if it's in  if (!isDedicated) then  {~~~~~}; , the script will not work on server.
show us your server *.rpt file if you want more help.

 

BTW, Q&A section is not here. 

Let's go here next time
https://epochmod.com/forum/forum/35-scripting/

Or, Reply to the exact thread of script you used.

 

Link to comment
Share on other sites

  • 0
Just now, Schalldampfer said:

how did you call the script itself (maybe in init.sqf)?
if it's in  if (!isDedicated) then  {~~~~~}; , the script will not work on server.
show us your server *.rpt file if you want more help.

 

BTW, Q&A section is not here. 

Let's go here next time
https://epochmod.com/forum/forum/35-scripting/

you beat me to it lol i was writing a reply

Link to comment
Share on other sites

  • 0
5 minutes ago, Schalldampfer said:

how did you call the script itself (maybe in init.sqf)?
if it's in  if (!isDedicated) then  {~~~~~}; , the script will not work on server.
show us your server *.rpt file if you want more help.

 

BTW, Q&A section is not here. 

Let's go here next time
https://epochmod.com/forum/forum/35-scripting/

Or, Reply to the exact thread of script you used.

 

The script is being called through my mission/init at the very bottom.  Everything works 100% except the signs won't spawn as a visual enhancement effect.

Spoiler

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

 

Link to comment
Share on other sites

  • 0

I am getting a few instances of errors like this within my log.  They all vary in timestamp and have different coordinates.  There are maybe 6 in total through my log. 

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'!   ]

 

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;

 

Link to comment
Share on other sites

  • 0
33 minutes ago, xDUKEx said:

The script is being called through my mission/init at the very bottom.  Everything works 100% except the signs won't spawn as a visual enhancement effect.

  Reveal hidden contents

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

 

your safezone script is in !isDedicated area. that prevent server to run safezone script (thus no sign would spawn)
(I forgot to say, the signs are spawned in the server, not each client.)

Spoiler

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

Let's move it really at the very bottom. The bottom is after any "};"

Link to comment
Share on other sites

  • 0
4 minutes ago, Schalldampfer said:

your safezone script is in !isDedicated area. that prevent server to run safezone script (thus no sign would spawn)
(I forgot to say, the signs are spawned at server-side, not each client.)

  Hide contents

if (!isDedicated) then {
    if (toLower worldName == "chernarus") then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    //    execvm "showid.sqf"; // Execute ID Class Name in HUD
    //    execVM "fixes\effects.sqf";        // custom color filters and color cycle (working)
        execVM "fixes\fov.sqf";            // field of view (working)    
    };
    
    
    
    //Enables Plant lib fixes
//    execVM "\z\addons\dayz_code\system\antihack.sqf";
    
    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    [] execVM "safezone\16_safezone.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

Let's move it really at the very bottom. The bottom is after any "};"

So should move it to here? 

Spoiler

    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

   [] execVM "safezone\16_safezone.sqf";

 

Link to comment
Share on other sites

  • 0
2 minutes ago, xDUKEx said:

So should move it to here? 

  Hide contents

    if (dayz_townGenerator) then { execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf"; };
    call compile preprocessFileLineNumbers "spawn\init.sqf";
    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
    execVM "Mods\service_point\service_point.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    if (DZE_R3F_WEIGHT) then {execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf";};
    [] execVM "scripts\safezone\safezone_ai_remover.sqf"; // REMOVE AI FROM Safe Zones
    call compile preprocessFileLineNumbers "scripts\zsc\zscInit.sqf";
    execVM "scripts\zsc\playerHud.sqf";
    [] execVM "dayz_code\compile\remote_message.sqf";
    waitUntil {scriptDone progress_monitor};
    cutText ["","BLACK IN", 3];
    3 fadeSound 1;
    3 fadeMusic 1;
    endLoadingScreen;
};

   [] execVM "safezone\16_safezone.sqf";

 

I think so, it's also there in my server, the signs spawn and safezone is working.

Link to comment
Share on other sites

  • 0

For further clarification:

The mods section is for mod releases

The questions section is for questions -> Scripting sub forum would be the second best place to post, behind just asking the question in the author's release thread.

 

Also of note: saying you're sorry or didn't know where to post doesn't make maintaining a tidy forum any less tedious, or unnecessary/misplaced threads any less annoying. please try to understand the organization of the forum, I feel it is quite clearly laid out in the forum names

Link to comment
Share on other sites

  • 0
1 minute ago, icomrade said:

For further clarification:

The mods section is for mod releases

The questions section is for questions -> Scripting sub forum would be the second best place to post, behind just asking the question in the author's release thread.

Understood.  Thanks for all of the help.  This community is the best!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...