I am currently working on a fix for Autofill to include modded items in its fuel detection and insertion logic, but I have hit a fairly major roadblock.
I can retrieve all the item prototypes with a fuel value (coal, wood, wooden chest, crushed coal from Angel's addons, etc.) and the value is stored as a string, e.g. "8MJ".
What I don't understand is that the type of this value is not the one described in the official API (fuel_value property), which is typed as a float.
I used the data-raw-protoypes to filter the properties I need.
Code: Select all
wood
{
fuel_category = "chemical",
fuel_value = "2MJ",
name = "wood",
type = "item"
}
wooden-chest
{
fuel_category = "chemical",
fuel_value = "4MJ",
name = "wooden-chest",
type = "item"
}
- What is the correct way to store this fuel value ? As a string with the absolute energy value and the unit (used in every mod and the base game item prototypes), or as a float value, which the wiki explains that it represents the energy value relative to coal's energy value?
- If this value is supposed to be stored as a string, is there any way to compare 2 fuel values (beside writing my own string->int converter function)?