It was a dark and stormy night, two figures where running under the rain. Running and running, the sound of metal and soldiers could be heard in the distance.
They hid withing a cave and hid theire till their pursuers left. A fash of lighting revealed that one of them was a…
*choice
#…human male
*set fathers_race human
*finish
#…vampire male
*set fathers_race vampire
*finish
#…werewolfe male
set fathers_race Werewolfe
*finish
#…draconian male
*set fathers_race draconian
*finish
In the stats page you say agilit instead of agility. Also, sorry for not being clear. When you set a string variable, you use quotation marks. When you set a number variable, you don’t. The reason you need to use quotation marks for strings is so that the program can distinguish between when you are trying to make a variable hold the string “name” and when you are trying to make a variable hold a copy of whatever value the variable called “name” has. For instance:
*create name *set name "sdnkfjndgkjfd" *create variable *set variable name
The above code will make variable ask his friend name for a copy of what he happens to be holding at the moment. After this code is finished, variable will hold the string “sdnkfjndgkjfd”. If there is no variable called name to ask for a value from, your computer will explode (or give you an error message).
*create name *set name "sdnkfjndgkjfd" *create variable *set variable "name"
Now variable won’t ask name for his value. Instead, variable will hold a string which has an “n” as its first letter, an “a” for its second letter, an “m” for its third letter", and an “e” for its last letter. Pure coincidence that those letters in that order happen to spell out a completely unrelated variable’s name in this example. Except that there’s a command that lets you use that for something useful, but that command usually isn’t useful. I think it’s *gotoref or something.
The same issue doesn’t pop up with numbers since you can’t have a variable with a name composed only of numbers. If you say *set some_variable 123, the program doesn’t have to worry about if you mean to set some_variable to the value 123 or the value held by a variable called 123 because there cannot be a variable called 123.
Long story short, string-holding should be set with quotation marks, number-holding variables should not.
Yup, I think you got the idea for string and number variables.
A few things that need to be changed:
You have a comma before “name” in your mygame.js. The commas are supposed to go between every variable you make in the mygame.js - that’s why the ones below “name” have commas before themselves (it counts as between, and is easy to visually see and debug since all those commas are in one column). There is no variable before “name”, so it needs no comma. That is definitely causing an error message.
Sorry for being unclear about colons - I admit they are a bit confusing, possibly for no good reason. You want to use them for variables and scenes made in the mygame.js. Earlier I said to remove some, but I meant only those not in the mygame.js. I considered saying that colons are only used in the mygame.js, but that might not be true (I don’t know everything about choicescript). As far as I understand it, variables made in the mygame.js use the format: number_variable1: 2 ,string_variable1: "value" ,number_variable2: 8 ,number_variable3: -100 ,string_variable2: "yogurt"
and everything else sets them using the format: *set number_variable1 23 *set string_variable1 "cats" *set number_variable2 95 *set number_variable3 number_variable2 *set number_variable3 +5
Just to be clear, number_variable3 comes out equaling 100, since it becomes 95 and then 95 + 5, which is 100.
This isn’t causing an error message, but you forgot an asterisk for one of the *set commands in the *choice area.
Good chance this won’t solve everything, but we’re definitely making progress. You’ll be making games yet.
It was a dark and stormy night, two figures where running under the rain. Running and running, the sound of metal and soldiers could be heard in the distance.
*line_break
They hid withing a cave and hid theire till their pursuers left. A fash of lighting revealed that one of them was a…
*choice
#…human male
*set fathers_race “human”
*finish
#…vampire male
*set fathers_race “vampire”
*finish
#…werewolfe male
*set fathers_race “Werewolfe”
*finish
#…draconian male
*set fathers_race “draconian”
*finish