# Troubles with choosing gender code

**URL:** <https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788>\
**Category:** ChoiceScript Help\
**Tags:** tips, coder, gender\
**Created:** [January 5, 2020, 7:42pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788 "2020-01-05T19:42:01Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 7:42pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/1 "2020-01-05T19:42:01Z")

</div>

I am working on my very first story and I’ve run into what I think are very basic problems with creating gender options. The choices work, but some text shows up when it shouldn’t, and some text is not showing up when it should. Here are some little issues I would like help with:

1: The “now do tell us what your first name shall be…” is in italics, but I can’t figure out why it would be? I would like it to be regular font.  
2: When selecting to be a female, the text “You are a female” does not appear  
3: When choosing to be a female, the text “[i]You have been awarded +2% Strength for being a male.[i]” still appears  
4: When choosing to be no gender, the text “[i]You have been awarded +2% Strength for being a male.[i]” still appears.

Here is an example of my code:

What is your gender?  
\*label gender\_choice  
\*choice  
#Male  
\*set gender “male”  
\*set Strength +2  
\*goto gender\_chosen  
#Female  
\*set gender “female”  
\*set Charisma +2  
\*goto gender\_chosen  
\*hide\_reuse #I don’t consider myself either  
\*set gender “neutral”  
\*set non\_binary\_gender true  
\*goto gender\_chosen  
\*label gender\_chosen  
Wonderful!  
\*line\_break  
\*if gender = “male”  
You are a male. You flex your pecks to the chorus of “Oohs” and “Aahs” that only play inside your own head.  
\*line\_break  
[i]You have been awarded +2% Strength for being a male.[i]  
\*line\_break  
\*line\_break  
You may check all your personal stats by clicking on the “Show Stats” button.  
\*line\_break  
Now, do tell us what your first name shall be…  
\*line\_break  
\*goto choose\_name  
\*if gender = “female”  
Wonderful!  
\*line\_break  
You are a female.  
\*line\_break  
+2% Charisma for choosing to be a female.  
[i]You may check all your personal stats by clicking on the “Show Stats” button.[i]  
\*if (gender = “neutral”)  
Look at you, you sexy (but sexless) person!  
\*line\_break  
\*goto choose\_name

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [January 5, 2020, 7:45pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/2 "2020-01-05T19:45:38Z")

</div>

1. You are not properly closing the italics tag. `[i]` to open and `[/i]` to close it.

2, 3, 4 I cannot answer properly because your code is not formatted properly on this forum. You need to place your code between three ``` to preserve indentation.

```
Like this

```

 ![image](https://global.discourse-cdn.com/choiceofgames/original/3X/4/2/42b69c04e854920b4a514e171a80e9e050e025e5.png)

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 7:50pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/4 "2020-01-05T19:50:47Z")

</div>

Hopefully this is what you mean by preserving indentation?

What is your gender?  
\*label gender\_choice  
\*choice  
#Male  
\*set gender “male”  
\*set Strength +2  
\*goto gender\_chosen  
#Female  
\*set gender “female”  
\*set Charisma +2  
\*goto gender\_chosen  
\*hide\_reuse #I don’t consider myself either  
\*set gender “neutral”  
\*set non\_binary\_gender true  
\*goto gender\_chosen  
\*label gender\_chosen  
Wonderful!  
\*line\_break  
\*if gender = “male”  
‘’‘You are a male. You flex your pecks to the chorus of “Oohs” and “Aahs” that only play inside your own head.  
\*line\_break  
You have been awarded +2% Strength for being a male.  
\*line\_break  
\*line\_break  
You may check all your personal stats by clicking on the “Show Stats” button.  
\*line\_break  
Now, do tell us what your first name shall be…  
\*line\_break  
\*goto choose\_name  
\*if gender = “female”  
Wonderful!  
\*line\_break  
You are a female.  
\*line\_break  
+2% Charisma for choosing to be a female.  
[i]You may check all your personal stats by clicking on the “Show Stats” button.[i]  
\*if (gender = “neutral”)  
Look at you, you sexy (but sexless) person!  
\*line\_break  
\*goto choose\_name’’’

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 7:51pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/5 "2020-01-05T19:51:31Z")

</div>

…nope lol

Can you be more specific on how I preserve indentation?

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [January 5, 2020, 7:52pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/6 "2020-01-05T19:52:05Z")

</div>

No that is messed up and I can’t read the indentation to know when things happen, its something like this.

```
*stat_chart
  opposed_pair Rebel
    Dreamer

*choice
  #Relationships
    *goto_scene statsre

And then, on the scene stastre:
*stat_chart
  percent joshvar Joshua Falkland
 *choice
    #Stats
      *goto_scene choicescript_stats

```

Like I said previously you insert the code between the three ```.

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 7:52pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/7 "2020-01-05T19:52:32Z")

</div>

‘’’  
What is your gender?  
\*label gender\_choice  
\*choice  
#Male  
\*set gender “male”  
\*set Strength +2  
\*goto gender\_chosen  
#Female  
\*set gender “female”  
\*set Charisma +2  
\*goto gender\_chosen  
\*hide\_reuse #I don’t consider myself either  
\*set gender “neutral”  
\*set non\_binary\_gender true  
\*goto gender\_chosen  
\*label gender\_chosen  
Wonderful!  
\*line\_break  
\*if gender = “male”  
‘’‘You are a male. You flex your pecks to the chorus of “Oohs” and “Aahs” that only play inside your own head.  
\*line\_break  
You have been awarded +2% Strength for being a male.  
\*line\_break  
\*line\_break  
You may check all your personal stats by clicking on the “Show Stats” button.  
\*line\_break  
Now, do tell us what your first name shall be…  
\*line\_break  
\*goto choose\_name  
\*if gender = “female”  
Wonderful!  
\*line\_break  
You are a female.  
\*line\_break  
+2% Charisma for choosing to be a female.  
[i]You may check all your personal stats by clicking on the “Show Stats” button.[i]  
\*if (gender = “neutral”)  
Look at you, you sexy (but sexless) person!  
\*line\_break  
\*goto choose\_name  
‘’’

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 7:53pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/8 "2020-01-05T19:53:14Z")

</div>

uhhh…lol sorry newb here

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [January 5, 2020, 7:53pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/9 "2020-01-05T19:53:57Z")

</div>

Its not between quotes, its between ```. Just copy them from my post and paste and then place the code between it.

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 7:54pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/10 "2020-01-05T19:54:24Z")

</div>

````
What is your gender?
*label gender_choice
*choice
  #Male
    *set gender "male"
    *set Strength +2
    *goto gender_chosen
  #Female
    *set gender "female"
    *set Charisma +2
    *goto gender_chosen
  *hide_reuse #I don't consider myself either
    *set gender "neutral"
    *set non_binary_gender true
    *goto gender_chosen
*label gender_chosen
Wonderful!
*line_break
*if gender = "male"
  '''You are a male. You flex your pecks to the chorus of "Oohs" and "Aahs" that only play inside your own head.
*line_break
[i]You have been awarded +2% Strength for being a male.[/i]
*line_break
*line_break
[i]You may check all your personal stats by clicking on the "Show Stats" button.[/i]
*line_break
Now, do tell us what your first name shall be…
*line_break
*goto choose_name
*if gender = "female"
  Wonderful!
*line_break
  You are a female. 
*line_break
  [i]+2% Charisma for choosing to be a female.[/i]
[i]You may check all your personal stats by clicking on the "Show Stats" button.[i]
*if (gender = "neutral")
  Look at you, you sexy (but sexless) person!
*line_break
*goto choose_name
```.
````

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 7:54pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/11 "2020-01-05T19:54:33Z")

</div>

thanks, finally lol

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [January 5, 2020, 8:08pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/12 "2020-01-05T20:08:20Z")

</div>

Ok, you don’t need \*line\_break, by leaving a blank line CS will create a paragraph for you.

2 = You have a `*goto choose_name` before the female and neutral gender check. This will cause it to never reach the code below.

3 and 4 = Those messages are outside of the scope of the \*if command so they will always display (for them to be inside of the \*if command scope they need to be inside its indentation level.

Even then, you don’t have to check each gender individually after the other, have your \*if block encompass all the 3 options and then display different messages based on each condition. This also means you don’t have to repeat the “Show stats” message all the time since you can simply add it after the \*if checks are complete.

```
*label gender_choice

What is your gender?

*fake_choice
  #Male
    *set gender "male"
    *set Strength +2
  #Female
    *set gender "female"
    *set Charisma +2
  #I don't consider myself either
    *set gender "neutral"
    *set non_binary_gender true

Wonderful!

*if (gender = "male")
  You are a male. You flex your pecks to the chorus of "Oohs" and "Aahs" that only play inside your own head.

  [i]You have been awarded +2% Strength for being a male.[/i]
  *goto after_choose_gender
*elseif (gender = "female")
  You are a female.

  [i]+2% Charisma for choosing to be a female.[/i]
  *goto after_choose_gender
*else
  Look at you, you sexy (but sexless) person!
  *goto after_choose_gender
*label after_choose_gender

[i]You may check all your personal stats by clicking on the "Show Stats" button.[/i]

Now, do tell us what your first name shall be…

*goto choose_name

```

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 8:12pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/13 "2020-01-05T20:12:08Z")

</div>

Thank you, I appreciate your clear answers! Can you explain to me what fake\_choice is about? I don’t understand why it should be used.

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [January 5, 2020, 8:15pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/14 "2020-01-05T20:15:21Z")

</div>

The only difference is that with the \*fake\_choice every option you pick will simply continue the code downwards (not requiring a \*goto and \*label like the one you called gender\_chosen). Its useful when all options will simply continue down the same path.

With \*fake\_choice you wont get an error for not having a \*goto at the end of the options. This requirement still happens for \*elseif and \*else usage unless you use implicit\_control\_flow (I dont think youre using it so I added the redundant after\_choose\_gender label for that).

You can find more info about these commands on the wiki as well:

> **[ChoiceScript Wiki](https://choicescriptdev.fandom.com/wiki/ChoiceScript_Wiki)**
>
> Welcome to the ChoiceScript Wiki The wiki about ChoiceScript, a simple scripting language developed by Adam Strong-Morse and Dan Fabulich of Choice of Games LLC for writing text-based, multiple-choice games. This Wiki is a ChoiceScript Game...

---

<div class="post-metadata">

**Author:** ![Travis\_Moulton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/travis_moulton/32/89469_2.png) [@Travis\_Moulton](https://forum.choiceofgames.com/u/Travis_Moulton)\
**Post date:** [January 5, 2020, 8:16pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/15 "2020-01-05T20:16:06Z")

</div>

ok thanks

---

<div class="post-metadata">

**Author:** ![trevers17](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/trevers17/32/127415_2.png) [@trevers17](https://forum.choiceofgames.com/u/trevers17)\
**Post date:** [January 5, 2020, 9:58pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/16 "2020-01-05T21:58:26Z")

</div>

Hey! I’m glad you got an answer to your question. Please mark the comment that solved your problem with the Solution checkmark (found by clicking the ellipsis on the post in question) so that others who have a similar problem can find that solution easily. 🙂

---

<div class="post-metadata">

**Author:** ![Alice-chan](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alice-chan/32/63712_2.png) [@Alice-chan](https://forum.choiceofgames.com/u/Alice-chan)\
**Post date:** [January 5, 2020, 10:07pm UTC](https://forum.choiceofgames.com/t/troubles-with-choosing-gender-code/71788/17 "2020-01-05T22:07:59Z")

</div>

What happen to the n00b coding thread for all the basic coding problems and questions?
