[Rseding91][2.0.10] Bug about always_day duration

Bugs that are actually features.
User avatar
aspd199
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jul 14, 2017 10:10 pm
Contact:

[Rseding91][2.0.10] Bug about always_day duration

Post by aspd199 »

documents: always_day :: RW boolean When set to true, the sun will always shine.

Code: Select all

    game.players[1].surface.always_day = true
    game.surfaces[1].always_day = true
Either of the above two lines of code will only be in effect for a few seconds, after which it will expire and will not persist.
Everything was fine up to 1.1, after updating to 2.0 there was a problem.
Is there a conflict with "daytime"?
Rseding91
Factorio Staff
Factorio Staff
Posts: 15641
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91][2.0.10] Bug about always_day duration

Post by Rseding91 »

Thanks for the report however I can not reproduce any issue. Can you please post a save file where it isn't working and steps to reproduce?
If you want to get ahold of me I'm almost always on Discord.
User avatar
aspd199
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jul 14, 2017 10:10 pm
Contact:

Re: [Rseding91][2.0.10] Bug about always_day duration

Post by aspd199 »

The “always_day” attribute can't be locked to “true”, so if any other mod operates on the “daytime” attribute, “always_day” will automatically change to “false” instead of always shine.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15641
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91][2.0.10] Bug about always_day duration

Post by Rseding91 »

I still can not reproduce any such issue. daytime is frozen if setting always_day to true and is un-frozen if setting it to false, or setting freeze_daytime to false.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aspd199
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jul 14, 2017 10:10 pm
Contact:

Re: [Rseding91][2.0.10] Bug about always_day duration

Post by aspd199 »

simple test code:
function OnInit()
game.players[1].always_day = true
end

function OnTick(event)
if (game.tick % 600) == 0 then
game.players[1].surface.daytime = 0.5
end
game.players[1].print(game.players[1].always_day)
end

script.on_event(defines.events.on_tick, OnTick)
script.on_init(OnInit)
script.on_load(OnInit)
Rseding91
Factorio Staff
Factorio Staff
Posts: 15641
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91][2.0.10] Bug about always_day duration

Post by Rseding91 »

Ok, I think I see the confusion. "always_day" is a combination utility method. It sets freeze_daytime = true and daytime = 0. It does not prevent you from then changing daytime manually or with the lua API.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aspd199
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jul 14, 2017 10:10 pm
Contact:

Re: [Rseding91][2.0.10] Bug about always_day duration

Post by aspd199 »

I see, I thought that “always_day” is a switch to lock the daytime, as long as it is set to true, then “daytime” should be invalidated no matter how much it changes and keep the daytime state, only when “always_day” is false “daytime” should take effect!
Post Reply

Return to “Not a bug”