Rules

A rule is how you say what you mean in the dashboard, without writing any code. It is built from two things: what a player has done, and what is true about them.

You pick the events and attributes, the amounts and the stretch of time, and the dashboard reads it back as a sentence:

How many times Lesson completed happened is at least 3, in the last 7 days and the player's Plan is “premium”

One thing they did, one thing that is true about them.

Rules do two jobs, and the difference matters:

  • What finishes something. A mission's objectives, and what keeps a streak alive. A mission's objectives count only what the player does after the mission starts.
  • Who it is for, and what opens it. Everyone, or the players you choose with a rule, and nobody else sees it. A second rule can keep it locked until a player meets it. For example, until they reach level 10.

A rule you expect to use more than once is worth saving as a segment instead of writing it again.

Who gets in stays in

A rule that says who something is for is checked once, when the player first joins it:

  • A mission, when it starts for them.
  • A streak, on the first day that counts for them.
  • A leaderboard, the first time they score in a period. The next period checks again.

After that they are in, and they stay in even if they stop matching. A player who leaves a segment keeps the mission they already started.

The shop is the exception. A listing checks the rule at every purchase, so a player who stops matching stops being able to buy.

On this page