data.raw should be accessible (and read-only) from control.lua.
Currently, there are game.entityprototypes and game.itemprototypes - for specific types of prototypes only. There appears to be no way to access other prototypes.
Access to all prototypes in-game
Re: Access to all prototypes in-game
I would need the same in the near future for my resource-monitor-mod.
I just looked it up and game.entityprototypes only provides (read-)access to valid, type, name, maxhealth and flags.
I just looked it up and game.entityprototypes only provides (read-)access to valid, type, name, maxhealth and flags.
Re: Access to all prototypes in-game
We need to extend it, but Storing data.raw is not very good idea for the future, because once we allow modying prototypes during the game, it would work well.
So we just have to extend the read (write in the future) properties of LuaPrototype(s)
So we just have to extend the read (write in the future) properties of LuaPrototype(s)
Re: Access to all prototypes in-game
I would like a way to determine what (kind of) items a resource will yield, so you might want to start with that expansion?