Invalid expression, couldn't extract another token


#1

The title error popped up when I tried to run this:

*choice
 *if (robots > 1) *hide_reuse #Use the blue stone on the remaining robots.
  *set robots2 true
  You turn towards the last two robots. You wave your left hand and the stone begins to glow. The merciless sockets of the robots immediatly glow with the same sea-blue of the gem. They turn and face you, seemingly waiting for instructions. You have a pair of awesome robot servants to command!
  *goto thechoice
 *if (gang) #Execute your gang.
  *set benevolent-25
  *if (not(robots2))
          *goto gggee

I apologise if it is something stupidly simple or summat in advance.


#2

Your indenting looks a little messed up for starters.

I just happened to be writing my own thing right now. So this is a rough example from my WIP.

# how about dealing with one that isn't stupid?"
	"YEAH!" Setsuna loudly cheers while watching before he face quickly contorts to being confused. "What?"

	"I don't know. You're trying to mess with me. Looks like I'm dealing with someone whose got to be pretty stupid."

	"...that shit talking of yours. Does it bother you to be still be using lines you thought of in kindergarten?"
	*set Gender "Female"
	*page_break
	*goto Northpointfocusromancefemale

It’s a little hard to tell with the format but take note of where *set is. It’s not on the same line of the option.
#Option
double tab Words
double tab *set
double tab *goto

#option
double tab Words.

Well, you get the idea.


#3

I believe the problem there is that you have to split *hide_reuse onto a new line:

*choice
  *if (foo)
    *hide_reuse #Text option
      Body

#4

As already said, but I think if you want to keep it on one line *selectable_if works?

And on the wiki it says

Invalid expression, couldn't extract another token
If this error occurs, it means you've used characters that don't exist in the English language. Note that most programming languages require you to only use alphanumeric characters that exist in the English language (which means if you use the "alpha" character from the greek alphabet, you'll encounter this error).

And I’m confused how this would be the case here


#5

I think putting the hide_reuse first and then the if works though.


#6

What error message you get?


My guess, the culprit is your last *goto.

*if not(robots2)
 *goto gggee

Just indent it once.

Edit:
Oh, and as others said, your *if robots > 1 should be on its own line.


#7

Thanks guys. I’ll try it out later today.


#8

If you struggle with hide_reuse (and I know I do sometimes), you could use variables instead. Like ‘myflag’ below. One advantage of using a global variable created in startup.txt is that it stays valid if you come back into the scene again. The hide_reuse acts like a temp variable and is lost when you exit the scene.

*choice
  *if ((robots > 1) and (myflag = false)) #Use the blue stone on the remaining robots.
    *set myflag true
    *set robots2 true