I've read the help documentation, so I won't reiterate what it said about functions (very little). I am unable to get my test function to output a random number from 1 to 20 direclty.
Below are some attempts, and what they resulted in. I would like to know what I'm doing incorrectly.
Test 1:
typing "test1" will run this script:
Print "You rolled $d20$"
The function d20 looks like this:
change the contents of numeric variable "d20random" to "$rand(1;20)$"
it prints out this:
You rolled
Test 2:
typing test2 runs this script:
Print "You rolled $d20v2$"
The function d20 looks like this:
[other script command: "$rand(1;20)$"]
it prints out this:
You rolled
Test 3:
typing test3 runs this script:
Print You rolled $d20$ %d20random%
The function d20 looks like this:
change the contents of numeric variable "d20random" to "$rand(1;20)$"
it prints out this:
You rolled (random number appears)
I know I'm missing something vital, but the help documentation gives no clues. Running the function, and then checking a variable seems to defeat the purpose of using a function.