Coding error with fake_choice

usually I have no problems using fake_choice, but for some reason this does not seem to function. (while in a different WIP, this code works just fine). Anyone any ideas?

*label hair
*fake_choice You reach your hand up to your...
   #Bald scalp, you have no hair, but you prefer it this way.
       *set hair_length "Bald"
       *goto eyes
   #Short pixie cut. 
       *set hair_length "Short"
   #Neck length hair.
       *set hair_length "Neck length"
   #Shoulder length hair
       *set hair_length "Shoulder length"
   #Long hair 
       *set hair_length "Long"

Are you getting a specific error in return? Did you check to make sure your hair_length variable is formatted/spelled correctly in startup?

it should be. I get the invalid choice group name: your…

Then it’s your naming of the *fake_choice command (I suspected, but I don’t use that function a lot so I’m never quite sure how it works lol.) Try this:

*label hair
You reach your hand up to your...
*fake_choice
   #Bald scalp, you have no hair, but you prefer it this way.
       *set hair_length "Bald"
       *goto eyes
   #Short pixie cut. 
       *set hair_length "Short"
   #Neck length hair.
       *set hair_length "Neck length"
   #Shoulder length hair
       *set hair_length "Shoulder length"
   #Long hair 
       *set hair_length "Long"
1 Like

I see your problem!

@rfzhao is right.

There should be nothing next to fake_choice if you want to add text before the choice, put it below your label and on top of fake choice, like this-

EDIT( tested it and it works.)

*label hair
You reach your hand up to your...
*fake_choice 
   #Bald scalp, you have no hair, but you prefer it this way.
       *set hair_length "Bald"
       *goto eyes
   #Short pixie cut. 
       *set hair_length "Short"
   #Neck length hair.
       *set hair_length "Neck length"
   #Shoulder length hair
       *set hair_length "Shoulder length"
   #Long hair 
       *set hair_length "Long"

1 Like

Remove the goto eyes as well.

Spacing and tabs keeps being a problem for me. I tried coding these two choices underneath one another. The upper one works but the one underneath gives an error, yet I tried coding them the same way. I’m not sure how to make it work.
Any tips involving spacing, I’ll gladly hear.

*label hair
You reach your hand up to your...
*choice
  #Bald scalp, you have no hair, but you prefer it this way.
    *set hair_length "Bald"
    *goto hair_colour1
  #Short pixie cut. 
    *set hair_length "Short"
    *goto hair_colour1
  #Neck length hair.
    *set hair_length "Neck length"
    *goto hair_colour1
  #Shoulder length hair
    *set hair_length "Shoulder length"
    *goto hair_colour1 
  #Long hair 
    *set hair_length "Long"
    *goto hair_colour1

*label hair_colour1
An animal looks through in the window of your little cabin. You notice your hair looks similar to it. The animal being…
*choice
  #A raven
    *set hair_colour "Black"
    *goto eyes1
  #A fox
    *set hair_colour "Ginger"
    *goto eyes1
  #A canary.
    *set hair_colour "Blonde"
    *goto eyes1
  #A silver wolf
    *set hair_colour "Silver"
    *goto eyes1
  #A deer
    *set hair_colour "Brown"
    *goto eyes1
  #A snow owl
    *set hair_colour "White"
    *goto eyes1

*label eyes1

I tried running your code and it worked fine and passed a quicktest. Can you share the specific error you received?

1 Like

Just by eyeballing it, it seems correct. The only possible error I can think of is that hair_colour wasn’t properly declared as a variable.

What’s the error? I can’t see anything obvious. In saying that, I’d be using fake choices for these rather than all the same redirects.

I don’t immediately see a mistake with my choicescript stats variables but maybe you guys see it better? I work with choicescript IDE.

*stat_chart
  text name
  text Gender
  text creature
  text Wand
  text hair_texture
  text hair_length
  text hair_colour
  text style
  text skin_colour
  text eye_colour
  text eye_shape

nothing looks wrong at a glance, though variables names are case-sensitive, so Gender and gender would be considered two different variables.

maybe you could try something like this:

*stat_chart
  text variablename Displayname

when applied should look like:

*stat_chart
  text name Name

I’ve tried to implement what you said. something still is not quite right. The error I’m getting is non-existent variable. So it must have to do with the variables.

*label hair_colour1
An animal looks through in the window of your little cabin. You notice your hair looks similar to it. The animal being…
*choice
   #A raven
     *set hair_colour1 "Black"
     *goto eyes1
   #A fox
     *set hair_colour1 "Ginger"
     *goto eyes1
   #A canary.
     *set hair_colour1 "Blonde"
     *goto eyes1
   #A silver wolf
     *set hair_colour1 "Silver"
     *goto eyes1
   #A deer
     *set hair_colour1 "Brown"
     *goto eyes1
   #A snow owl
     *set hair_colour1 "White"
     *goto eyes1
[b]My identity[/b]
*stat_chart
  text name Unknown
  text gender Female
  text creature Godfairy
  text wand Unknown
  text hair_texture Unknown
  text hair_length Unknown
  text hair_colour1 Colour
  text style Unknown
  text skin_colour Unknown
  text eye_colour Unknown
  text eye_shape Unknown

Did you make sure to create hair_colour1 in startup?

*create hair_colour1 ""

Screenshot 2023-12-27 4.52.23 PM

this was the issue, I forgot to change this variable when changing the name.
Thank you!

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