[0.15.9] Modding, no way to acces crafting_category
Posted: Sat May 06, 2017 5:37 pm
It's less of a bug and more of what seems to be an oversight. I tried to access the crafting_category of an entity_prototype only to find out that the call actually doesn't exist.
The test in my mod file: control.lua
returns:
It clearly is an attribute of the entity in (Factorio\data\base\prototypes\entity\demo-entities.lua)
The call is simply not in the lua documentation (Factorio/doc-html/LuaEntityPrototype.html) nor a description of the value I expect to get (a table with strings in it). But obviously the game uses that value to generate recipes in the gui of an assembler so it seems an oversight.
If there is some way to get the value I'm obviously in the wrong ;P.
The test in my mod file: control.lua
Code: Select all
script.on_event(defines.events.on_gui_click, function(e)
something = game.entity_prototypes["assembling-machine-1"].crafting_categories
end
but things like this do workError while running event dinges::on_gui_click (ID 1)
LuaEntityPrototype doesn't contain key crafting_categories.
Code: Select all
script.on_event(defines.events.on_gui_click, function(e)
something = game.entity_prototypes["assembling-machine-1"].crafting_speed
end
It clearly is an attribute of the entity in (Factorio\data\base\prototypes\entity\demo-entities.lua)
Code: Select all
crafting_categories = {"crafting"},
crafting_speed = 0.5,
If there is some way to get the value I'm obviously in the wrong ;P.