Weighted pick
Take one of several paths at random, some likelier than others.
logic.weighted picks one of its outcomes at random, each as likely as its weight says.
Settings
| Setting | What it does |
|---|---|
| Outcomes | One name: weight per line, such as Rare: 25. A weight of 5 is five times as likely as 1. A weight can be a token, such as {var.luck}. |
Ways out
One per outcome, labelled with its name.
Notes
- The weights don't have to add up to 100.
- An outcome with a weight of 0 never happens.
- In the blueprint each outcome leads out by
pick:and its name, written the way a Switch writes a case.
Example
A /loot command with Common: 70, Rare: 25 and Legendary: 5, each wired to a different reply.
Related
- Chance, for a single hit or miss
- Pick at random, to pick a value rather than a path