I'm really new and need help (Expected choice body)


#1

Hi there!! I literally started using ChoiceScript last night so I’m relatively new to all this…

I’ve created a bit of a story with no real problem, however ever since I coded a gender choice I keep getting an “Expected choice body” error which in reference to the following piece of code.

*label bubble_179353800
*choice
#I am a guy. Dick and All.

    *Set gender "male"
    *set him "him"
    *set his "his"
    *set he "he"
    *set guy "guy"
    *set mr "mr"
    *set sir "sir"
    *set man "man"
    *goto bubble_179432032


#I am a women. Sans Dick and all.

    *Set gender "female"
    *set him "her"
    *set his "her"
    *set he "she"
    *set guy "lass"
    *set mr "mrs"
    *set sir "ma'm"
    *set man "woman"
    *goto bubble_179432032

Now, whenever I test the story… The Expected Choice Body error pops up at the same specific point.
I don’t really know what to do so I was wondering if someone could help.
Thank ye!! :slight_smile:
Sam


#2

After the *choice
Indent your #

E.G.

*choice
     #I like eggs
          Of course!
          *goto breakfast
     #I like pancakes
          Flap Jacky!
          *goto breakfast

#3

That appears to be an error in me copying the code over to the forum. In Notepad++ it is already indented.

Also, may I add… of all of the people to reply to my forum post, I’m so glad it is you!
I am an absolutely massive fan of your work (especially the Lost Heir franchise), and I wish to be half the writer you are in the future!


#4

@ThatGuySam If Notepad++ is giving you errors when you paste it over, you could always try pasting it to just a normal text document first and then pasting it here?

Let’s say you had your code like this, would this work for you?

*label bubble_179353800
How do you see yourself?

*choice
 #I am a guy.
  *Set gender "male"
  *set him "him"
  *set his "his"
  *set he "he"
  *set guy "guy"
  *set mr "mr"
  *set sir "sir"
  *set man "man"
  *goto bubble_179432032

 #I am a woman.
  *Set gender "female"
  *set him "her"
  *set his "her"
  *set he "she"
  *set guy "lass"
  *set mr "mrs"
  *set sir "ma'am"
  *set man "woman"
  *goto bubble_179432032

#5

If you want to post code with exact spacing/ indentation, use the </> button in the ribbon along the top of the mini-window when you post. That should maintain exactly what you have… Good luck with the game! :wink:


#6

I think I have been really stupid… I was looking at the wrong piece of code :frowning:
It says Line 324 is the mistake :\

Also, Bjorked, I am confused at which ribbon you mean :\

I’m not the most intelligent as you can tell :wink:


#7

Line 324 is messed up only because of line 320.
Line 320 has a choice, but you didn’t tell the game to do anything when the player picks that choice.
That’s why the game is telling you that it’s expecting a choice body.
Does this help?


#8

Okay, so when you start a reply to someone or a new post, there is a window that opens/ pops up in the bottom part of your screen. On that pop up is a part that says who you are sending it to. Right below that is what I call a ribbon. It’s just a sectioned-off part of that window/ pop-up.
I’ll point to it in this screenshot:


See that square that’s darker grey? That is the button I was talking about on the ribbon. :wink:
I hope that made more sense…


#9

Thank you!! I don’t know how I didn’t see that error Carlos :\ Thank you again! :slight_smile:

The error has gone, however the other option in the choice is now missing??

Thanks Bjorked, I get what you mean now :slight_smile: