# Neither true nor false error

**URL:** <https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136>\
**Category:** ChoiceScript Help\
**Created:** [March 7, 2021, 3:57am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136 "2021-03-07T03:57:06Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 3:57am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/1 "2021-03-07T03:57:06Z")

</div>

I am getting this error:

line 117: Neither true nor false: woman

I don’t understand what it means. That variable doesn’t even exist in that line.

My code looks like this:

```
*choice
  *if (man) #Samuel...
    *set firstname "Samuel"
    *set nickname "Sam"
    *goto last_name

```

The second line (\*if (man), etc) is 117, the one that’s showing the error. I can include more of the code if needed, i wasn’t sure how much was relevant.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [March 7, 2021, 4:19am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/2 "2021-03-07T04:19:52Z")

</div>

I’m guessing you have this somewhere in your code?

```
*set man woman

```

---

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 4:24am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/3 "2021-03-07T04:24:14Z")

</div>

I have

```
*set man false
*set woman false 

```

at the beginning of the startup

then the gender choice a bit further down from that in the code sets one of them as true, depending on which you pick.

It was working fine earlier, then I changed something and it stopped working, but I can’t remember what I changed! But I definitely had it working at some point using that setup.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [March 7, 2021, 4:27am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/4 "2021-03-07T04:27:32Z")

</div>

Mind posting your gender setup section? I feel there’s a bit fukup around there.

---

<div class="post-metadata">

**Author:** ![cup\_half\_empty](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cup_half_empty/32/273983_2.png) [@cup\_half\_empty](https://forum.choiceofgames.com/u/cup_half_empty)\
**Post date:** [March 7, 2021, 4:28am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/5 "2021-03-07T04:28:23Z")

</div>

Print the value of variable `man` right before the choice.

```
${man} 
*page_break
*choice
   ... 

```

---

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 4:29am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/6 "2021-03-07T04:29:19Z")

</div>

no problem.

This is the relevant part of the startup:

```
*create man false
*create woman false
*create man "man"
*create firstname "firstname"
*create lastname "lastname"
*create nickname "nickname"
*create him "him"
*create his "his"
*create he "he"
*create himself "himself"
*create guy "guy"
*create sir "sir"
*create bastard "bastard"

```

and this is the actual choice-

```
*choice
  #...a woman who clearly didn't sleep well last night.
    *set woman true
    *set man "woman"
    *set him "her"
    *set his "her"
    *set he "she"
    *set himself "herself"
    *set guy "gal"
    *set sir "ma'am"
    *set bastard "bitch"
    *goto eyes
  #...a man who probably doesn't want to be awake right now.
    *set man true
    *goto eyes

```

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [March 7, 2021, 4:30am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/7 "2021-03-07T04:30:13Z")

</div>

Ah, yes. You have

```
*set man true

```

on the startup, but it gets replaced into string (text) variable.

```
*set man "woman"

```

---

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 4:30am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/8 "2021-03-07T04:30:56Z")

</div>

OH. I totally see it now. Whoops!

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [March 7, 2021, 4:32am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/9 "2021-03-07T04:32:08Z")

</div>

Alternatively, you can combine both variables into one to make it simple.

```
*set gender "man/woman"

```

Consequently, all checks afterwards will have to be longer:

```
*if gender = "man"

```

But, as always, I’m a strong proponent for a humanly-readable code.

---

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 4:33am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/10 "2021-03-07T04:33:25Z")

</div>

Sorry, can you explain the “man/woman” part? I haven’t seen that format before (I’m a noob lmao).

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [March 7, 2021, 4:34am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/11 "2021-03-07T04:34:44Z")

</div>

Oh, it’s just a text. An example. Don’t pay it too much attention.

Though, if you do, don’t actually write “man/woman”, lel. Write either, depending on your gender setup.

* * *

```
*choice
   #man
      *set gender "man"
   #woman
      *set gender "woman"
   #nb
      *set gender "nb"

```

---

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 4:36am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/12 "2021-03-07T04:36:09Z")

</div>

Ah okay, lol. Your use of “combine” plus that example made me think it was some kind of weird multi-replace. I didn’t know you could make the game actually read words like that!

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [March 7, 2021, 4:37am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/13 "2021-03-07T04:37:38Z")

</div>

> [@biarritz](#):
>
> I didn’t know you could make the game actually read words like that!

But you actually do 🤔 thonk  
Yes, you can have the game check for exact content of a text.

> [@biarritz](#):
>
> ```choicescript
> *set man "woman"
> *set him "her"
> *set his "her"
> *set he "she"
> *set himself "herself"
> *set guy "gal"
> *set sir "ma'am"
> 
> ```

---

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 4:38am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/14 "2021-03-07T04:38:45Z")

</div>

I was just going to use those for find-and-replace, lol. I learned something new today.

---

<div class="post-metadata">

**Author:** ![cup\_half\_empty](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cup_half_empty/32/273983_2.png) [@cup\_half\_empty](https://forum.choiceofgames.com/u/cup_half_empty)\
**Post date:** [March 7, 2021, 4:39am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/15 "2021-03-07T04:39:56Z")

</div>

> [@Szaal](#):
>
> I’m a strong proponent for a humanly-readable code.

I second that.

What I personally like to do is:

```choicescript
__startup.txt__
*create MALE "M" 
*create FEMALE "F" 
*create gender "" 

__somewhere_else.txt__
*choice
   # Man
      *set gender MALE
   # Woman
      *set gender FEMALE

__checking.txt__
*if (gender = MALE) 
   do something... 

```

Or something like this.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [March 7, 2021, 4:40am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/16 "2021-03-07T04:40:20Z")

</div>

Conditional checks can compare 3 types of variables: text, numeric, and true/false a.k.a. boolean.  
It’s in the wiki: [If | ChoiceScript Wiki | Fandom](https://choicescriptdev.fandom.com/wiki/If#Comparing_variables) which is part of the masterlist thread.

> [@Master List: Links for Beginners](https://forum.choiceofgames.com/t/master-list-links-for-beginners/21872):
>
> Since this gets asked a lot I thought I’d try and create a master list of links for beginners. If anyone wants to add links to the list please feel free to since I’m making this wiki format. [Start here for newcomers](https://www.choiceofgames.com/make-your-own-games/choicescript-intro/)[The Wiki](http://choicescriptdev.wikia.com)[ChoiceScript Basic Tutorial](http://choicescriptdev.wikia.com/wiki/A_Basic_Tutorial) on wiki [RETowers’ Tutorial](https://forum.choiceofgames.com/t/the-beginners-guide-to-choicescript/9866) by @RETowers[Lglasser’s Tutorial](https://forum.choiceofgames.com/t/choicescript-full-tutorial-finished/16130) by @Lglasser Dedicated ChoiceScript Development Tools You do not need to download or update ChoiceScript when using either of these tools. [Chronicler](https://forum.choiceofgames.com/t/tool-chronicler-choicescript-visual-code-editor/6811) Visual Code Editor by @Ben…

---

<div class="post-metadata">

**Author:** ![biarritz](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/biarritz/32/136761_2.png) [@biarritz](https://forum.choiceofgames.com/u/biarritz)\
**Post date:** [March 7, 2021, 4:42am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/17 "2021-03-07T04:42:24Z")

</div>

Yeah. I didn’t see that, I did check the wiki but I was just looking for the solution to the specific problem I was having, not browsing. Anyway, thanks to you both!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/choiceofgames/original/3X/e/f/efe1497a762edecdb6d569a1c4abee87508bf002.png) [@system](https://forum.choiceofgames.com/u/system)\
**Post date:** [March 8, 2021, 4:42am UTC](https://forum.choiceofgames.com/t/neither-true-nor-false-error/96136/18 "2021-03-08T04:42:29Z")

</div>

Closed on March 8, 2021, 4:42am UTC

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