Access prototypes in-game?
Access prototypes in-game?
Is there any way to access prototype data from in the game (i.e. control.lua)? Specifically, I need the recipe and technology prototypes. Entity and item prototypes are already available through game.entityprototypes and game.itemprototypes...
- AlexPhoenix
- Fast Inserter
- Posts: 149
- Joined: Tue Feb 18, 2014 7:48 am
- Contact:
Re: Access prototypes in-game?
Code: Select all
game.player.force.recipes["repair-pack"]
Re: Access prototypes in-game?
All you can do with that is see/set whether the recipe is enabled or not, and reload it.AlexPhoenix wrote:somehow like this.Code: Select all
game.player.force.recipes["repair-pack"]
Re: Access prototypes in-game?
Same way as editing them drom the data.lua: data.raw.type.name where type and name are the the type (assembling machine, container, item, recipe etc) and the name is... The name!
So for example
data.raw.container["wooden-chest"]
But you cant edit them
So for example
data.raw.container["wooden-chest"]
But you cant edit them
Re: Access prototypes in-game?

Same thing happens when run from a control.lua script (as opposed to the console)
Re: Access prototypes in-game?
Mmm yea Try with game.entityprototype or game.itemprototype.
Also try putting the type or directly the name.
Also try putting the type or directly the name.
Re: Access prototypes in-game?
game.entityprototype and game.itemprototype are for entities and items. There's no game.recipeprototype, game.technologyprototype, recipe, or technology, nor the names of individual recipes or technologies:ficolas wrote:Mmm yea Try with game.entityprototype or game.itemprototype.
Also try putting the type or directly the name.

I already knew that, but I just tried them in the console for proof.
Same thing happens in 0.8.8 and 0.9.0.