Editor Reference

Write your own mystery for Whispers in the West

Variation priority

Conditional variations are a powerful tool for creating nonlinear dialogue without needing complex if-else structures. They allow you to write flexible conversations that adapt to player choices, roles, and game states.


The dialogue engine follows a simple rule when choosing which variation to display:

It selects the last variation for which all conditions are met.


This design reflects the way writers typically structure dialogue: building from general to specific, or in the chronological order of events. Among all matching variations, the one written last is assumed to be the most contextually appropriate.

Example:


Let’s say a player has the item "drink", it’s Day 2 (label day_2 is set), and they are not the sheriff.

→ The bartender says: "Hi there, another drink to start the day?"


Now, if the same player is the sheriff, in addition to having the drink and it being Day 2:

→ The bartender says: "Hi there, have you caught the criminal yet?"


In this case, both variations match, but the second one appears later in the script and includes more specific context—so it’s the one that gets used.

Best Practices for Variation Priority:

Join our Discord server for community events

Follow us on Twitter for development updates

Subscribe to our newsletter