Error: Invalid expression, couldn't extract another token

Hi everyone! This is my first time using choice script, since I’m switching my game from Twine, using sugarcube 2.0.

I’ve been debugging and editing my code, and usually I’ve been able to figure out what has gone wrong. However, I am stuck at this spot.

I’ve received the error expression: Invalid expression, couldn’t extract another token

The popup flags different parts of this section of code depending on which choice I make.

*choice
*if ((gender = “female”) and (c_or_t = “c”)) #A simple yellow and brown outfit that I typically wear while working. It will not draw much attention to me, but mother says it always highlighted the beauty in my face. I do, however, wear a nice pair of dark silk gloves, and keep my hair up with an oriental pin.
*set personality “plain”
*set not 1
*set marcusrelation 10
*elseif ((gender = “female”) and (c_or_t = “c”)) #A gorgeous pink ballgown that showed off my shoulders and cleavage well. The petticoats were a darker shade of peach, and the entire thing was embroidered with flowers, even the bustle is held up with them! I know all eyes are going to be on me when I step into the party!
*set personality “lavish”
*set not 3
*set marcusrelation 30
*if ((gender = “male”) and (c_or_t = “c”)) #I wear my normal, everyday clothes, like I would for work. A clean, pressed yellow blouse, a mousey brown three piece suit, a red tie, and the heavy overcoat my brother passed down to me. I freshen things up with a dab of my mother’s perfume, knowing the women of the party will love the scent.
*set personality “plain”
*set not 1
*set mariarelation 10
*if ((gender = “male”) and (c_or_t = “c”)) #Nothing but my nicest suit will do for this evening! Typically, black is worn for such an event, but I feel festive in this spring weather, so I replace my white blouse for a pink one, and slip on a grey suit to match. Not a single hair on my head is out of place, and a fresh rose is pinned to my lapel.
*set personality “lavish”
*set not 3
*set mariarelation 30
*if ((gender = “female”) and (c_or_t = “t”)) #I spend two hours working my way into one of my sister’s dresses. It’s plain and modest, but attracting attention wouldn’t be the wisest thing to do. It’s an off white, with ruffled, belled sleeves, detailed in the faintest shimmer of gold. I adorn myself with a carefully styled wig, and natural make-up that accentuates my femminine side.
*set personality “dandy”
*set not 2
*set mariarelation 20
*if ((gender = “male”) and (c_or_t = “t”)) #No need, my brother’s clothes still fit me well. They are too large, so I wear a nice pair of braces, and a loose, blue blouse to cover my frame. It takes some time, but with your help I manage to pin my hair up into a cap, and as long as I am not stared at for too long, no one will be the wiser.
*set personality “tomboy”
*set not 2
*set marcusrelation 20

From checking the wiki, the main reason is from using characters that aren’t in the English alphabet. However, I haven’t used any non-English characters in my code. Is there another reason I could be getting this error? I’m not super good at coding so shrugs I don’t really know what to do.

Hi, Please use the preformatted text to post the code so we can see it propperly.
I can’t see anything wrong with that, maybe the error is before or after the code you show us here.

1 Like

Try putting the *ifs command into their own line and indent their contents accordingly.

*choice
   *if ((gender = “female”) and (c_or_t = “c”))
      #A simple yellow and brown outfit that I typically wear while working. It will not draw much attention to me, but mother says it always highlighted the beauty in my face. I do, however, wear a nice pair of dark silk gloves, and keep my hair up with an oriental pin.
         *set personality “plain”
         *set not 1
         *set marcusrelation 10
   *elseif ((gender = “female”) and (c_or_t = “c”))
      #A gorgeous pink ballgown that showed off my shoulders and cleavage well. The petticoats were a darker shade of peach, and the entire thing was embroidered with flowers, even the bustle is held up with them! I know all eyes are going to be on me when I step into the party!
         *set personality “lavish”
         *set not 3
         *set marcusrelation 30
...

Otherwise, your double-quote seems using the typographical version. Are you writing this on word processor?

Aahhh thank you! :smiley: I had to do a mixture of your advise, changing all *elseif to *if, and add a *goto to each choice.

No, I’m using notepad++, I wasn’t exactly sure how to upload bc I’m kind of a dummy and new to coding/using forums, so I just copy pasted the code directly. Sorry!

1 Like

O, alrighty. You can use the shortcut Ctrl+Shift+C to create the markdown of Preformatted text.