Page 1 of 1

Is this possible?

Posted: Sat Dec 12, 2015 6:51 am
by Programmix
I have a sort of custom assembling machine in my mod. The type is "assembling-machine". I'm wondering if it's possible to disable players from changing the recipe inside of it.

Thanks!

Re: Is this possible?

Posted: Sat Dec 12, 2015 11:16 am
by DaveMcW
Give it a different force?

Re: Is this possible?

Posted: Sat Dec 12, 2015 9:20 pm
by rk84

Code: Select all

entity.operable = false

Re: Is this possible?

Posted: Sat Dec 12, 2015 11:07 pm
by MrDoomah
rk84 wrote:

Code: Select all

entity.operable = false
To expand: this will also prevent players from setting a recipe if the assembler doesn't have any yet. Which is fine if you want your assembling machine to only be able to make one recipe, since then you can just use:

Code: Select all

entity.recipe = entity.force.recipes["recipe name"] 
assuming the recipe is available to that force of course.

Re: Is this possible?

Posted: Wed Dec 23, 2015 2:56 pm
by Rseding91
MrDoomah wrote:... you can just use:

Code: Select all

entity.recipe = entity.force.recipes["recipe name"] 
assuming the recipe is available to that force of course.
If you already know the recipe name you just set it directly - no need to look it up in the force recipes list:

Code: Select all

entity.recipe = "recipe name"