en:yaml:variables
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:variables [2026/05/03 18:47] – Harmonize FR/EN language switch cyrilfiesta | en:yaml:variables [2026/08/31 20:56] (Version actuelle) – Wiki : fins de pages homogènes, liens Discord retirés cyrilfiesta | ||
|---|---|---|---|
| Ligne 26: | Ligne 26: | ||
| Use text variables in text with '' | Use text variables in text with '' | ||
| + | |||
| + | To wait for a free-form answer, add '' | ||
| + | |||
| + | <code yaml> | ||
| + | vars: | ||
| + | guess: | ||
| + | value: 0 | ||
| + | reply: true | ||
| + | |||
| + | text_vars: | ||
| + | hero_name: | ||
| + | value: " | ||
| + | reply: true | ||
| + | </ | ||
| + | |||
| + | A numeric answer is stored without displaying the technical variable-change message. Use an event to provide the feedback intended for the player. | ||
| ===== Online Variables ===== | ===== Online Variables ===== | ||
| Ligne 67: | Ligne 83: | ||
| * '' | * '' | ||
| * '' | * '' | ||
| + | |||
| + | ===== System variables ===== | ||
| + | |||
| + | ^ Variable ^ Value ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | These names stay in French, even in an English scenario: the engine reads them itself. | ||
| + | |||
| + | ===== Display formatting ===== | ||
| + | |||
| + | A numeric variable can be padded with '' | ||
| + | |||
| + | <code yaml> | ||
| + | text: "Turn: v_turn_v|pad2" | ||
| + | </ | ||
| + | |||
| + | ===== A common trap with online variables ===== | ||
| + | |||
| + | ⚠ The text of an event is evaluated **before** the action of that same event. | ||
| + | To display the **new** value of a record, show the source variable, not the destination: | ||
| + | |||
| + | <code yaml> | ||
| + | events: | ||
| + | - if: " | ||
| + | do: " | ||
| + | # Shows v_score_v (the source), not v_record_o_v (not updated yet) | ||
| + | text: "New record: v_score_v (previous: v_record_o_v)" | ||
| + | </ | ||
| + | |||
en/yaml/variables.1777826865.txt.gz · Dernière modification : de cyrilfiesta
