Boiler chaning 0.16 to 0.17

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Linver
Fast Inserter
Fast Inserter
Posts: 158
Joined: Wed Jan 09, 2019 2:28 pm
Contact:

Boiler chaning 0.16 to 0.17

Post 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?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Boiler chaning 0.16 to 0.17

Post by darkfrei »

Just read result data.raw
Mod for it: viewtopic.php?f=135&t=45107

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Boiler chaning 0.16 to 0.17

Post 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"
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Boiler chaning 0.16 to 0.17

Post 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))

User avatar
Linver
Fast Inserter
Fast Inserter
Posts: 158
Joined: Wed Jan 09, 2019 2:28 pm
Contact:

Re: Boiler chaning 0.16 to 0.17

Post 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

Post Reply

Return to “Modding help”