No active sessions yet.

No games yet.

No conversations yet.

No characters yet.

Steps

Reads are expressions; writes are steps. The verbs that change the world.

Reading the world is an expression. Changing it is a step. A rule body is a list of steps.

$.adjustField({ field: 'satiety', by: -1 })
$.damage({ amount: 3 })
$.narrate('the wound closes over')

Steps take named arguments. $.damage(3) is refused; write $.damage({ amount: 3 }). The few exceptions (narrate, refuse, veto, grantXp, passTime and a handful more) take one plain value, as shown below.

The common ones

Step Does
$.adjustField({ field, by }) Move a field by an amount
$.setField({ field, to }) Set a field to a value (a number or a word)
$.adjustStat({ stat, by }) / $.setStat({ stat, to }) Same, for stats
$.damage({ amount }) / $.heal({ amount }) Hurt or heal
$.applyEffect({ effect }) Apply an effect by name; add turns, minutes or permanent: true to override how long it lasts
$.removeEffect({ effect }) Remove one; leave effect out to remove all
$.give({ item, quantity }) Give the player an item
$.transfer({ item, from, to }) Move a carried item from one character to another. from and to are self, target, party or a character's name
$.spawnItem({ item }) Put an item in the world
$.spawn({ mob }) Spawn a creature
$.reveal({ item }) / $.hide({ item }) Bring something hidden into sight, or hide something here. Also takes npc or mob
$.grantAbility({ ability }) Teach an ability
$.grantXp(50) Award experience
$.setWorld({ key, value }) Set a world flag
$.startQuest({ quest }) Open a quest
$.startTimer({ id, minutes }) Fire a timer later
$.bond({ bond, by }) Change how an NPC feels
$.remember({ text }) Give an NPC a memory
$.sound('thunder') Play a sound
$.passTime(30) Advance the clock
$.tool({ tool }) Run a generator
$.narrate('...') Tell the narrator something happened
$.refuse('...') Stop the action, saying why in a clause that stands on its own ("they are too winded to swing"). The roll card and the narrator show it as written.
$.veto('...') Stop one proposed plugin event

The editor's completion lists every step, with its arguments.

Who it lands on

Steps that act on somebody take an optional targets:

targets Lands on
'target' (default) whoever was aimed at, or the user if nobody was
'self' always the user, whatever was aimed at
'allies' / 'enemies' the user's side / the other side
'buyer' whoever paid, inside a vendor service only

Add count to hit more than one on that side. A ration uses 'self' so feeding someone else still feeds the eater. A fire bomb uses targets: 'enemies', count: 3.

count is how many different targets, never how many hits. To strike one target three times, write the step three times:

$.damage({ dice: { count: 1, sides: 4 } })
$.damage({ dice: { count: 1, sides: 4 } })
$.damage({ dice: { count: 1, sides: 4 } })

A step can't name a specific character to hit. It lands relative to whoever fired the rule.

by vs to

$.adjustField({ field: 'fever', by: 1 })   // one worse than before
$.setField({ field: 'fever', to: 1 })      // exactly 1, whatever it was

Mix these up and you get a fever stuck at 1, or one that never stops climbing.

refuse vs veto

  • refuse stops the action the player is attempting.
  • veto stops one event another plugin proposed, like rest:sleep.

If you're answering another plugin's event, use veto. refuse there tells a player standing still that hunger woke them from a sleep they never started.

Spawning something that belongs to someone

$.spawnItem can say more than which item. Each option describes the one copy it makes:

Option Does
at: "self" Put it on the ground where whoever the rule is about stands
contents: { fromHolder: "self" } Move everything they carry into it (it must be a container)
tags: { key: "value" } Stamp text variables on this copy
fields: { key: expression } Stamp number variables on this copy, computed as it is made
likeness: { of, mark } Make this copy show someone
minutes: 90 Unmake this copy after that many in-game minutes, running its on destroyed rule
minutesExpr: $.dial("bodyDecayMinutes") The same lifetime, computed as it is made. 0 or less keeps it forever

A likeness gives one copy somebody's picture and titles it after them. of is a character, a creature, a player, or "self" for whoever the rule is about. mark is an optional icon drawn over the picture. The item's own picture is used when that someone has none.

It is how the Bodies plugin's hook makes a body look like whoever died:

$.spawnItem({ item: "Corpse", at: "self", contents: { fromHolder: "self" }, likeness: { of: "self", mark: "rpg:skull-solid" } })

That body shows up as "Corpse of Skitter" with Skitter's portrait under a skull. The same option makes a statue of a hero, a wanted poster of a bandit, or a painted portrait of a lost queen. The likeness is fixed when the copy is made, so it stays right after its subject has moved on.

Revealing and hiding

A hidden thing is really there, just unseen. $.reveal brings it into sight and $.hide takes something out of it. Name one item, NPC or creature:

$.reveal({ item: "Taped Keycard" })
$.hide({ npc: "Vuk" })
$.reveal({ mob: "Cave Lurker", at: "Sunken Crypt" })

An item or creature is looked for where the rule happens, or at at. A creature name reveals every one of that kind there. An NPC is found wherever they are. Someone in a fight can't be hidden.

The item appears in the scene the moment it's revealed, and the narrator is told it was found. A lever that opens a secret panel is a reveal; so is a potion of invisibility that hides whoever drinks it.

Narration never gets numbers

$.narrate("the fever's grip loosens")   // good
$.narrate('fever reduced by 2')         // bad

The narrator is never told the mechanics: no numbers, no cooldowns, no turn counts. That's what keeps the prose in voice. Write the sentence you want the player to read.

Damage is never zero

Damage has a floor of 1, so $.damage({ amount: 0 }) still costs a point. If a dial can be set to zero, check it first:

if ($.dial('starvationDamagePerHour') > 0) {
  $.damage({ amount: $.dial('starvationDamagePerHour') })
}

Next

Rule bodies: what else can go in a body.