Version :
JDR-Bot :
Scénario basique :
Advanced Scripts :
- Use Variables :
Version :
JDR-Bot :
Scénario basique :
Advanced Scripts :
First of all, a variable is an element of the game whose value can be changed. Take for example the number of lives in an RPG: the variable could have the name “life_points” and its value 5, or life_points = 5.
You can count wounds, a number of rounds, a number of keys, etc. Anything is possible.
Now here's how to include and use a variable in the bot:
Variables are declared in the same way as objects, on the same line in a room. Ignore for now the lines in black.
Let's look at each part in detail:
Textual variables have a word or phrase as their value. They are declared/modified on the same line as classic variables, objects, states, etc., in the form :
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 train.txt is a good example (several numerical and textual variables, including requesting and using the character's name).
Find us on the discord Make&Play