Lighting transitions

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Thalassicus
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Apr 29, 2016 11:03 am
Contact:

Lighting transitions

Post 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.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Lighting transitions

Post 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 .
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Thalassicus
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Apr 29, 2016 11:03 am
Contact:

Re: Lighting transitions

Post 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.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Lighting transitions

Post by darkfrei »

game.player.surface.always_day=true
...
game.player.surface.always_day=false

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Lighting transitions

Post 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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Thalassicus
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Apr 29, 2016 11:03 am
Contact:

Re: Lighting transitions

Post by Thalassicus »

I'll give it a try, thank you.

Post Reply

Return to “Modding discussion”