# Problem with \*choice statement

**URL:** <https://forum.choiceofgames.com/t/problem-with-choice-statement/73270>\
**Category:** ChoiceScript Help\
**Tags:** coder\
**Created:** [February 2, 2020, 6:29am UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270 "2020-02-02T06:29:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Phillips](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/robert_phillips/32/110088_2.png) [@Robert\_Phillips](https://forum.choiceofgames.com/u/Robert_Phillips)\
**Post date:** [February 2, 2020, 6:29am UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/1 "2020-02-02T06:29:43Z")

</div>

So, I’m working on a game. When I ran it via browser, it was jumping unexpectedly after a choice to the end of the game (the page with restart button, etc.)

I downloaded CSIDE and put my code into it. I ran it and saw the same problem. I then stepped through it and saw that no matter which #choice I picked, it jumped to the end page when I reached the \*finish statement for that choice. I never get to the “I should see this text” line. Here is my code (note, there is a \*create gender “none” statement in the setup file):

```
*comment set gender
*choice
    #Hello, son
        *set gender "male"
        *finish
    #Hello, daughter
        *set gender "female"
        *finish
    #Hello, my child (use "they" pronouns)
        *set gender "nonbinary"
        *finish

I should see this text
...
```

---

<div class="post-metadata">

**Author:** ![Myrtle](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/myrtle/32/99678_2.png) [@Myrtle](https://forum.choiceofgames.com/u/Myrtle)\
**Post date:** [February 2, 2020, 6:34am UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/2 "2020-02-02T06:34:53Z")

</div>

No wonder! The purpose of the \*finish command is to move the game to the next scene, so if there is none, it’ll just end the game. What you’re looking for instead is a \*goto. Place a \*label before the “I should see this text” line and then have your choices end in \*goto [label name]. Or, if all the options are meant to lead to the same place, just use a \*fake\_choice instead.

---

<div class="post-metadata">

**Author:** ![Robert\_Phillips](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/robert_phillips/32/110088_2.png) [@Robert\_Phillips](https://forum.choiceofgames.com/u/Robert_Phillips)\
**Post date:** [February 2, 2020, 6:43am UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/3 "2020-02-02T06:43:58Z")

</div>

So, each choice that doesn’t move to a new scene or jump around should have a goto to a label immediately following the choice statement? I thought \*finish meant “\*finish the choice”. The example in the tutorial is not clear about that. Thanks!

---

<div class="post-metadata">

**Author:** ![Myrtle](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/myrtle/32/99678_2.png) [@Myrtle](https://forum.choiceofgames.com/u/Myrtle)\
**Post date:** [February 2, 2020, 7:16am UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/4 "2020-02-02T07:16:10Z")

</div>

That’s right (except, apparently, for the last choice option, you can skip the goto for that one?). See this example by the Choicescript devs:

```
*choice
    #Be very naughty.
        Santa refuses to give you a present.
        *goto present    
    #Be mostly nice.
        Santa gives you a present reluctantly.
        *goto present
    #Be as nice as can be.
        Santa gives you a present enthusiastically.

*label present
Inside the gift box is a video game!

```

That example, incidentally, is from a page on [implicit control flow](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042). If you activate it, you can skip the label and the goto for every choice option that doesn’t jump around or finish.

---

<div class="post-metadata">

**Author:** ![Sylveranty](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sylveranty/32/89128_2.png) [@Sylveranty](https://forum.choiceofgames.com/u/Sylveranty)\
**Post date:** [February 2, 2020, 9:06am UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/5 "2020-02-02T09:06:26Z")

</div>

You might as well use a fake\_choice instead if all the choices lead to the same outcome afterwards.

```
*comment set gender
*fake_choice
    #Hello, son
        *set gender "male"
    #Hello, daughter
        *set gender "female"
    #Hello, my child (use "they" pronouns)
        *set gender "nonbinary"

I should see this text

```

A fake\_choice does not need a \*goto command to end. It just executes the \*set commands, displays the text, then continues with whatever comes directly after the \*fake\_choice in the scene you are in.

If you want a \*choice tree to lead to different labels, then you use \*choice. If every choice continues with the same text following the choice, you can use a \*fake\_choice instead.

---

<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:** [February 2, 2020, 4:48pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/6 "2020-02-02T16:48:33Z")

</div>

Implicit control flow allows you to skip using \*goto on every single \*choice and you will never need to use \*fake\_choice. Please don’t use \*fake\_choice if you’re using ICF, it’s completely redundant.

---

<div class="post-metadata">

**Author:** ![Robert\_Phillips](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/robert_phillips/32/110088_2.png) [@Robert\_Phillips](https://forum.choiceofgames.com/u/Robert_Phillips)\
**Post date:** [February 2, 2020, 8:40pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/7 "2020-02-02T20:40:04Z")

</div>

I thought the fake\_choice only allows text for each choice – no commands like \*set allowed.

---

<div class="post-metadata">

**Author:** ![Mystic\_CRO](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/mystic_cro/32/109898_2.png) [@Mystic\_CRO](https://forum.choiceofgames.com/u/Mystic_CRO)\
**Post date:** [February 2, 2020, 9:02pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/8 "2020-02-02T21:02:43Z")

</div>

Sure it does allow. I use it a lot myself, matter of fact i almost constantly use FC instead of C.

Look.

![image](https://global.discourse-cdn.com/choiceofgames/original/3X/e/5/e5d66802734ed17d417c80cdf538acb2c4d07af5.png)

🤷‍♂️

---

<div class="post-metadata">

**Author:** ![Robert\_Phillips](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/robert_phillips/32/110088_2.png) [@Robert\_Phillips](https://forum.choiceofgames.com/u/Robert_Phillips)\
**Post date:** [February 2, 2020, 9:36pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/9 "2020-02-02T21:36:06Z")

</div>

Interesting. So the online tutorial is wrong, because it says:

> `*fake_choice` : This convenience command behaves exactly like `*choice` , but no commands are allowed in the body of the choice; thus no `*goto` / `*finish` is required.
> 
> ```choicescript
> What color do you prefer?
> 
> *fake_choice`
> #Red
> Red is the color of roses.
> #Blue
> Blue is the color of the sea.
> #Green
> Green is the color of spring.
> 
> ```

---

<div class="post-metadata">

**Author:** ![TrashyLollipops](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/trashylollipops/32/44653_2.png) [@TrashyLollipops](https://forum.choiceofgames.com/u/TrashyLollipops)\
**Post date:** [February 2, 2020, 9:42pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/10 "2020-02-02T21:42:54Z")

</div>

Might just be a CSIDE feature that allows \*fake\_choice to have commands inside. I’ve always utilized it.

---

<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:** [February 2, 2020, 10:05pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/11 "2020-02-02T22:05:17Z")

</div>

No, it’s not CSIDE. Before it was not possible to use fake\_choice for some stuff, but its since been updated, that tutorial is simply old and not taken the updated changes into account.

You can do whatever you want inside fake\_choice.

---

<div class="post-metadata">

**Author:** ![Robert\_Phillips](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/robert_phillips/32/110088_2.png) [@Robert\_Phillips](https://forum.choiceofgames.com/u/Robert_Phillips)\
**Post date:** [February 2, 2020, 10:24pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/12 "2020-02-02T22:24:28Z")

</div>

Okay, then I guess I should ask – where is the best reference for ChoiceScript? This is not the first error in the online tutorial that has caused me problems.

---

<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:** [February 2, 2020, 10:34pm UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/13 "2020-02-02T22:34:59Z")

</div>

Which one are you following? I guess the wiki would be the most updated.

> **[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:** ![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:** [February 3, 2020, 1:04am UTC](https://forum.choiceofgames.com/t/problem-with-choice-statement/73270/14 "2020-02-03T01:04:43Z")

</div>

Most, if not all, the tutorials are outdated. Your best resource is simply the wiki.
