Skip to content

Action: randActions

randActions takes a list of action groups and picks exactly one at random to execute. Each entry is a full self-contained group - sounds, messages, items, anything goes.

randActions: [
{ message: "Outcome A" }
{ message: "Outcome B" }
{ message: "Outcome C" }
]

Each entry has equal probability by default. To weight outcomes, repeat them - an entry appearing twice is twice as likely:

randActions: [
{ message: "Common outcome" }
{ message: "Common outcome" }
{ message: "Common outcome" }
{ message: "Rare outcome" }
]

Above: 3-in-4 chance of “Common”, 1-in-4 chance of “Rare”.

For one-of-N display (which item shows up) instead of one-of-N action, use the chance rule on items - see Rule: chance.