I am currently working on my first mod idea and i ran into several factorio related issues.
I want to make a building, that accepts resources and grants an global effect in return.
1. Which prototype can I use for my entity?
I think it needs an inventory?
2. How do i set the items my entity accepts?
I spent 2 hours looking through the Wiki and the Lua api documentation and have still no idea, the tutorial is great though.
Entity accepting items
Re: Entity accepting items
Maybe an assembler?
1. Create special recipe category.
2. Use an assembler prototype that can craft recipes of this special category.
3. Create recipes of this category.
Now your entity can accept defined resources at the defined amount.
entity.operable = false -- to prevent changing currently crafted recipe
entity.recipe = your_recipe -- in on_built_entity to automatically assign your recipe
recipe.enabled = false -- to prevent players to use this your_recipe
1. Create special recipe category.
2. Use an assembler prototype that can craft recipes of this special category.
3. Create recipes of this category.
Now your entity can accept defined resources at the defined amount.
entity.operable = false -- to prevent changing currently crafted recipe
entity.recipe = your_recipe -- in on_built_entity to automatically assign your recipe
recipe.enabled = false -- to prevent players to use this your_recipe
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Entity accepting items
> entity.operable = false -- to prevent changing currently crafted recipe
It would be better to use the fixed_recipe prototype property - similar to how the water pumpjack works: https://mods.factorio.com/mods/binbinhfr/WaterWell
It would be better to use the fixed_recipe prototype property - similar to how the water pumpjack works: https://mods.factorio.com/mods/binbinhfr/WaterWell
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Entity accepting items
How to choose the recipe automatically , like furnaces?aubergine18 wrote:> entity.operable = false -- to prevent changing currently crafted recipe
It would be better to use the fixed_recipe prototype property - similar to how the water pumpjack works: https://mods.factorio.com/mods/binbinhfr/WaterWell
Re: Entity accepting items
Fixed_recipe = your_recipe - in entity's prototype. See prototype of rocket silo in Factorio -> Base folder.