Outils pour utilisateurs

Outils du site


en:yaml:variables

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
en:yaml:variables [2026/07/15 01:41] – maj 4.13 : modes d'interface + corrections cyrilfiestaen:yaml:variables [2026/08/31 20:56] (Version actuelle) – Wiki : fins de pages homogènes, liens Discord retirés cyrilfiesta
Ligne 83: Ligne 83:
   * ''t_name_t'' displays a text variable.   * ''t_name_t'' displays a text variable.
   * ''v_turn_v|pad2'' displays the value padded to 2 digits.   * ''v_turn_v|pad2'' displays the value padded to 2 digits.
 +
 +===== System variables =====
 +
 +^ Variable ^ Value ^
 +| ''v_resultat_v'' | Result of the last ''%=X:Y'' random draw |
 +| ''v_valeur_v'' | Last code entered through ''go room code'' |
 +| ''v_reponse_v'' | Value entered with ''reply'' |
 +| ''v_timer_name_v'' | Seconds left on the ''timer_name'' timer |
 +
 +These names stay in French, even in an English scenario: the engine reads them itself.
 +
 +===== Display formatting =====
 +
 +A numeric variable can be padded with ''|padN'':
 +
 +<code yaml>
 +text: "Turn: v_turn_v|pad2"   # shows "Turn: 07" when turn = 7
 +</code>
 +
 +===== 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: "v_score_v > v_record_o_v"
 +    do: "record_o.=.v_score_v"
 +    # 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)"
 +</code>
  
en/yaml/variables.1784072519.txt.gz · Dernière modification : de cyrilfiesta