Random results from Recipe

Place to get help with not working mods / modding interface.
User avatar
Norway174
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Feb 17, 2020 10:31 am
Contact:

Random results from Recipe

Post by Norway174 »

Hello,

I'm working on my first mod, a stone washer, where you can dump into excess stone, and get back out a random amount of resources, like iron ore, or copper ore.
And I got everything working...

But with set amounts, like 5 stone wold always results in 2 iron and 2 copper. For example.
I would like to make it so, with 5 stone, there's a chance to get anywhere between 0 to 4 of each resource.

But I'm not sure if that's even possible. I've been looking at the Wiki. And not finding anything related to it.

So now I'm turning here, in hopes maybe there is another way?
I wrote my first mod: The Stone Processor!
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Random results from Recipe

Post by eradicator »

https://wiki.factorio.com/Types/ItemProductPrototype

Or look at how Kovarex Enrichment works in the base game.
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
Norway174
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Feb 17, 2020 10:31 am
Contact:

Re: Random results from Recipe

Post by Norway174 »

eradicator wrote: Sun Feb 23, 2020 4:29 pm https://wiki.factorio.com/Types/ItemProductPrototype

Or look at how Kovarex Enrichment works in the base game.
Thank you! Exactly what I was looking for. :D

Got it working perfectly now.
I wrote my first mod: The Stone Processor!
Post Reply

Return to “Modding help”