How to retrieve a recipe prototype by name

Place to get help with not working mods / modding interface.
Simn
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Dec 02, 2014 8:27 pm
Contact:

How to retrieve a recipe prototype by name

Post by Simn »

Hi!

I'm trying to find the ingredients of items in control.lua and can't figure out how to do that. I see that the game object allows me to get prototypes for items and entities, but what about recipes? I tried querying data.raw only to find out that data is a nil value at this point.

Thanks!
User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: How to retrieve a recipe prototype by name

Post by L0771 »

You can't get ingredients from the recipes for now, only this parameters are available.
Simn
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Dec 02, 2014 8:27 pm
Contact:

Re: How to retrieve a recipe prototype by name

Post by Simn »

Thanks for the reply. I know only these properties are available on the object, my hope was that I could get the prototype somehow. Oh well...
User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: How to retrieve a recipe prototype by name

Post by L0771 »

From here?
If you have an idea how can you get a property from prototypes, please tell me, i have the same problem with resources and trees.

Or can post here for it.
Simn
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Dec 02, 2014 8:27 pm
Contact:

Re: How to retrieve a recipe prototype by name

Post by Simn »

I thought you could get the prototype of trees from game.entityprototypes, but it seems that's not actually a Prototype/Entity but a Lua/EntityPrototype with only a few properties.
User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: How to retrieve a recipe prototype by name

Post by L0771 »

that's the problem, with recipe's ingredient is the same
Simn
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Dec 02, 2014 8:27 pm
Contact:

Re: How to retrieve a recipe prototype by name

Post by Simn »

From my understanding a recipe is not an entity though. It's not an item either, which are the two entity functions available on the game object.
Post Reply

Return to “Modding help”