Working House Lighting

Here my init.sqf:

Code:
/*   
    INITILIZATION
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];
 
//REALLY IMPORTANT VALUES
dayZ_instance = 1;                    //The instance
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;
//start spectating
execVM "initSpec.sqf";
 
//disable greeting menu
player setVariable ["BIS_noCoreConversations", true];
//disable radio messages to be heard and shown in the left lower corner of the screen
//enableRadio false;
 
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
call compile preprocessFileLineNumbers "custom\compiles.sqf";                                //Compile custom compiles
building_spawnLoot = compile preprocessFileLineNumbers "fixes\building_spawnLoot.sqf";        //Custom Loot Tables
progressLoadingScreen 1.0;
 
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
if ((!isServer) && (isNull player) ) then
{
waitUntil {!isNull player};
waitUntil {time > 3};
};
 
if ((!isServer) && (player != player)) then
{
  waitUntil {player == player};
  waitUntil {time > 3};
};
 
if (isServer) then {
    _serverMonitor =    [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
};
 
if (!isDedicated) then {
          [] execVM "Scripts\kh_actions.sqf";
    //Conduct map operations
    0 fadeSound 0;
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
   
    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";   
};
if (!isDedicated) then {
[] execVM "fixes\change_streetlights.sqf";
};
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 {
//StreetLights
[] execVM "lights\street_lights.sqf";
};
sleep 1; _fast_rope = [] execVM "addons\BTC_fast_roping_init.sqf";
[] ExecVM "custom_monitor.sqf";
execVM "fixes\effects.sqf";
 
I'm cautiously sure that it is not my graphics settings. Tried with a variety of graphics settings with no effect, but brightness does influence activation range.

I tried using the older code on the first page of this thread, and the problem seems to be reduced, but still apparent. Lights seem to be going off at 200m, but are visible from further away with NVG.
In testing the streetlights on Taviana I have found lights 'switching on' at a closer distance. I think there may be an in-built limit on the number of vehicles / lightpoints that can be within the viewable distance at one time.

Investigating..
 
Tried that init you posted for me axeman, while it works and doesn't cause issues, it also does not have the ambient lighting on for the buildings it should.

Essentially, having no luck getting this working with the streetlights (which does work.)
 
This script is awesome, just got street and house lights up on my server and its looking good:)

Axeman you are the man, thx for this script:)

Not many videos out there that show's how awesome this is, so i made this.
Not taking credit for the intro. Intro is made by: arneoog http://www.youtube.com/user/arneoog

 
I have already added your street light script to my dayz.st server. Can I follow the instructions above to also add the house lights or do I need to do something different?
 
Thanks alot for making this awesome feature!!

I am running it on our Namalsk server and have to say that only 5% of my buildings light up, if at all :[

I have added the Namalsk classnames to the misc array but no go, is there something special to be done in Namalsk?

I am running on converted Bliss for DayZCC if that helps.
 
I am trying to add my init.sqf and the modified change_sreelights.sqf but so far no luck theres no option for me to add that to the post, anyone can help me with this?
 
I am trying to add my init.sqf and the modified change_sreelights.sqf but so far no luck theres no option for me to add that to the post, anyone can help me with this?
Paste your init.sqf into a Pm to me, I will have a look.
 
I'm a little confused, this is run server side? Or just on anyone who installs it in their MPmissions/xxxmissionname/fixes

With the deafult setup everything is run client side.. except: lighpoints are shared across the network to other clients.

With the advanced setup: if you package the public variable code into dayz_server.pbo, that is then run serverside as all it does is return the array of streetlight positions based on which cell you are in to a public variable directed to your client only..

Any lightpoints created by the server cannot be seen by the client, is a restriction with the Arma engine, I have tried..
 
Tried that init you posted for me axeman, while it works and doesn't cause issues, it also does not have the ambient lighting on for the buildings it should.

Essentially, having no luck getting this working with the streetlights (which does work.)
What's your server IP:port ?
 
Great script, thanks a lot.

Quick question...I noticed the default distance is 600 meters. I am on a roof top in Cherno and some buildings that are 200 meters away aren't lit. So I changed the 600 to 1000...still not on.

Did I edit this correctly?

//_range | Distance to scan for buildings / houses in metres.
_range=1000;

Thanks!
 
Back
Top