Page 1 of 1

Boiler chaning 0.16 to 0.17

Posted: Fri Mar 08, 2019 6:55 am
by Linver
Hi all, I have a problem with a boiler prototype in the 0.17. This code will create a nerfed version of heat exchanger:
local HeatExchanger = table.deepcopy(data.raw.boiler["heat-exchanger"])
HeatExchanger.name = "CW-basic-heat-exchanger"
HeatExchanger.icon = "__CW-thermal-solar-power__/graphics/icons/heat-boiler1.png"
HeatExchanger.target_temperature = 165
HeatExchanger.output_fluid_box.base_area = 10
HeatExchanger.energy_consumption = "1.8MW"
HeatExchanger.energy_source.specific_heat = "100KJ"
HeatExchanger.minable.result = "CW-basic-heat-exchanger"

Work well in the 0.16 but in the 0.17 not anymore, in particular the target_temperature remain to 500C, any suggestion?

Re: Boiler chaning 0.16 to 0.17

Posted: Fri Mar 08, 2019 8:09 am
by darkfrei
Just read result data.raw
Mod for it: viewtopic.php?f=135&t=45107

Re: Boiler chaning 0.16 to 0.17

Posted: Fri Mar 08, 2019 9:50 am
by bobingabout
I'm not a fan of table.deepcopy myself, I prefer util.merge

Code: Select all

data:extend({
util.merge{data.raw.boiler["heat-exchanger"],
  {
    name = "heat-exchanger-2",
    icon = "__base__/graphics/icons/heat-boiler.png",
    icon_size = 32,
    minable = {hardness = 0.2, mining_time = 0.5, result = "heat-exchanger-2"},
    max_health = 500,
    target_temperature = 615,
    energy_consumption = "14.4MW",
    next_upgrade = "heat-exchanger-3",
  }
},
})
But from what I can tell, you didn't do anything wrong, I don't know why it wouldn't work.

you could also just add the item first, then change the value afterwards like this

Code: Select all

data.raw.boiler["heat-exchanger"].max_health = 400
data.raw.boiler["heat-exchanger"].target_temperature = 465
data.raw.boiler["heat-exchanger"].energy_consumption = "10.8MW"

Re: Boiler chaning 0.16 to 0.17

Posted: Fri Mar 08, 2019 11:21 am
by darkfrei
1. Be sure that your mod is enabled.
2. Be sure that this file was required.
3. Complain data.raw.boiler before and after changing wiith log (serpent.block (data.raw.boiler))

Re: Boiler chaning 0.16 to 0.17

Posted: Fri Mar 08, 2019 1:07 pm
by Linver
I solve with this, but I don't know really why:

-- HeatExchanger.target_temperature = 165
HeatExchanger.energy_source.min_working_temperature = 165.0
HeatExchanger.energy_source.min_temperature_gradient = 165.0
HeatExchanger.energy_source.max_temperature = 200.0
HeatExchanger.energy_source.specific_heat = "100KJ"
HeatExchanger.energy_source.max_transfer = "6000kW"

The problem was only on temperature, other things work well