Table des matières

Language / Langue : FR | EN

Custom Actions (YAML)

Custom actions add free-form commands. On web/desktop, the player types the verb directly. On Discord, they use the action command.

Declaration

Local actions live in a room's actions: block. Global actions live at root level in global_actions: and are available everywhere.

actions:
  - verb: examine
    target: chest
    if: ~
    text_ok: "An old wooden chest. It looks locked."
    text_ko: "Nothing interesting here."

  - verb: open
    target: chest
    if: "key"
    do:
      - "gold.+.50"
      - object: key
        to: inventory
        remove: true
    text_ok: "You open the chest! +50 gold."
    text_ko: "The chest is locked. You need a key."

target: all

With target: all, any typed target is accepted:

global_actions:
  - verb: go
    target: all
    if: ~
    do: "t_action_cible_ok_t"
    text_ko: "Unknown destination: t_action_cible_t."
Variable Value
t_action_cible_t Raw target typed by the player.
t_action_cible_ok_t Last valid target.

Same Verb and Target

Several actions with the same verb and target are tested in order. The first true condition wins.

Action Alias

actions:
  - verb: inspect
    target: still
    alias: still
    if: ~
    text_ok: "The central still waits for ingredients."

The player can type still instead of inspect still.

Action Button

actions:
  - verb: use
    target: potion
    button: "Use the potion"
    visible-if: "potion"
    disabled-if: "v_hp_v >= v_hpmax_v"
    if: "potion"
    do:
      - object: potion
        to: inventory
        remove: true
      - "hp.+.5"
    text_ok: "You drink the potion. +5 HP!"
    text_ko: "You do not have a potion."