Outils pour utilisateurs

Outils du site


en:variables

Différences

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

Lien vers cette vue comparative

Prochaine révision
Révision précédente
en:variables [2021/05/05 20:59]
cyrilfiesta créée
en:variables [2021/05/05 21:07] (Version actuelle)
cyrilfiesta
Ligne 29: Ligne 29:
     * "**=X**": The variable has the value X     * "**=X**": The variable has the value X
     * "**%=X:Y**" : The variable has a random value between X and Y (in our example, des_six will have a value between 1 and 6, like a classic dice)     * "**%=X:Y**" : The variable has a random value between X and Y (in our example, des_six will have a value between 1 and 6, like a classic dice)
-    **%+X:Y**": A random number between X and Y is added to the variable.+    * "**%+X:Y**": A random number between X and Y is added to the variable.
     * "**%-X:Y**": A random number between X and Y is subtracted from the variable.     * "**%-X:Y**": A random number between X and Y is subtracted from the variable.
-    **+X**": Adds X to the current value of the variable.+    * "**+X**": Adds X to the current value of the variable.
     * "**-X**": Subtracts X from the current value of the variable (it can be negative)     * "**-X**": Subtracts X from the current value of the variable (it can be negative)
   * <html><span style="color:#30B000">Sentence to be displayed.</span></html> You can display nothing (you then put "null"), and you can display the value of a variable in the sentence by surrounding it with "v_". For example "v_result_v" will display the value of the random.   * <html><span style="color:#30B000">Sentence to be displayed.</span></html> You can display nothing (you then put "null"), and you can display the value of a variable in the sentence by surrounding it with "v_". For example "v_result_v" will display the value of the random.
     * "**v_result_v**", "**v_value_v**", "**v_response_v**" are variables pre-defined by the bot.     * "**v_result_v**", "**v_value_v**", "**v_response_v**" are variables pre-defined by the bot.
-      **v_result_v**": Is equal to the result of the last **random** used (for example "**%=1.6**")+      * "**v_result_v**": Is equal to the result of the last **random** used (for example "**%=1.6**")
       * "**v_value_v**": Equals the last "code" or "bet" indicated in a command "**!advance [box] [code]**".       * "**v_value_v**": Equals the last "code" or "bet" indicated in a command "**!advance [box] [code]**".
       * "**v_response_v**": Is used with the command "**j!repondre**"       * "**v_response_v**": Is used with the command "**j!repondre**"
Ligne 55: Ligne 55:
 To display this variable in a text, you need to surround it with "**t_**" and "**_t**". For example "Nice to meet you **t_heros_name_t**" To display this variable in a text, you need to surround it with "**t_**" and "**_t**". For example "Nice to meet you **t_heros_name_t**"
  
 +It can be modified by the player using the command "**j!answer Value**" (the Value can be a word, or a sentence if it is surrounded by inverted commas). This command can only be used if the variable is declared in this room.
 +This may allow you to request a character name for example.
 +To make a textual variable non-modifiable, you just have to declare it, then automatically go to a next room with an event 997 for example.
 +
 +The scenario [[http://cyril-fiesta.fr/jdr-bot/scripts/train.txt|train.txt]] is a good example (several numerical and textual variables, including requesting and using the character's name).
 +
 +**Find us on the [[https://discord.gg/Z63DtVV|discord Make&Play]]**
en/variables.1620241148.txt.gz · Dernière modification: 2021/05/05 20:59 de cyrilfiesta