Is this possible?

Place to get help with not working mods / modding interface.
Post Reply
Programmix
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Nov 19, 2014 5:06 am
Contact:

Is this possible?

Post 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!

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Is this possible?

Post by DaveMcW »

Give it a different force?

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: Is this possible?

Post by rk84 »

Code: Select all

entity.operable = false
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: Is this possible?

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13218
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Is this possible?

Post 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"
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding help”