Page 1 of 1

Lighting transitions

Posted: Sun Jan 07, 2018 3:15 am
by Thalassicus
Does anyone have experience modifying lighting? I'm trying to make day and night more interesting, but I'm unsure if any of this is possible. I've spent an hour searching the API documentation and files with no success.

I'd like to reinstate gradual light toggling at dawn and dusk. The sudden switch in v16 is jarring. In addition, I'd like to heighten the transition between day and night by increasing daylight. I'm disappointed the immersive day/night cycle nearly disappears after early game. I want nightvision to remain at the same brightness level, but make daytime 30% brighter than it is now. I figured out how to modify nightvision, but can't find where to modify day...vision.

Re: Lighting transitions

Posted: Sun Jan 07, 2018 8:20 am
by eradicator
Starting with 0.16.0 darkness is supposedly controllable on a per-surface basis independently of daytime. From what i can see in the LuaSurface Documentation there are at least the following parameters:

.daytime .darkness .dusk .dawn .evening .morning .ticks_per_day .

Re: Lighting transitions

Posted: Mon Jan 08, 2018 10:01 pm
by Thalassicus
I discovered the same values. The "darkness" field is read-only, and I don't think I can use the others to increase the difference in light levels between day and night.

Re: Lighting transitions

Posted: Mon Jan 08, 2018 10:16 pm
by darkfrei
game.player.surface.always_day=true
...
game.player.surface.always_day=false

Re: Lighting transitions

Posted: Tue Jan 09, 2018 1:19 am
by eradicator
Thalassicus wrote:I discovered the same values. The "darkness" field is read-only, and I don't think I can use the others to increase the difference in light levels between day and night.
Are you sure this is not just a documentation error? The 0.16.0 changelog clearly states:

Code: Select all

Added support to change daytime length and brightness on a per-surface basis.
As the nessecity for mods to change the daytime to indirectly change darkness was a long stating cause of mod incompatibility and this was supposed to fix it. If it's not writeable that might actually be a bug.

Re: Lighting transitions

Posted: Wed Jan 10, 2018 7:08 am
by Thalassicus
I'll give it a try, thank you.