Page 1 of 1

R/W temps of reactors, etc or R/W consumption,burner.efficie

Posted: Wed Jul 11, 2018 8:51 pm
by ownlyme
Hi,
We're currently working on an update for the realistic reactors mod, which involves often replacing the entity.
The problem we ran into is that the temperature of the reactor always resets to 15° after replacing, which can't be changed.
I also noticed that heat-pipes have no api for their temperature either.
Alternatively, an api for the consumption and burner efficiency would be great too.

i was hoping you could add an api for the temperature of entities that have one.
thanks, you guys are awesome!

Re: R/W temps of reactors, etc or R/W consumption,burner.efficie

Posted: Thu Jul 12, 2018 4:53 am
by Optera
Am I missing something?
temperature is already an R/W property of some entities (including reactors) https://lua-api.factorio.com/latest/Lua ... emperature

Re: R/W temps of reactors, etc or R/W consumption,burner.efficie

Posted: Thu Jul 12, 2018 4:24 pm
by ownlyme
yeah but doesnt work on reactors, at least the displayed temperature on the entity resets to 15, even if you immediately set its "temperature" to the old value after replacing it.
it rises again within 1 second to its old value but at the pace we are replacing it the temperature is just jumping wildly.
Maybe it's the internal heat buffer that causes it (though changing its properties had no effect at all)

why did the staff member remove his post?
he wrote "I'd like to request this to be implemented as properties of (a new newly created) LuaHeatEnergySource."
i'm not entirely sure how that would look but i hope it would fix the problems we had with it

i attached the mod if you need a demonstration

Re: R/W temps of reactors, etc or R/W consumption,burner.efficie

Posted: Sat Jul 14, 2018 4:52 pm
by ownlyme
i discovered that i could manipulate efficiency by constantly updating remaining_burning_fuel, but there is no way to change the consumption

Re: R/W temps of reactors, etc or R/W consumption,burner.efficie

Posted: Thu Jul 19, 2018 12:32 am
by CyberWizard2261
I stumbled upon the same problem: I made heat accumulators based on heat pipes and wanted to make them keep the same temperature when replaced by an upgrade

The problem is: I set the entity's temperature in the on_built_entity event but this event only fires few ticks AFTER the entity is built, time enough to set its initial temperature to 15C and on top of this the game GUI for some reason delay to show the temperature set by the code another few ticks

If I use game.print(entity.temperature) just after setting the temperature it shows the right value while the game GUI shows 15C or an intermediary value (I tested on an isolated entity so no heat coming from external sources) only after a bit less than 1sec the GUI shows the right temperature I set by code

So the main problem is not R/W temp of reactors but the game GUI delaying to show the right value