Page 1 of 1
[Solved] Prototype entity attribute seems to be missing
Posted: Fri May 05, 2017 9:27 am
by kikker450
There is no game.prototype_entity["assembling-machine-2"].crafting_categories even though I'm staring right at it in the raw files (Factorio\data\base\prototypes\entity) and there seems to be no way to access that piece of data. Does anyone know another way to access that data? I've now spend around a hour trying to find another way but it seems impossible.
Otherwise I'm thinking about asking the devs to add it since it's already in the data files but somehow inaccessible through the control.lua.
Re: Prototype entity attribute seems to be missing
Posted: Sun May 07, 2017 12:26 pm
by 321freddy
I don't see the crafting_categories property in LuaEntityPrototype either, so you would need a small workaround for accessing it at control.lua stage.
Take a look at
this. Using this you can read the data.raw table at runtime:
Code: Select all
data.raw["assembling-machine"]["assembling-machine-2"].crafting_categories
Re: Prototype entity attribute seems to be missing
Posted: Sun May 07, 2017 11:43 pm
by Rseding91
321freddy wrote:I don't see the crafting_categories property in LuaEntityPrototype either, so you would need a small workaround for accessing it at control.lua stage.
Take a look at
this. Using this you can read the data.raw table at runtime:
Code: Select all
data.raw["assembling-machine"]["assembling-machine-2"].crafting_categories
That mod is a giant hack - I don't advise ever using it.
If some property isn't available simply request it and I'll add it for the next version of the game (see:
viewtopic.php?f=65&t=46735)