Assembly Machine - Recipe and output probabilities

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

Assembly Machine - Recipe and output probabilities

Post by Trblz »

I am working on a mod where all machines will create waste/scrap. Its a twist on Amator Phasma's Recycling mod

The idea is that all machines/smelters will produce waste/scrap and depending on the machine level, the chances for waste/scrap goes down but never to zero.

The vanilla formula for green circuits is: 3xcopper cable + 1xiron plate > electronic circuit.
In my mod it will become:
3xcopper cable + 1xiron plate > electronic circuit (X% chance) + copper scrap / iron scrap (100-X% chance)

All scrap/waste items will be in it's own recipe.category

Now i could define recipes like the following:

Code: Select all

MK1 3xcopper cable + 1xiron plate > electronic circuit (60% chance) + copper scrap / iron scrap (40% chance) 
MK2 3xcopper cable + 1xiron plate > electronic circuit (70% chance) + copper scrap / iron scrap (30% chance) 
MK3 3xcopper cable + 1xiron plate > electronic circuit (80% chance) + copper scrap / iron scrap (20% chance) 
...
But i would rather do it at CraftingMachine level where

Code: Select all

MK1 assembly machine = 60% success rate for recipe.category!=x, 40% for recipe.category=x
MK2 assembly machine = 70% success rate for recipe.category!=x, 30% for recipe.category=x
MK3 assembly machine = 80% success rate for recipe.category!=x, 20% for recipe.category=x
...
However when i check the Wiki on Prototype/CraftingMachine I cannot find hooks to use this way. Is this possible at all?
My Mod list: Necormant co-author

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Assembly Machine - Recipe and output probabilities

Post by eradicator »

Machines can not influence the content of a recipe (except for speed/productivity). They merely "execute" it, so you'll have to use a different recipe category + recipe prototype for each "chance level".
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

Re: Assembly Machine - Recipe and output probabilities

Post by Trblz »

eradicator wrote:
Sun Sep 01, 2019 3:06 pm
Machines can not influence the content of a recipe (except for speed/productivity). They merely "execute" it, so you'll have to use a different recipe category + recipe prototype for each "chance level".
hmm....ok - thanks for confirming this.
My Mod list: Necormant co-author

Post Reply

Return to “Modding help”