Lighting transitions

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

Lighting transitions

Post by Thalassicus » Sun Jan 07, 2018 3:15 am

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: 3167
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Lighting transitions

Post by eradicator » Sun Jan 07, 2018 8:20 am

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: Hand Crank Generator, Screenshot Hotkey 2.0
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: 6
Joined: Fri Apr 29, 2016 11:03 am
Contact:

Re: Lighting transitions

Post by Thalassicus » Mon Jan 08, 2018 10:01 pm

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: 2035
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Lighting transitions

Post by darkfrei » Mon Jan 08, 2018 10:16 pm

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

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

Re: Lighting transitions

Post by eradicator » Tue Jan 09, 2018 1:19 am

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: Hand Crank Generator, Screenshot Hotkey 2.0
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: 6
Joined: Fri Apr 29, 2016 11:03 am
Contact:

Re: Lighting transitions

Post by Thalassicus » Wed Jan 10, 2018 7:08 am

I'll give it a try, thank you.

Post Reply

Return to “Modding discussion”

Who is online

Users browsing this forum: No registered users