[0.17.11] Can't set currently burning to an item without a fuel value

Place to get help with not working mods / modding interface.
magu5026
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Jun 07, 2017 4:25 pm
Contact:

[0.17.11] Can't set currently burning to an item without a fuel value

Post 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
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post 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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
magu5026
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Jun 07, 2017 4:25 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post 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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post 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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
magu5026
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Jun 07, 2017 4:25 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post 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.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post by darkfrei »

You can choose the item / recipe and get which mod has it changed.
magu5026
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Jun 07, 2017 4:25 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post 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??
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post 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??
Image
You can see which mod is it: yellow text said that it was "Ice Ore" mod.
magu5026
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Jun 07, 2017 4:25 pm
Contact:

Re: [0.17.11] Can't set currently burning to an item without a fuel value

Post 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??
Image
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.
Post Reply

Return to “Modding help”