resource (possibly infinite) with multiple possible results

Place to get help with not working mods / modding interface.
Post Reply
slay_mithos
Fast Inserter
Fast Inserter
Posts: 204
Joined: Tue Feb 25, 2014 7:22 am
Contact:

resource (possibly infinite) with multiple possible results

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

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: resource (possibly infinite) with multiple possible resu

Post by AlexPhoenix »

this is multiple results bug, so devs must pay attention to this.

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: resource (possibly infinite) with multiple possible resu

Post by AlexPhoenix »

i'll post it to bug section.

User avatar
Dysoch
Filter Inserter
Filter Inserter
Posts: 445
Joined: Fri Oct 18, 2013 2:27 pm
Contact:

Re: resource (possibly infinite) with multiple possible resu

Post 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
Creator of:
- DyTech
- DyWorld
- DyWorld-Dynamics
- DyWorld-Dynamics 2
Active since Factorio 0.6

slay_mithos
Fast Inserter
Fast Inserter
Posts: 204
Joined: Tue Feb 25, 2014 7:22 am
Contact:

Re: resource (possibly infinite) with multiple possible resu

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

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: resource (possibly infinite) with multiple possible resu

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

slay_mithos
Fast Inserter
Fast Inserter
Posts: 204
Joined: Tue Feb 25, 2014 7:22 am
Contact:

Re: resource (possibly infinite) with multiple possible resu

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

Post Reply

Return to “Modding help”