hexfur
August 21, 2018, 5:23pm
1
So my game has a time variable
ex: Time Morning, or Time Noon, ect
but when I go to make a choice, I get the error -
Not a number: Morning
below is the code (there are several choices similar to this where it needs to be a certain time. choices where you need a certain amount of material are not having this issue)
*disable_reuse *selectable_if (((time = "Morning") or (time = "Noon")) or (time = "Evening")) #Gather
(text here)
*if (time = "Morning")
(text here)
*set (variable) +5
*set time "Noon"
*goto (label name)
1 Like
Wouldn’t it be better for the time to be numerical?
Ex:
*set time 1 (Morning)
*set time 2 (Afternoon)
1 Like
Did you *create your time variable as a number, or a string?
1 Like
Gower
August 21, 2018, 5:44pm
5
Right–check to see if you have *create time “” in your *startup file. (or whatever you want time to start as–if you want it to start as Morning, it would be *create time “Morning”)
2 Likes
hexfur
August 21, 2018, 6:59pm
6
*create time "Morning"
this is what’s in my startup file, & it’s Morning, Noon, Afternoon, Evening, or Night
1 Like
hexfur:
*set (variable) +5
Which variable are you trying to add +5 to?
1 Like
If the variable is set to “morning” you can’t +5 morning.
1 Like
hexfur
August 21, 2018, 8:10pm
9
variable is called cord1 currently, so that’s adding 5 to cord1
1 Like
hexfur
August 21, 2018, 8:15pm
10
*selectable_if (((time = "Morning") or (time = "Noon")) or (time = "Afternoon"))
(text here)
*if (time = "Morning")
(text here)
*set cord1 +5
*set time "Noon"
*goto (label name)
This is how it reads in my script. I know I can’t add +5 morning or whatever.
1 Like
Dont you use capitals inside text variables as a general rule
1 Like
hexfur
August 21, 2018, 8:40pm
12
Can I ask why? I’ve never had an issue with the capitalization in any variables before
1 Like
Szaal
August 22, 2018, 3:46am
13
Can I see the full code?
Yes, including all the texts in the brackets.
And try to include the error message, too. I need to know on which line the error occured.
TSSL
August 22, 2018, 3:54am
14
What do you for *create cord1
?
I think the capital issue is for the name of the variable, not what you have within the variable.