Weighted Random Pick

Pure
WeightedRandomPick

Picks a random item from an array using weighted probabilities.

Type: Pure (no side effects)
Category: Fortuna|Array & Collection
Keywords: array & collection

Inputs

NameTypeDefaultDescription
ItemsTArray<int>Items parameter
WeightsTArray<float>Weights parameter

Outputs

NameTypeDescription
ReturnValueintReturnValue output
SelectedIndexintSelectedIndex output

Example Use Cases

Example 1

Loot drop table with rare/common weights.

Example 2

Enemy spawn selection biased toward certain types.