Jump to content
  • 0

axeman

Question

The latest patch has the culmination of all of the work done on lighting so far for dayZ.
 
Street Lights: The street lights are enabled by default, adding the lighting system allows you to set a failure percentage. The lower this is set the more the street lights will flicker off and fail.
 
House Lights: Currently buildings that can not be entered will be lit, this is also based upon the lighting percentage, the higher this is the more houses will be lit.
 
Illuminant Towers: The towers that can be climbed that have a spotlight on each corner will be lit..
 
New Features:

  • House lights are now brighter at a distance. This allows the player to see distant houses up to 600m (with default settings can be set to 1km). During the night when running from the coast or through the forest heading north, this is a beacon, an oasis in the dark guiding your player to the next town..
  • Generators: Placing a generator will effect the surrounding lighting depending on your settings. If a generator is required it will light all illuminant objects within it's range. If a generator is not required houses will be lit yet a placed generator will force the surrounding lights to be 100% reliable (this allows a low lighting percentage and enabling of lights through generator placement).
  • Chance: Set this high or low, I like a very low chance of lighting, this fails lots of street lights causing them to flicker and go off.. House lights are few and far between yet generators cause all of the surrounding houses and street lights to be lit also.

See the dayZ Epoch Lighting Wiki for more details and put any feedback or questions about the lighting system here..
 
To enable the lighting simply uncomment the line at the bottom of your init.sqf to look like this:

//Lights
[0,0,true,true,false,56,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

Being stalked by several zombies through a dimly lit night time village..? 

Link to comment
Share on other sites

Recommended Posts

  • 0

If there are no objections, I'm going to modify the wiki page about lights: http://epochmod.gamepedia.com/A2Epoch:Lighting_System

 

The present situation is, lights are on and there is no way to turn them off. The wiki page has incorrect info and it is obviously confusing a lot of people. For one thing, it lists eleven input params to the lighting system. The code as is on github: https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/compile/local_lights_init.sqf actually reads just two parameters: _ndGen (needs generator) on line 14 and _rndLights on line 15.

 

...but this doesn't matter because even setting "needs generator" to true still results in lights being on, as Axeman explained almost a year ago.

 

It's clear that no change to this behavior is going to happen, or it would have already happened, so the wiki page needs to simply say, "epoch has lights. You cannot turn them off."

 

Right?

Link to comment
Share on other sites

  • 0

I've been looking at the code some more, and here's what I think I've figured out (more knowledgeable people please correct me):

 

Reading the wiki page on "lighting system" gives the impression that local_lights_init.sqf turns on the lights, but that's not (currenctly) the way it works.

 

The lights are actually turned on by SQF/dayz_code/Configs/CfgNonAIVehicles.hpp which is included on line 17 of https://github.com/vbawol/DayZ-Epoch/blame/master/SQF/dayz_code/config.cpp- you can see from this that this change was made on 3 Sept 2013. The change history of cfgNonAIVehicles.hpp: https://github.com/vbawol/DayZ-Epoch/commit/f01fc605b260483da7a0027de16631193ace35dc#diff-6bed3a4d5e4acd5269aacafccb506377 shows that when it was created, the brightness was set to 0 (the lights were off).

 

So the original idea was to make it work like the wiki says. Lights are off, then turned on by the SQF. But I guess that didn't work, because if you look at the diffs of cfgNonAIVehicles.hpp: https://github.com/vbawol/DayZ-Epoch/commits/master/SQF/dayz_code/Configs/CfgNonAIVehicles.hppyou'll see that it was changed on 10 Sept so that the lights are  on by default.

 

Presumably, the goal was to then turn them off with the SQF. Axeman mentions in comments in this thread that he was working on this idea, but his code isn't in the Epoch repo. There is, however, code in Axeman's repo here: https://github.com/andgregor/dayZ-Lighting

 

You can add the following to init.sqf and it will turn the lights off when the player is near

if (!isDedicated) then {
DZE_RequireGenerator = false;
DZE_StreetLights = false;
DZE_HouseLights = false;
DZE_TowerLights = false;
DZE_LightChance = 42;
[] execVM "lights\local_lights_init.sqf";
};

Unfortunately, the lights are still on when nobody is looking. It turns them off when you approach to within 450m. So, you can see lights in the distance - you can see whole cities lit up in fact, then they switch off when you get close. They don't switch back on when you leave. I haven't tested to see if generators still work.

 

I totally understand that some people want lights everywhere and bright full moons and they want night time to be basically just like day time but with fewer colors. That's cool. But if you want the creepy, enveloping, scary darkness, this is actually kind of a poor substitute, but it's better than nothing.

 

If you want the lights really off, you're going to have to remove line 17 from config.cpp and recompile.

 

In my humble opinion (and with thanks to the people who worked hard to develop this) the system is kind of broken as is, simply because it's obviously not doing what was intended. It's clear from the wiki that the goal was to make lights an option, and they're not.

Link to comment
Share on other sites

  • 0

The issue is with locality of the lights, difficulty/cost of getting a handle on the light object and management thereof, especially when you start to consider multiple generators and players in range.

 

Is something I would like to revisit when I have the time.

 

The config is the key point to setting the default values. From memory, we simplified the light system for one of the last releases due to performance hits, specifically flickering lights.

 

There is talk of light management in Epoch Mod, how far we take that and how different A3 is will reflect on the ultimate update of dayZ Epoch.. I already have it in my head, just need the couple of days to refine it into real code :)

Link to comment
Share on other sites

  • 0

Sorry, but i get this right yea?:

You want to turn lights off for ever?

Something like so?:

{

//if is light, turn light off

} count allMissionObjects "All";

Link to comment
Share on other sites

  • 0

not directly. They should be allways off, but if a generator is within X meters, and running, they light up

 

edit: Maybe i miss something now someone has denied before, but wouldn't it be possible to just disable all lights in chernarus and let them behave like fuel-stations you can put wherever you want? They work only if a generator is running too... But instead of giving fuel, they just create a radial light...

Link to comment
Share on other sites

  • 0
9 hours ago, TheodoreCHill said:

Is there no way to disable the lighting system in the 1062 update? It robs from the environment to explore fully lit up towns and cities during a zombie apocalypse.

It's disabled by default: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/Server Files/MPMissions/DayZ_Epoch_11.Chernarus/init.sqf#L133

Link to comment
Share on other sites

  • 0

Not this old toss again.

I've been saying it for more than 2 years now. The lighting system has NEVER been turned off and the developers of Epoch have no idea how to do it. Even though you can see references to them attempting it in the scripts. You won't get a straight answer in here. It'll be , maybe , yes , no , for sure. Trust me, it's a NO!

Peace.

 

If you need any help with the scripts, for non-lighting issues . Email me via thecloud.org.uk ..

 

Link to comment
Share on other sites

  • 0
11 minutes ago, MatthewK said:

Not this old toss again.

I've been saying it for more than 2 years now. The lighting system has NEVER been turned off and the developers of Epoch have no idea how to do it. Even though you can see references to them attempting it in the scripts. You won't get a straight answer in here. It'll be , maybe , yes , no , for sure. Trust me, it's a NO!

Peace.

 

If you need any help with the scripts, for non-lighting issues . Email me via thecloud.org.uk ..

 

I'm very sorry we don't know everything about anything.

Link to comment
Share on other sites

  • 0
10 hours ago, MatthewK said:

Not this old toss again.

I've been saying it for more than 2 years now. The lighting system has NEVER been turned off and the developers of Epoch have no idea how to do it. Even though you can see references to them attempting it in the scripts. You won't get a straight answer in here. It'll be , maybe , yes , no , for sure. Trust me, it's a NO!

Peace.

 

If you need any help with the scripts, for non-lighting issues . Email me via thecloud.org.uk ..

 

wtf lol - post your fix in here if you have it. Has to be the stupidest reply I have ever seen on this forum.

Link to comment
Share on other sites

  • 0

You can turn off the streetlights but as they are map objects you have to iterate through all objects and filter the lights by their model name, which makes it a very heavy process as nearestObjects detects everything (butterflies etc.), see axe_NoStreetLights function in:

https://github.com/andgregor/dayZ-Lighting/blob/master/MPMissions/lights/fn_lightFunctions.sqf

This function is called with parameters object and a range to switch the lights off within that object (usually the player).

Am sure I discussed with AWOL the possibility of overriding the default state of lights with config / .hpp, I seem to remember we couldn't do it. Configs weren't my strongest point :)

You can see the function being called with:

if(!DZE_StreetLights)then{
[player,_hsRange] call axe_NoStreetLights
};

at the bottom of the 'alive player' loop in:

https://github.com/andgregor/dayZ-Lighting/blob/master/MPMissions/lights/local_lights_init.sqf

No doubt there is room for optimising a lot of my code. It has been some time since I visited this and have always been bothered that it wasn't quite finished properly, some due to the complexities of the generators and some due to the restrictions of the engine / map structure.

I'm now sorely tempted to reinstall Arma2 and have a play with the old code..

Link to comment
Share on other sites

  • 0

Well, that's interesting..

It seems like there have been some changes to the engine since I last looked at this.

'Immersion Mode'  (No Street Lights) may be easily do-able at a much lower performance cost. Either that or I spent too much time looking at turning the lights on before :)

Am hooked again, I forgot just how good Arma 2 / dayZ Epoch was..

 

Link to comment
Share on other sites

  • 0

So I use to have this installed years ago and it worked great, but it seems you don't have the install guides or downloads anymore for this, because it was implemented into the base download for epoch? I can't seem to find the line you are saying to uncomment out in the init.sqf.

However the closest thing I have to that would be this which is uncommented. //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...