Example for new 2.1 probabilities

Edenstudent
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu May 15, 2025 2:03 am
Contact:

Example for new 2.1 probabilities

Post by Edenstudent »

Please add an example for the new Shared Probability type so that the syntax is understood.
https://lua-api.factorio.com/latest/typ ... ition.html
User avatar
PennyJim
Fast Inserter
Fast Inserter
Posts: 193
Joined: Wed Jan 18, 2023 3:49 am
Contact:

Re: Example for new 2.1 probabilities

Post by PennyJim »

Specifically something like

Code: Select all

-- 50/50 Always returns an item, with a chance of it being iron or copper plate
results =
{ 
	{type = "item", name = "iron-plate", amount = 1, shared_probability = {min = 0, max = 0.5}},
	{type = "item", name = "copper-plate", amount = 1, shared_probability = {min = 0.5, max = 1}},
}
Bilka
Factorio Staff
Factorio Staff
Posts: 3906
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Example for new 2.1 probabilities

Post by Bilka »

Thanks for the example, I've added a combination of that example and the example at 101360 to the docs for the next release.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Requests”