Page 1 of 1

resource (possibly infinite) with multiple possible results

Posted: Tue Mar 11, 2014 1:58 pm
by slay_mithos
Hello,

I am trying to make a resource, based on infinite oil spawn, that can be mined by normal miners, and would each time output one result out off a list of 5.

Here is the my definition, using Dytech gems as results (but could be anything, really).
code
My problem is that it will pick one output, output tons of it in front of my burner mining drill, on a belt, but never inside a chest.

What I wanted to do is that each cycle would output one and only one piece of only one of the 5 types.

It might be me not thinking it right, misusing the 'infinite' spawns, or even misusing the multiple results, so I wanted to ask for advices from people knowing their stuff better than I do.

Re: resource (possibly infinite) with multiple possible resu

Posted: Tue Mar 11, 2014 5:07 pm
by AlexPhoenix
this is multiple results bug, so devs must pay attention to this.

Re: resource (possibly infinite) with multiple possible resu

Posted: Wed Mar 12, 2014 7:13 am
by AlexPhoenix
i'll post it to bug section.

Re: resource (possibly infinite) with multiple possible resu

Posted: Wed Mar 12, 2014 9:23 am
by Dysoch
also when its working correctly, you have a bug :P

all the chances to get the ores combined are 0.5 (they need to be 1!)
so changing all to 0.2 would fix it

Re: resource (possibly infinite) with multiple possible resu

Posted: Wed Mar 12, 2014 9:39 am
by slay_mithos
Ah, no, this was a test to check if it fixed the problem.

In fact, the probability does not have to be 1 in total, because the engine will call the RAND function for each entry separately, meaning that the 'probability' is not a randomization between the results.

Re: resource (possibly infinite) with multiple possible resu

Posted: Wed Mar 12, 2014 2:27 pm
by AlexPhoenix
fix provided
https://forums.factorio.com/forum/vie ... 428#p20428
i think

Code: Select all

        {
          name = "ruby-ore",
          amount_min = 1,
          amount_max = 1,
          probability =0.1
        }
can work(or use 1-2)

Re: resource (possibly infinite) with multiple possible resu

Posted: Wed Mar 12, 2014 3:38 pm
by slay_mithos
It's still not as I would, because making the yield 100% and the total probabilities to 1 doesn't always give me one result, and I am pretty sure I also got a few times with 2 at once.

Either way, it's still good enough to "solve" the gems generation problem that DyTech has been suffering from, and that became game crippling with 0.9.2.

Many thanks Alex.