Problems with temp variables, help please!

I’m having trouble with using temp variables.

The error I’m getting is: “Nonexistent variable alcohol”

My code looks like this:

#“You guys got any soda?” I say.
*temp alcohol false

#I drink some beer.
*temp alcohol true

*if (alchohol) = “true”
#“Because I’m drunk?”

This is all in one text file, but they don’t seem to recognize my temp variable… help?

*temp must be used at the very top of your scene.

*temp alcohol true

#"You guys got any soda?"
  *set alcohol false

#I drink some beer.
  *comment alcohol is already true, so no need to alter this.

*if (alcohol = true)
  #"Because I'm drunk?

Also, you shouldn’t put true in quotation marks (“true”) if you’re testing for whether a variable is true or false. Quotation marks indicate strings, which are a type of variable based on text only (e.g name = “Josh”, place = “Earth”)


Also note where @edelclere put the parenthesis.

Instead of:

And although she is absolutely correct that putting your *temps at the top of your scene file is best practice, I think the reason you are getting a non-existent variable error message here is because you misspelled your variable

Emphasis added^


Even easier:

*if alcohol

I’ve sometimes had trouble with *if (variable) for conditional #options in a choice, so I’ve made it a habit to write out the full condition all the time


This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.