en:yaml:evenements
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| en:yaml:evenements [2026/05/07 03:31] – Correction rendu syntaxe JDR-Bot dans DokuWiki cyrilfiesta | en:yaml:evenements [2026/11/04 21:35] (Version actuelle) – Documentation 4.17 : objets, evenements et mise en page verifies cyrilfiesta | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| ====== Events (YAML) ====== | ====== Events (YAML) ====== | ||
| - | Events are action blocks | + | Events are action blocks |
| ===== Base Syntax ===== | ===== Base Syntax ===== | ||
| Ligne 14: | Ligne 14: | ||
| </ | </ | ||
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| ===== Actions Available in do: ===== | ===== Actions Available in do: ===== | ||
| Ligne 26: | Ligne 26: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| + | | '' | ||
| | '' | | '' | ||
| | '' | | '' | ||
| Ligne 33: | Ligne 34: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| - | | '' | + | | '' |
| + | |||
| + | Several actions in one event: | ||
| + | |||
| + | <code yaml> | ||
| + | do: | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | </ | ||
| ===== Endings ===== | ===== Endings ===== | ||
| Ligne 46: | Ligne 56: | ||
| text: " | text: " | ||
| </ | </ | ||
| + | |||
| + | '' | ||
| ===== Redirection ===== | ===== Redirection ===== | ||
| Ligne 81: | Ligne 93: | ||
| - text: "+10 score." | - text: "+10 score." | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ===== Conditional buttons (visible-si / grise-si) ===== | ||
| + | |||
| + | <code yaml> | ||
| + | events: | ||
| + | - if: ~ | ||
| + | button: " | ||
| + | visible-if: " | ||
| + | do: " | ||
| + | text: "You attack!" | ||
| + | |||
| + | - if: ~ | ||
| + | button: "🏃 Flee" | ||
| + | disabled-if: | ||
| + | to: accueil | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | |||
| + | On Discord, buttons are frozen inside the message that was sent. Clicking 🔄 (refresh) forces a redisplay with up to date buttons. | ||
| + | |||
| + | ===== Conditional text on an event ===== | ||
| + | |||
| + | The '' | ||
| + | |||
| + | <code yaml> | ||
| + | text: | ||
| + | - if: " | ||
| + | text: "No charge left!" | ||
| + | - if: " | ||
| + | text: "🏆 Wealthy adventurer: score v_score_v!" | ||
| + | - text: " | ||
| + | </ | ||
| + | |||
| + | ===== Sequential behaviour ===== | ||
| + | |||
| + | Important: events run in order. Each one sees the values **already changed** by the previous ones. An event carrying '' | ||
| + | |||
| + | ===== Timer started by an event ===== | ||
| + | |||
| + | <code yaml> | ||
| + | events: | ||
| + | - if: ~ | ||
| + | timer: hourglass | ||
| + | duration: " | ||
| + | to: expiration_room | ||
| + | text: "The hourglass is running!" | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | |||
| + | ===== Manual command inside do: (v4.9) ===== | ||
| + | |||
| + | The '' | ||
| + | |||
| + | <code yaml> | ||
| + | do: | ||
| + | - command: "take key" | ||
| + | - command: " | ||
| + | - command: "go laboratory" | ||
| + | </ | ||
| + | |||
| + | It works with the standard commands: '' | ||
| + | |||
| + | Useful to chain a series of actions automatically, | ||
| Ligne 87: | Ligne 165: | ||
| A local event can be triggered by a tooltip or clickable element, and a '' | A local event can be triggered by a tooltip or clickable element, and a '' | ||
| - | * [[en: | + | * [[en: |
| * [[en: | * [[en: | ||
| * [[en: | * [[en: | ||
| Ligne 93: | Ligne 171: | ||
| Local events can be controlled with '' | Local events can be controlled with '' | ||
| + | ===== Manual event without a button ===== | ||
| + | |||
| + | ^ Key ^ Effect ^ | ||
| + | | '' | ||
| + | |||
| + | A choice can call this event explicitly. Its conditions, state and usage limits still apply. | ||
| + | |||
| + | <code yaml> | ||
| + | title: 'Wiki 4.17: manual' | ||
| + | rooms: | ||
| + | - id: depart | ||
| + | text: Start. | ||
| + | events: | ||
| + | - id: alerte | ||
| + | manual: true | ||
| + | text: Called only by the choice. | ||
| + | choices: | ||
| + | - command: appeler | ||
| + | button: Call | ||
| + | to: depart | ||
| + | effect: trigger_event: | ||
| + | </ | ||
| + | |||
| + | The alert text is absent on entry. The " | ||
en/yaml/evenements.1778117473.txt.gz · Dernière modification : de cyrilfiesta
