So I keep getting a “not a number” error when running randomtest:
*****Seed 2
7 *choice 91#2 (line 94) #Turn the key counter-clockwise
47 *choice 77#1 (line 78) #Head in through the Great/Grand Gate
78 *choice 26#1 (line 27) #Check out the open area
112 *choice 24#3 (line 29) #You’d rather continue onward
102 *choice 22#3 (line 27) #Or maybe you could hide in one of the buildings
118 *choice 28#2 (line 31) #Search somewhere else
124 *choice 45#2 (line 48) #Take the right fork
18 *choice 34#2 (line 37) #Continue Hey, you’re almost there. Take a chance with those last few steps
73 *choice 22#3 (line 27) #One coin is HEADS, the other is TAILS
25 *choice 28#2 (line 31) #Pull the lever on the west side of the chamber
135 *choice 26#2 (line 29) #You’d rather go south instead RANDOMTEST FAILED: Error: line 29: Not a number: blah blah
The code in question:
*choice #Take the north passage
*goto_scene 65 #You’d rather go south instead //ERROR IS HERE
*goto_scene 81
It’s the most basic *choice code you can write, completely identical to hundreds of other choices in my game, so it’s driving me nuts to get this error here.
Note that if you want the player to type in a number, you should use *input_number, not *input_text. If you use *input_number, players will only be allowed to type in numbers.
*If (salt = true)
*goto_scene 52
*Else
You’re going to have to fight the slug off! Roll two dice (or just pick a random number from 2 to 12) and enter it below:
*temp roll
*input_text roll
*if (roll < 8) //ERROR CORRESPONDS HERE
*goto_scene 35
*if (roll > 7)
*goto_scene 168
That all looks correct to me, though. And it plays through fine as well within Firefox.
So for testing purposes, I removed the *input_text and set the variable to a number. Everything works now!
I guess this means randomtest doesn’t do well with user-inputted values?
Then Randomtest will give you a random number between 2 and 12. Otherwise Randomtest will set roll to blah blah which is not what you want. (Not just that; your players could type “blah blah” themselves, causing their game to break.)
BINGO! That’s the problem. Changed that and now everything is hunky dory. And that code snippet is super useful: far more accurate than just choosing a random number between 2-12.