# If/else problem: he,she, him, her, honorifics not working

**URL:** <https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824>\
**Category:** ChoiceScript Help\
**Created:** [April 22, 2016, 10:14pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824 "2016-04-22T22:14:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arsue](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/arsue/32/11412_2.png) [@Arsue](https://forum.choiceofgames.com/u/Arsue)\
**Post date:** [April 22, 2016, 10:14pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/1 "2016-04-22T22:14:25Z")

</div>

Hi,  
I’m working on my first submission to Hosted and I can’t figure out the personal pronouns and honorifics.  
The player can choose whether to be male or female, and other characters will refer to the PC as either ‘Sir’ or ‘Ma’am’ and sometimes ‘Mr.’ or ‘Ms.’  
I made this string of code for that purpose:

```
*create PC_Sir ""
*create PC_Mister ""
*create PC_his ""
*create PC_him ""
*create PC_he ""
*if (Gender="Female")
  *set PC_Sir "ma'am"
  *set PC_Mister "Ms."
  *set PC_his "her"
  *set PC_he "she"
  *finish
*else
  *set PC_sir "sir"
  *set PC_Mister "Mr."
  *set PC_his "her"
  *set PC_he "she"

```

It works fine if the PC happens to be male, but when the PC is female the other characters call her ‘Mr.’ Does anyone know how to fix this? 🙂

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [April 22, 2016, 10:15pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/2 "2016-04-22T22:15:54Z")

</div>

Values are case sensitive. “female” does not equal “Female”. That’s probably the first thing to check.

---

<div class="post-metadata">

**Author:** ![Arsue](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/arsue/32/11412_2.png) [@Arsue](https://forum.choiceofgames.com/u/Arsue)\
**Post date:** [April 22, 2016, 10:17pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/3 "2016-04-22T22:17:00Z")

</div>

Okay I checked. The caps are all the same.

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [April 22, 2016, 10:18pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/4 "2016-04-22T22:18:35Z")

</div>

Can you past the whole code then? Because currently there’s no way the PC can be female with the above code.

---

<div class="post-metadata">

**Author:** ![Arsue](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/arsue/32/11412_2.png) [@Arsue](https://forum.choiceofgames.com/u/Arsue)\
**Post date:** [April 22, 2016, 10:26pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/5 "2016-04-22T22:26:55Z")

</div>

The entire code is pretty long. Can I just post the parts that have to do with this?  
This is the part of the code where the gender variable is created:  
\*create Name “”  
\*create Surname “”  
\*create Gender “”  
\*create Location “”

This is where the player chooses their gender:  
\*label gender\_pick  
\*choice  
#Mr…  
\*set Gender “Male”  
\*goto namingM

#Miss…  
\*set Gender “Female”  
\*goto namingF

#Mrs…  
\*set Gender “Female”  
\*goto namingF

And this is the part where I first use PC\_Mister and noticed it wasn’t working for female:  
\*label conspiracy  
“Tell me, !{PC\_Mister} !{Surname}, have you heard the tales about the seas you’re sailing?”

That’s all I’ve used Gender for so far. Is this enough information?

---

<div class="post-metadata">

**Author:** ![Kelvin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/kelvin/32/8950_2.png) [@Kelvin](https://forum.choiceofgames.com/u/Kelvin)\
**Post date:** [April 22, 2016, 10:27pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/6 "2016-04-22T22:27:37Z")

</div>

You probably forgot to add  
`*set Mister "Ms."`  
Under  
`*goto namingF`

Also we need you to post the code which means the part under  
`*label namingF`

---

<div class="post-metadata">

**Author:** ![Arsue](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/arsue/32/11412_2.png) [@Arsue](https://forum.choiceofgames.com/u/Arsue)\
**Post date:** [April 22, 2016, 10:39pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/7 "2016-04-22T22:39:09Z")

</div>

Okay, here’s label namingF

```
*label namingF
Your first name?
*choice
  #Rose
    *set name "Rose"
    *goto surnaming

  #Margaret
    *set Name "Margaret"
    *goto surnaming

  #Anna
    *set name "Anna"
    *goto surnaming

  #Beatrice
    *set name "Beatrice"
    *goto surnaming

  #I'd like to pick my own name...
    Of course. What is your name?
    *input_text Name
    Is that ${Name}?
    *choice
      #Yes
        *set Name "${Name}"
        *goto surnaming

      #No, that's wrong.
        Let's try again.
        *goto namingF

I tried adding
*set PC_Mister "Ms." where you said, but it still says Mr. for female PC.

*label gender_pick
*choice
  #Mr...
    *set Gender "Male"
    *goto namingM
    *set PC_Mister "Mr."
     
  #Miss...
    *set Gender "Female"
    *goto namingF
    *set PC_Mister "Ms."

  #Mrs...
    *set Gender "Female"
    *goto namingF
    *set PC_Mister "Ms."
```

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [April 22, 2016, 10:45pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/9 "2016-04-22T22:45:03Z")

</div>

1. Use consistent capitalization (preferably all lower case with regard to variable names). This usually doesn’t cause errors, but consistency across the board helps.

2. Remember that lines are run one at a time so this:

````
    *goto namingF
    *set PC_Mister "Ms."```
Will mean the third line is never run. It gets to the second, than just moves to the next label. The third line needs to be above the second.
````

---

<div class="post-metadata">

**Author:** ![Arsue](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/arsue/32/11412_2.png) [@Arsue](https://forum.choiceofgames.com/u/Arsue)\
**Post date:** [April 22, 2016, 10:51pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/10 "2016-04-22T22:51:18Z")

</div>

Okay, I think I understand. I changed the line it was on and the game is running as it should. 👌  
Thank you very much for the help!!

---

<div class="post-metadata">

**Author:** ![Kelvin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/kelvin/32/8950_2.png) [@Kelvin](https://forum.choiceofgames.com/u/Kelvin)\
**Post date:** [April 22, 2016, 10:53pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/11 "2016-04-22T22:53:21Z")

</div>

> [@RETowers](#):
>
> 1. Remember that lines are run one at a time so this:  
> \*set Gender “Female”  
> \*goto namingF  
> \*set PC\_Mister “Ms.”  
> Will mean the third line is never run. It gets to the second, than just moves to the next label. The third line needs to be above the second.

Make sure to add in all the other stats too. Take this

> [@Arsue](#):
>
> \*set PC\_Sir “ma’am”  
> \*set PC\_his “her”  
> \*set PC\_he “she”

And put it right after

\*set Mister “Ms.”

---

<div class="post-metadata">

**Author:** ![Just\_Because](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/just_because/32/8462_2.png) [@Just\_Because](https://forum.choiceofgames.com/u/Just_Because)\
**Post date:** [April 23, 2016, 12:49pm UTC](https://forum.choiceofgames.com/t/if-else-problem-he-she-him-her-honorifics-not-working/16824/12 "2016-04-23T12:49:13Z")

</div>

> [@Arsue](#):
>
> #Miss…  
> \*set Gender “Female”  
> \*goto namingF  
> \*set PC\_Mister “Ms.”
> 
> #Mrs…  
> \*set Gender “Female”  
> \*goto namingF  
> \*set PC\_Mister “Ms.”

This has nothing to do with the actual problem, but why not have PC\_mister be Mrs, if the character chooses to be Mrs.
