[0.15.1] LuaFluidbox[].temperature is readonly

Things that has been reported already before.
__init__
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Apr 25, 2017 9:47 am
Contact:

[0.15.1] LuaFluidbox[].temperature is readonly

Post by __init__ »

The temperature of fluids inside a fluid box can be read but not overwritten.
For example, when hovering an offshore pump:

Code: Select all

game.players[1].selected.fluidbox[1].temperature = 100
Has no effect

Code: Select all

game.players[1].print(game.players[1].selected.fluidbox[1].temperature)
Still returns the same value as before setting the temperature
posila
Factorio Staff
Factorio Staff
Posts: 5409
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.15.1] LuaFluidbox[].temperature is readonly

Post by posila »

Hi, thanks for the report.

This is not a bug, LuaFluidbox is a copy of fluid parameters, so you need to use it like following

Code: Select all

local fluid = game.players[1].selected.fluidbox[1]
fluid.temperature = 100
game.players[1].selected.fluidbox[1] = fluid
__init__
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Apr 25, 2017 9:47 am
Contact:

Re: [0.15.1] LuaFluidbox[].temperature is readonly

Post by __init__ »

Well, that is true but writing a new object doesn't work either:

Code: Select all

game.players[1].selected.fluidbox[1] = {type="water", amount=10, temperature=100}
On an empty pipe adds 10 water at 15°C (default temperature).
So the temperature is ignored.
posila
Factorio Staff
Factorio Staff
Posts: 5409
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.15.1] LuaFluidbox[].temperature is readonly

Post by posila »

I see.
Fixed for 0.15.2 (viewtopic.php?f=30&t=44842)
Post Reply

Return to “Duplicates”