Page 1 of 1

Entity accepting items

Posted: Mon Oct 31, 2016 11:16 am
by Theudas
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.

Re: Entity accepting items

Posted: Sun Nov 06, 2016 8:29 pm
by apriori
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

Re: Entity accepting items

Posted: Sun Nov 06, 2016 9:48 pm
by aubergine18
> 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

Posted: Mon Nov 07, 2016 11:51 am
by darkfrei
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
How to choose the recipe automatically , like furnaces?

Re: Entity accepting items

Posted: Mon Nov 07, 2016 5:55 pm
by apriori
Fixed_recipe = your_recipe - in entity's prototype. See prototype of rocket silo in Factorio -> Base folder.