Setting eye color (basic choice structure question)

I’m trying to code my main character’s eye color in Choicescript, however, when testing it out it’s making me pick an eye color 3 different times. Can anyone help me fix this?

*fake_choice
#Your Grandfather
*set gender “male”

#Your Grandmother
    *set gender "female"
   
#Your Grandparent
    *set gender "non-binary"

*if gender = “male”
(story paragraph)

*if gender = “female”
(story paragraph)

*if gender = “non-binary”
(story paragraph)

*fake_choice
#Blue
*set eyecolor “blue”
#Green
*set eyecolor “green”
#Brown
*set eyecolor “brown”
#A Different Color…
*input_text eyecolor
*set eyecolor custom_choice

I’m new to coding so any help would be appreciated!

what is after the code you have posted as it stands nothing in the code should send you back to the eye color choice

Nothing yet, I try to test out all the code i input before I get further on with the story.

Okay try this…


*label part_one
*if gender = “male”
    (story paragraph)
    *goto part_two
*if gender = “female”
    (story paragraph)
    *goto part_two
*if gender = “non-binary”
    (story paragraph)
    *goto part_two

*label part_two
*choice
    #Blue
        *set eyecolor “blue”
        *goto part_three
    #Green
        *set eyecolor "green"
        *goto part_three
    #Brown
        *set eyecolor “brown”
        *goto part_three
    #A Different Color…
        *input_text eyecolor
        *goto part_three

*label part_three
(next scene)
*finish
1 Like

For some reason the three selections for gender don’t work, either. The one for grandfather works, but the other two don’t. the other two choices skip to the eye color choice. How can I fix that?

EDIT is there a possibility that I could show you on discord?

Okay. Let’s do this step by step.

In startup make sure you have

*create gender ""
*create eyecolor ""

Then in your first scene put the following

*label part_one
(story paragraph)
*choice
    #Your Grandfather.
        *set gender "male"
        *goto part_two
    #Your Grandmother.
        *set gender "female"
        *goto part_two
    #Your Grandparent.
        *set gender "non-binary"
        *goto part_two

*label part_two
*if (gender = “male”)
    (story paragraph)
    *goto part_three
*elseif (gender = “female”)
    (story paragraph)
    *goto part_three
*else
    (story paragraph)
    *goto part_three

*label part_three
*choice
    #Blue
        *set eyecolor “blue”
        *goto part_four
    #Green
        *set eyecolor "green"
        *goto part_four
    #Brown
        *set eyecolor “brown”
        *goto part_four
    #A Different Color…
        *input_text eyecolor
        *goto part_four

*label part_four
(next scene)
*finish
1 Like

I have your code in exactly as you put it and it’s still messing up. As I asked before, is it possible to discuss this over discord?

Sorry its 2am here and I have to go to bed. I’ll probably be able to talk tomorrow evening over discord. But I’ll let you know.

It might be more helpful if you explain the exact text of the error you are getting.

Often it is a matter of indentation, or falling out of a choice, or needing to create a variable before aetting it.

There’s a lot of helpful tutorials and topics you can lookup by searching. Someone else probably had the same error message. The search function as really helped me out a lot.

There’s also the Choicescript wiki. Maybe start with: A Basic Tutorial.

Or the commonly linked Master list for beginners.

Paste your entire code here. Use this markup code in the forum.

```
code
```

Also, I can’t think of many worse ideas than trying to publically pressure someone on the forum into speaking with you off site.

I see what the issue is The problem lies in the placement of your *fake_choice and *input_text commands. Currently, you have the eye color choices inside the first *fake_choice block, which means the player has to make a selection three times. To fix this, you need to separate the eye color choice from the gender choice.

Here’s an updated version of your code

*fake_choice
#Your Grandfather
  *set gender "male"
  *goto eye_color_choice

#Your Grandmother
  *set gender "female"
  *goto eye_color_choice
   
#Your Grandparent
  *set gender "non-binary"
  *goto eye_color_choice

*label eye_color_choice

*fake_choice
  #Blue
    *set eyecolor "blue"
    *goto story_paragraph

  #Green
    *set eyecolor "green"
    *goto story_paragraph

  #Brown
    *set eyecolor "brown"
    *goto story_paragraph

  #A Different Color…
    *input_text eyecolor
    *goto story_paragraph

*label story_paragraph

*if gender = "male"
  (story paragraph for male)

*if gender = "female"
  (story paragraph for female)

*if gender = "non-binary"
  (story paragraph for non-binary)

In this revised version, the eye color choices are placed after the gender choice, and they are enclosed in their own *fake_choice block. The *input_text command is now moved outside the *fake_choice block to allow the player to input a custom eye color if they choose the “A Different Color…” option.

I hope this helps!

You can just copy my code and I’m sure it will work, either way if it didn’t work you can give me more details about the problem, and I see if I can help.

Not with those indent mistakes.

What mistakes?

missing indents after the first fake_choice, that’s the only one I see tho

Thanks for letting me know.

1 Like