Skip to content

Blocks - if / elseif / else / end

Branch prose, effects, and navigation on state with blocks:

*if MOR >= 60
You feel good about it.
*effects: HAP+2
*elseif MOR >= 40
It nags at you a little.
*else
It's just a dog.
*endif
  • Every *if needs an *endif. A missing one is a build error pointing at the opening line; a stray *else/*endif outside a block is an error too.
  • Blocks nest freely.
  • A block body can contain prose, *effects:/*set:, ... beats, further blocks, and -> navigation.

A choice inside a block only exists when its branch fires - one condition opens prose and options together, which pairs especially well with dice checks:

*if random(10) >= 5
You spot a coin in the gravel.
> Pick it up
*effects: WEA+1
> Leave it
Someone luckier will find it.
*else
Gravel, gravel, and more gravel.
*endif

Three ways to gate a choice - pick by intent:

  • *requires: on the choice - the option is seen but disabled with a hint (“Requires: Willpower ≥ 60”). The player learns what they aren’t. Each choice evaluates its own condition.
  • *requires_hidden: on the choice - the option is omitted silently; right for temptations and secrets among otherwise-visible siblings.
  • Choices inside an *if/random branch - the options exist only in that branch. Right when one condition (especially one roll) governs prose and choices as a unit, or when a branch owns a whole alternative set of options.

For a branch whose follow-up deserves its own scene, navigating to a subscene (-> victory) that holds the choices remains the cleanest large-scale structure.

Random blocks: *random / *chance / *endrandom

Section titled “Random blocks: *random / *chance / *endrandom”

Where if branches on state, random branches on fate - exactly one arm fires, picked by relative weight:

*random
*chance 50
A coin. Of course it's a coin.
*effects: WEA+1
*chance 30
Empty. The box mocks you.
*chance 20
A wasp. Why is there a wasp.
*effects: VIT-1
-> wasp_chase
*endrandom
  • Weights are positive whole numbers, relative to each other - summing to 100 reads as percentages, but 1 vs 3 works the same as 25%/75%.
  • The roll happens when the body runs (a choice taken, a scene entered); a random in a revisitable hub rolls fresh on each visit.
  • Arms may contain prose, effects, ... pauses, nested if/*random blocks, -> navigation, and choices - a random encounter can offer its own options.
  • Fewer than two arms, a missing *endrandom, or *chance outside a *random block are build errors. Prose starting with the word *chance inside an arm needs a \ escape.