Page 1 of 1

updated burner production cannot satisfy the electric need until game restart

Posted: Sun May 22, 2022 11:35 pm
by rhynex
hello,

I am trying to make a mod about a new burner generator (takes fuel and generates power). it supports some tech which upgrades stuff.

my problem is about the capacity when I replace the entity in code. in mod code I have multiple entities of furnaces, representing each versions. first furnace has 12MW power and second has 18MW and so on. when first upgrade happens I replace the existing entity with code using create entity and put it over the existing one. it works perfectly, no problem.

my problem is about power production. as I said first furnace can produce 12MW and second (upgraded) one can produce 18MW
when I complete research I can see entity is changed but the power production is stalled at former value, in my example 12MW.

interestingly restarting game or reloading the map after saving works perfectly.

what could be wrong? what do I miss?

thanks

mod is not in portal yet but here: https://github.com/gungorenu/factorio-frostpunk-theme
edit: I updated the repo with a temporary fix but I would like to know a better solution if there is any. commit f9e8c13 should repro below issue

repro steps:
- create empty map
- put a basic first level furnace, put fuel into it
- create some 12MW input, any mod is fine, use Editor Extensions for example
- then make a research, to upgrade its power.
- when research ends the entity is changed, and it becomes 18MW capable. everything works until now
- now increase the input to 18MW. furnace shall not be able to produce it even though it is supposed to.
- save game and load map again. now it shall be able to satisfy the need

also using editor mod and replacing the entity has same problem.

Re: updated burner production cannot satisfy the electric need until game restart

Posted: Sun May 29, 2022 10:52 pm
by Rseding91
The repo is private or the link is wrong.

This sounds like a base game bug so if you can show me how to reproduce it I can see if it is and try to fix it.

Re: updated burner production cannot satisfy the electric need until game restart

Posted: Sun May 29, 2022 11:43 pm
by Rseding91
Actually I was able to identify the issue and it's fixed for the next 1.1 release.

Re: updated burner production cannot satisfy the electric need until game restart

Posted: Mon May 30, 2022 8:01 am
by rhynex
hello Rseding91,

I changed visibility of the repo again. you can have a look if you still need to. you can check commit with f9e8c13 for repro. in first post I put a repro steps. sorry, my mod is still a mess and it is hard to make it work.
thanks for the fix.