Outils pour utilisateurs

Outils du site


en:txt: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:txt:variables [2026/07/06 00:13] – maj 4.13 : modes d'interface + corrections cyrilfiestaen:txt:variables [2026/08/31 20:48] (Version actuelle) – Wiki : fins de pages homogènes, liens Discord retirés cyrilfiesta
Ligne 1: Ligne 1:
 **Language / Langue :** [[fr:txt:variables|FR]] | **EN** **Language / Langue :** [[fr:txt:variables|FR]] | **EN**
  
-====== TXT - Variables ======+====== Variables (.txt format) ======
  
-Legacy numeric variables use the ''v_name_v'' display syntax. Text variables use ''t_name_t''. Online variables end with ''_o''.+===== Numeric variables ===== 
 + 
 +Numeric variables are declared on **line 3** of a room. Format: 
 + 
 +<code> 
 +variable_name|variable|initial_value|displayed_text|description 
 +</code> 
 + 
 +  * ''variable'' - required keyword 
 +  * ''initial_value'' - a fixed number (''=5''), a random one (''%=1:6''), or a change (''+5'', ''-3''
 +  * ''displayed_text'' - shown when the variable changes (or ''null''
 +  * ''description'' - shown when the player types ''inspect variable_name'' 
 + 
 +^ Syntax ^ Effect ^ 
 +| ''=X'' | Sets the value to X | 
 +| ''%=X:Y'' | Random value between X and Y | 
 +| ''+X'' | Adds X to the current value | 
 +| ''-X'' | Subtracts X | 
 +| ''%+X:Y'' | Adds a random amount between X and Y | 
 +| ''%-X:Y'' | Subtracts a random amount between X and Y | 
 + 
 +To display the value inside a text: ''v_variable_name_v'' 
 + 
 +===== Text variables ===== 
 + 
 +Text variables hold a word or a sentence. Keyword: ''variable_t''
 + 
 +<code> 
 +variable_name|variable_t|initial_value|change_text|description 
 +</code> 
 + 
 +To display it inside a text: ''t_variable_name_t'' 
 + 
 +The player can change the value with the ''reply value'' command, provided the variable is declared in the current room. 
 + 
 +===== Online variables ===== 
 + 
 +Online variables are **kept between games and between servers**. They are declared **after the last room** (after the final ''*****''): 
 + 
 +<code> 
 +variable_name_o|default_value|description 
 +</code> 
 + 
 +The name **must end with ''_o''**Usage is the same as for regular variables: ''v_variable_name_o_v''
 + 
 +Predefined variable: ''v_nb_parties_o_v'' - automatically increased each time the scenario starts. 
 + 
 +===== 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'' |
  
-Prefer YAML ''vars:'', ''text_vars:'' and ''online_vars:'' for new scenarios. 
en/txt/variables.1783289588.txt.gz · Dernière modification : de cyrilfiesta