Access to all prototypes in-game

Things that already exist in the current mod API
immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Access to all prototypes in-game

Post by immibis »

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.
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: Access to all prototypes in-game

Post by drs9999 »

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.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Access to all prototypes in-game

Post by kovarex »

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)
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: Access to all prototypes in-game

Post by drs9999 »

I would like a way to determine what (kind of) items a resource will yield, so you might want to start with that expansion? ;)
Post Reply

Return to “Already exists”