Is it possible to change existing
Code: Select all
/c game.surfaces[1].always_day=true
Code: Select all
/c game.surfaces[1].sun_bright=1
Code: Select all
/c game.surfaces[1].always_day=true
Code: Select all
/c game.surfaces[1].sun_bright=1
Nice work! But not exactly. See this idea: viewtopic.php?f=33&t=51196Klonan wrote:You're probably more looking for this:
http://lua-api.factorio.com/latest/LuaS ... ce.daytime
There is already surface.darkness but it's read only.Mooncat wrote:So you are talking about brightness, which should be a new property rather than changing the ones that are related to daytime.
Moweather introduces cloudy day that makes the surface to be darker. It is done by changing daytime. For now, you can use the same trick too as this is the only thing that affects brightness.
But IMO, for long term, a new variable should be implemented. Changing daytime for brightness is simply wrong.
Good to know!steinio wrote:There is already surface.darkness but it's read only.Mooncat wrote:So you are talking about brightness, which should be a new property rather than changing the ones that are related to daytime.
Moweather introduces cloudy day that makes the surface to be darker. It is done by changing daytime. For now, you can use the same trick too as this is the only thing that affects brightness.
But IMO, for long term, a new variable should be implemented. Changing daytime for brightness is simply wrong.
Code: Select all
return surface.daytime * DaytimeToDarknessConstant;
Yes could be. Daytime and darkness are strongly bound together.Mooncat wrote:Good to know!steinio wrote:There is already surface.darkness but it's read only.Mooncat wrote:So you are talking about brightness, which should be a new property rather than changing the ones that are related to daytime.
Moweather introduces cloudy day that makes the surface to be darker. It is done by changing daytime. For now, you can use the same trick too as this is the only thing that affects brightness.
But IMO, for long term, a new variable should be implemented. Changing daytime for brightness is simply wrong.
hm... but according to its description, it sounds like it is just a function converting daytime to darkness, something likeCode: Select all
return surface.daytime * DaytimeToDarknessConstant;
And complete code is justMooncat wrote: hm... but according to its description, it sounds like it is just a function converting daytime to darkness, something likeCode: Select all
return surface.daytime * DaytimeToDarknessConstant;
Code: Select all
if not (surface.alwaysday) then return surface.daytime * DaytimeToDarknessConstant else return 1 end
In fact, setting surface.always_day = true is the same asdarkfrei wrote:And complete code is justMooncat wrote: hm... but according to its description, it sounds like it is just a function converting daytime to darkness, something likeCode: Select all
return surface.daytime * DaytimeToDarknessConstant;
Code: Select all
if not (surface.alwaysday) then return surface.daytime * DaytimeToDarknessConstant else return 1 end
Code: Select all
surface.freeze_daytime = true
surface.daytime = 0
Code: Select all
surface.freeze_daytime = false