Page 1 of 1
[0.17.11] Can't set currently burning to an item without a fuel value
Posted: Thu Mar 14, 2019 9:47 pm
by magu5026
I dont know if that's really a bug or something else.
I'm trying to put a fuel item in a burner of a locomotive with my mod.
I've stored this element in a global variable at the beginning (init + configuration_changed) of this mod:
Code: Select all
global.Fuel = game.item_prototypes ['nuclear-fuel']
In several functions I insert this object into the burner (train is the entity of the locomotive):
Code: Select all
train.burner.currently_burning = global.Fuel
train.burner.remaining_burning_fuel = global.Fuel.fuel_value
In 0.16.51 it works fine, but after 0.17 some users have received this error:
Can't set currently burning to an item without a fuel value.
PLS help me.
greetings magu5026
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 8:17 am
by darkfrei
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 9:11 am
by bobingabout
I was going to say you need to put the global definition in on_init and maybe also on_configuration_changed, but then as I quoted, I re-read when you put, and... oh, you said you did do that.
My next thought is... does nuclear-fuel have a fuel value? in the base game, yes, but is it possible that the people reporting this issue are using a mod where it doesn't?
Unless there is a specific reason why you're using nuclear-fuel, instead of just using existing objects, try defining your own dummy fuel in the data phase, and use that in your script instead of nuclear fuel.
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 9:25 am
by magu5026
I've already tried that. First, I created my own fuel item.
Code: Select all
local fuel = table.deepcopy(data.raw['item']['wood'])
fuel.name = "own-test-fuel"
fuel.flags = {"hidden"}
fuel.fuel_value = "10GJ"
But after updating to 0.17, it crashed. So I tried to use an item that was already in game.
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 9:33 am
by bobingabout
magu5026 wrote: Fri Mar 15, 2019 9:25 am
I've already tried that. First, I created my own fuel item.
Code: Select all
local fuel = table.deepcopy(data.raw['item']['wood'])
fuel.name = "own-test-fuel"
fuel.flags = {"hidden"}
fuel.fuel_value = "10GJ"
But after updating to 0.17, it crashed. So I tried to use an item that was already in game.
for something as simple as a fuel item, I wouldn't use the table.deepcopy method, I would just copy the entire code directly into your mod and edit as a appropriate. I usually reserve table.deepcopy (Actually, I don't use it at all, instead I prefer to use util.merge) for copying entities, because those are more likely to break with updates and can have quite a long complex amount of code in them, especially when it comes to graphics.
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 9:44 am
by magu5026
I'll try it. Some users modified my mod and tried the following:
deepcopy changed from "wood" to "nuclear-fuel"
replaced every instance of "global.Fuel" with "game.item_prototypes['own-test-fuel']
Some still have the problem and some have solved the problem.
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 11:23 am
by darkfrei
You can choose the item / recipe and get which mod has it changed.
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 11:37 am
by magu5026
darkfrei wrote: Fri Mar 15, 2019 11:23 am
You can choose the item / recipe and get which mod has it changed.
What do you mean??
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 12:02 pm
by darkfrei
magu5026 wrote: Fri Mar 15, 2019 11:37 am
darkfrei wrote: Fri Mar 15, 2019 11:23 am
You can choose the item / recipe and get which mod has it changed.
What do you mean??

You can see which mod is it: yellow text said that it was "Ice Ore" mod.
Re: [0.17.11] Can't set currently burning to an item without a fuel value
Posted: Fri Mar 15, 2019 12:14 pm
by magu5026
darkfrei wrote: Fri Mar 15, 2019 12:02 pm
magu5026 wrote: Fri Mar 15, 2019 11:37 am
darkfrei wrote: Fri Mar 15, 2019 11:23 am
You can choose the item / recipe and get which mod has it changed.
What do you mean??

You can see which mod is it: yellow text said that it was "Ice Ore" mod.
I don't understand what that should do and how it can help with my problem.
Thanks anyway for your help.