dayZ Street Lights

Ok. It's working now. Thanks for the help! Btw, you guys know what scripts are working for the public hive? I mean like refuel/tow...?
 
Anyone still active with this? Running vanilla cherno over here curious about making it server side. I'm a little confused as from what I'm reading it's just to get the file over on the server.pbo to reduce mission size which I've done.

If I leave:

if (isServer) then {
axe_server_lampObjs = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_returnLampWS.sqf";
"axeLampObjects" addPublicVariableEventHandler {_id = (_this select 1) spawn axe_server_lampObjs};
};

In my mission init then I'm not sure how much good that is other than mission file size. I've moved other things to my server.pbo completely by doing like...


something_cool = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\cool.sqf";
publicVariable "something_cool";

then in mission init

if (!isDedicated) then {[] spawn something_cool;};

I'm wondering if I can improve on what I've done already? I run a high pvp high player server so any little bit helps.
 
Axemans you guy here but I know he's mega busy in real life sadly...so busy we've just decided to give up our server as time and enthusiasm are just not available anymore..I will give him a nudge via email for you but don't hold your breath..
 
The lights have come a long way since that code, though I have been designing them for Epoch which has street lights on as standard. The house lights on my github (andgregor) are more efficient and should reduce network lag.

That street light code is still relevant, probably, I would be more inclined to detect the surrounding street light objects now and light just a few of them.. There is a way to single out the streetlamp object, as a player, is still not entirely efficient though..
 
I have several players with low end computers and the lights seemed to make their fps drop too low for them so I created a script that checks players fps before turning on the lights. Not sure if its completely correct but from testing it myself it seems to work. I have at the bottom of my init.sqf:
Code:
_nul = [] execVM "light_fps_check.sqf";

then in the executed file:
Code:
waitUntil { alive player };
sleep 120; //waits 2 minutes to check if fps is good enough for lights
_fps = (round diag_fps);
_pass = 0;
//starts loop to check fps?
while {_pass == 0} do {
    if ((_fps > 25) && (_pass == 0)) then {
        if (isServer) then {
            axe_server_lampObjs =    compile preprocessFileLineNumbers "lights\fnc_returnLampWS.sqf";
            "axeLampObjects" addPublicVariableEventHandler {_id = (_this select 1) spawn axe_server_lampObjs};
        };
        if (!isDedicated) then {
            [] execVM "lights\street_lights.sqf";
            [] execVM "lights\house_lights.sqf";
        };
        diag_log(format["FPS CHECK PASSED | LIGHTS ON FOR : %1",player]);
        _pass = 1; //ends while loop?
    } else {
    _pass = 0;
    diag_log(format["FPS CHECK FAILED FOR : %1 | RECHECKING IN 2 MINUTES",player]);
    };
    sleep 120; //every 2 minutes fps is rechecked for lights compatibility
};
should probably add a counter for an exit if players continue to fail the check but this is what I came up with so far to help those with low fps.
 
Back
Top