Working House Lighting

prolly a dumb question but i´ve seen blinking=1 or blinking=true in config.cpp. (For example to be used with trafficlights, crane lights, towers etc) This seems not to work with the change_streetlights. Has anyone get this to work ?
 
my server has 40-50 people on it, would this be good for the server?

Should be fine, the bulk of the work is done on the client. Streetlights do use the server to return the light arrays using a public variable, I have optimised it so that only the client making the request gets the public variable returned, not the whole server.

I have a new version of the code, designed for Epoch. When I next get time I will setup the config for default dayZ and add to my github.

prolly a dumb question but i´ve seen blinking=1 or blinking=true in config.cpp. (For example to be used with trafficlights, crane lights, towers etc) This seems not to work with the change_streetlights. Has anyone get this to work ?

If you look in @DayZ\Addons\dayz_code\Configs\CfgVehicles\Buildings\ there are .hpp config files in there for the cranes, runway edge lights, stop lights etc.

They need to have their values changed to something like:
Code:
name = "light";
color[] = {0.0, 0.0, 0.9};
ambient[] = {0.0, 0.0, 0.2};
brightness = 0.01;
blinking = true;

However (the big But), your clients will require this file also as lights are handled at the client end and signature checks might fail if not (not 100% sure about the last one). This obviously means sending your players a new dayz_code.pbo for them to be able to play on your server and see the lights.

Epoch currently have these working if you want to see what they look like.
 
Hey Axe, thanks for your reply

so they should be on by default when set ? Seems not to work on taviana (i am using 2.0 with dayz version 1.7.6) as i have set them to be on / blinking

eg Land_A_Crane_02b.hpp

Code:
class RedBlinking
            {
                name = "";
                color[] = {1,0,0,0};
                ambient[] = {1,0,0,0};
                brightness = 0.2;
                blinking = 1;
            };

i´ve notived that you gave a name and in my configs there is a fourth value for color and ambient. What´s this value for ?

Additionally i felt over the long known issue that streetlights on taviana won´t turn on if a player spawns on the west island or crosses the bridge., Do you have any clue how this can be handled ?
 
Not sure about the name, I would think it would need to be at least something to be referenced.

The 4th Entry ? Do you mean the 4th entry in Color and Ambient ? If so, is for Alpha (transparency) 0-1 (1=transparent).

Are you updating dayz_code.pbo on your server and your client ?
 
I tried your code but it didnt work. I placed
if (!isDedicated) then {
[] execVM "fixes\change_streetlights.sqf";
};

at THE END of the init.sqf , is it suppose to be under some other code?

also, adding the script restriction text to Scripts.txt didnt work, battle eye always kickec

can you share your scripts text so I may use it>\?
 
Not sure about the name, I would think it would need to be at least something to be referenced.

The 4th Entry ? Do you mean the 4th entry in Color and Ambient ? If so, is for Alpha (transparency) 0-1 (1=transparent).

Are you updating dayz_code.pbo on your server and your client ?

yes it goes both to client and server. I am just playing a bit arround with a local testserver to get experience in scripting, especially lights. Therefore its just one client :) If you have any good links to share would be very nice. Finally i want to test if there is a way to create a rotating lightsource to simulate the lighthouse .
 
I tried your code but it didnt work. I placed
if (!isDedicated) then {
[] execVM "fixes\change_streetlights.sqf";
};

at THE END of the init.sqf , is it suppose to be under some other code?

also, adding the script restriction text to Scripts.txt didnt work, battle eye always kickec

can you share your scripts text so I may use it>\?

if you put the script into "fixes" this should work but there is already a (!isDedicated) section where the code should go to:
Code:
if (isServer) then {
    axe_server_lampObjs =    compile preprocessFileLineNumbers "lights\fnc_returnLampWS.sqf";
    "axeLampObjects" addPublicVariableEventHandler {_id = (_this select 1) spawn axe_server_lampObjs};
    _serverMonitor =    [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
    "atp"    addPublicVariableEventHandler { diag_log format["%1", _this select 1];};
};
 
if (!isDedicated) then {
    //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;}];
    diag_log "Loading dayz_code player_monitor";
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
    diag_log "Done loading dayz_code player_monitor";
    [] execVM "init\kh_actions.sqf";
    _nil = [] execVM "init\remote_messages.sqf";
    [] execVM "lights\change_streetlights.sqf";
    [] execVM "lights\tower_lights.sqf";
    [] execVM "lights\street_lights.sqf";
    //Reveal Objects
    //[] execVM "all_objects.sqf";
};

as you can see i put everythin under folder "lights" because the other script have refences to this folder too.
 
this is my init.sqf file... is this correct? its not working... I have time set to static.



// Mission Initialization
startLoadingScreen ["", "RscDisplayLoadCustom"];
cutText ["", "BLACK OUT"];
enableSaving [false, false];

// Variable Initialization
dayZ_instance = 4;
//dayZ_serverName = "31337"; // server name (country code + server number)
hiveInUse = true;
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;

// Settings
player setVariable ["BIS_noCoreConversations", true]; // Disable greeting menu
//enableRadio false; // Disable global chat radio messages

// Compile and call important functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
call compile preprocessFileLineNumbers "fixes\variables.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0;

if (!isDedicated) then {
[] execVM "lights\house_lights.sqf";
};

// NO GARBAGE COMMAND START

stream_locationCheck = {
//Thank you for the garbage rocket!
};

// NO GARBAGE COMMAND END

// Set Tonemapping
"Filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4];
setToneMapping "Filmic";
player_spawn_2 = compile preprocessFileLineNumbers "fixes\player_spawn_2.sqf";

BIS_Effects_startEvent = {
switch (_this select 0) do {
case "AirDestruction": {
[_this select 1] spawn BIS_Effects_AirDestruction;
};
case "AirDestructionStage2": {
[_this select 1, _this select 2, _this select 3] spawn BIS_Effects_AirDestructionStage2;
};
case "Burn": {
[_this select 1, _this select 2, _this select 3, false, true] spawn BIS_Effects_Burn;
};
};
};

"BIS_effects_gepv" addPublicVariableEventHandler {
(_this select 1) call BIS_Effects_startEvent;
};

if ((!isServer) && (isNull player) ) then
{
waitUntil {!isNull player};
waitUntil {time > 3};
};

if ((!isServer) && (player != player)) then
{
waitUntil {player == player};
waitUntil {time > 3};
};

// Run the server monitor
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";
// "PVDZ_sec_atp" addPublicVariableEventHandler { diag_log format["%1", _this select 1];};
};

// Run the player monitor
if (!isDedicated) then {
//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";
// [] execVM "\z\addons\dayz_code\system\antihack.sqf";
};

// Logo watermark: adding a logo in the bottom left corner of the screen with the server name in it
if (!isNil "dayZ_serverName") then {
[] spawn {
waitUntil {(!isNull Player) and (alive Player) and (player == player)};
waituntil {!(isNull (findDisplay 46))};
5 cutRsc ["wm_disp","PLAIN"];
((uiNamespace getVariable "wm_disp") displayCtrl 1) ctrlSetText dayZ_serverName;

#include "gcam\gcam_config.hpp"
#include "gcam\gcam_functions.sqf"

#ifdef GCAM
waitUntil { alive Player };
waituntil { !(IsNull (findDisplay 46)) };

if (serverCommandAvailable "#kick") then { (findDisplay 46) displayAddEventHandler ["keyDown", "_this call fnc_keyDown"]; };
#endif
};
 
if (!isDedicated) then {
[] execVM "lights\house_lights.sqf";
};

this has to go below tonemappingfilmic

here is my complete init.sqf:

Code:
/*
    INITILIZATION
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];
 
//REALLY IMPORTANT VALUES
dayZ_instance =    1; //The instance
dayZ_serverName="SERVER NAME"; // server name (country code + server number)
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;
 
//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;
 
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
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 {
    axe_server_lampObjs =    compile preprocessFileLineNumbers "init\fnc_returnLampWS.sqf";
    "axeLampObjects" addPublicVariableEventHandler {_id = (_this select 1) spawn axe_server_lampObjs};
    _serverMonitor =    [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
    "atp"    addPublicVariableEventHandler { diag_log format["%1", _this select 1];};
};
 
if (!isDedicated) then {
    //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;}];
    diag_log "Loading dayz_code player_monitor";
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
    diag_log "Done loading dayz_code player_monitor";
    [] execVM "init\kh_actions.sqf";
    _nil = [] execVM "init\remote_messages.sqf";
    [] execVM "init\change_streetlights.sqf";
    [] execVM "init\tower_lights.sqf";
    [] execVM "init\street_lights.sqf";
    //Reveal Objects
    [] execVM "all_objects.sqf";
};

result:

https://www.dropbox.com/s/rf07wrmd4bijeud/lightsOn.jpg
 
You have streetlights, what about houses with illuminated windows ? Is hard to tell from that screenshot.
 
this is my init.sqf file... is this correct? its not working... I have time set to static.

You can group all of the
Code:
if (!isDedicated)then{
[] execVM "blah.sqf"
};

Into one if / then statement.. Same isServer, so:

Code:
if (!isDedicated)then{
[] execVM "blah.sqf"
[] execVM "next_script_that lives_in_isDedicated_blah.sqf"
};

then group all of the if (isServer) together too..

As a general rule you want to run all the isServer stuff first then isDedicated.
 
The streetlights are mapped out first and then positions referenced. Are the west island ones custom or original map items ?

The new version finds them dynamically so would light them..
 
Hey Guys,

is there a way to increase the viewdistance of the lights? I would like to have them seen from about 1km, is there a way to change that somewhere?
 
The new lighting system built for epoch deals with this by increasing the brightness based on how far away a house is.

When I get chance, and after a bit of tweaking, I will release a general dayz version. This method is new for the next release of epoch..

Getting married on Saturday so time is a bit tight at the moment..
 
Oh sorry i forgot to mention I'm using normal DayZ 1.8, will be there an option too to change this?
 
An option to change what ? Read the post..

You can go to the github and merge the code into your existing code if you want.. is just a case of including the files. Can be added to a mission.
 
Back
Top