Example for new 2.1 probabilities

Place to report issues and suggest improvements to the API documentation.
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: 191
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}},
}
Post Reply

Return to “Documentation Improvement Requests”