Probabilistic fluid recipe

Place to get help with not working mods / modding interface.
Post Reply
Fatmice
Filter Inserter
Filter Inserter
Posts: 808
Joined: Thu Dec 04, 2014 11:03 pm
Contact:

Probabilistic fluid recipe

Post by Fatmice »

Is it possible to make a fluid recipe such that 100 of A -> 100 of A at 99% of the time and 100 of A -> 99 of A at 1 % of the time?

Alternatively, 100 of A -> 100 of B at 99% and 100 of A -> (99 of B and 1 of C) at 1% of the time?

Both of the above are not equivalent to (100 of A -> 99 of B and 1 of C) or (100 of A -> 99 of A), which are fixed ratios.
Maintainer and developer of Atomic Power. See here for more information.
Current release: 0.6.6 - Requires 0.14.x
Example build - Requires 0.14.x

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Probabilistic fluid recipe

Post by Arch666Angel »

I think you are looking for what was suggested here?

viewtopic.php?f=23&t=47597&p=276271#p276271


Fatmice
Filter Inserter
Filter Inserter
Posts: 808
Joined: Thu Dec 04, 2014 11:03 pm
Contact:

Re: Probabilistic fluid recipe

Post by Fatmice »

I'm aware of all of that. I've used that even before it was documented. What I am asking doesn't seem do able from all that I know.
Arch666Angel wrote:I think you are looking for what was suggested here?

viewtopic.php?f=23&t=47597&p=276271#p276271
If that is the case, what I want is not possible with the current probabilistic implementation as outputs are rolled independently.
Maintainer and developer of Atomic Power. See here for more information.
Current release: 0.6.6 - Requires 0.14.x
Example build - Requires 0.14.x

Fatmice
Filter Inserter
Filter Inserter
Posts: 808
Joined: Thu Dec 04, 2014 11:03 pm
Contact:

Re: Probabilistic fluid recipe

Post by Fatmice »

I have solved my own problem.

For the first case, 100 of A -> 100 of A at 99% of the time and 100 of A -> 99 of A at 1 % of the time, make the following recipe.
100 of A -> 99 of A + 1 of A at probability = 99%

Code: Select all

ingredients =
{
	{type="fluid", name="A", amount=100},
},
results=
{
	{type="fluid", name="A", amount=99},
	{type="fluid", name="A", amount=1, probability=0.99},
},
For the second case, 100 of A -> 100 of B at 99% and 100 of A -> (99 of B and 1 of C) at 1% of the time, make the following recipe.
100 of A -> 99 of B + 1 of B at probability = 99% + 1 of C at probability = 1%

Code: Select all

ingredients =
{
	{type="fluid", name="A", amount=100},
},
results=
{
	{type="fluid", name="B", amount=99},
	{type="fluid", name="B", amount=1, probability=0.99},
	{type="fluid", name="C", amount=1, probability=0.01},
},
Maintainer and developer of Atomic Power. See here for more information.
Current release: 0.6.6 - Requires 0.14.x
Example build - Requires 0.14.x

Post Reply

Return to “Modding help”