I'm making my first mod recently, and I need to access properties of a prototype which is not listed in the properties of a LuaEntityPrototype.
For example, I need too know the energy_consumption of a boiler (seehttps://wiki.factorio.com/Prototype/Boiler), but data.raw["boiler"]["boiler"]["energy_consumption"] is unavailable in control.lua. What should I do?
How to access properties of a prototype in control.lua
Re: How to access properties of a prototype in control.lua
https://lua-api.factorio.com/0.16.51/Lu ... prototypes
Code: Select all
game.entity_prototypes[<entity_name>][<property_name>]
Last edited by eduran on Wed Feb 20, 2019 6:16 am, edited 1 time in total.
Re: How to access properties of a prototype in control.lua
game.entity_prototypes["boiler"].max_energy_usage
Re: How to access properties of a prototype in control.lua
me I do a lua module, it s better when something change in API
https://github.com/Helfima/helmod/blob/ ... e.lua#L105
https://github.com/Helfima/helmod/blob/ ... e.lua#L105