"Expected choice body" error

I’m having trouble with…

The error I’m getting is: line 14 of races: Expected choice body

My code looks like this:
The doc comes in with your results.
“Well you’re a perfectly healthy…”
*choice

#"...Human."
    You are defalt. Other humans will trust you, and monster people will ignore you. Perfect for those who want to go inseen.
    *finish

#"...Dhampir." A half-vampire.
   You have some of the strengths of a vampire, and a bit of their weaknesses.
   *finish

#"...Cambion." Half demon, half human. Full badass.

*goto_scene class

1 Like

It’s an indentation issue, Assuming line 14 is the choice with the human… the text underneath is too far out, tab it the same way you tab the choice for the Dhampir.

2 Likes

Also, the # options need to be indented 1 level beyond the *choice tag. It looks to me as though your # option and *choice line are at the same level.

2 Likes

Use ``` for code on the forum.

Your issues:

  1. Your indentations are all over the place. They must be consistent and intentional. Not three spaces here and four here and one here and five here. Misusing spaces is like making the wrong sounds in an English conversation – you will not be understood. The computer needs to be able to understand you.
  2. *finish ends the scene, and *goto_scene class ends the scene, but it’s unclear to me whether these will lead to the same place just based on the code sample you’ve given us. Again, consistency is your friend here: for your own sake, use the same notation to achieve the same effect. Personally, I always use *goto_scene and never *finish because I prefer specificity (even though they should have the same effect if I’ve set out my startup.txt properly).

Your code should look like this:

The doc comes in with your results. “Well you’re a perfectly healthy…”

*choice
  # "...Human."
    You are defalt. Other humans will trust you, and monster people will ignore you. Perfect for those who want to go inseen.
    *goto_scene class
  # "...Dhampir." A half-vampire.
    You have some of the strengths of a vampire, and a bit of their weaknesses.
    *goto_scene class
  # "...Cambion." Half demon, half human. Full badass.
    *goto_scene class

Some other things which are unrelated to errors or confusion with your code:

  • Make sure that you change the variable with *set. I reckon you just haven’t added that in yet, of course.
  • Watch out for typos. I counted four mistakes just in this tiny snippet of code you’ve given us:
    • "Well, you're a (comma)
    • You are default. (spelling)
    • to go unseen. (spelling)
    • a few of their weaknesses (a few for countable nouns, a bit for uncountable nouns)
5 Likes

Nice, I haven’t seen Dhampirs referenced to many times in COG games

2 Likes

I have only seen this error when I tried out implicit control flow.

Apparently all *choice options need to have something after it, be it text or command, even when you use that option.

2 Likes

Is class in the same scene or in another one? If it’s another scene then do *goto_scene class like @will did in their fix. If it’s not then make sure you label *label class and use *goto class instead.

I’m assuming it’s another scene due to your original code but just in case.

1 Like

the few/bit one is subjective, at least` in english. Few is pretty regularly used as written, and a bit of their weaknesses sounds very odd to my ear.

The original was “a bit”, my correction was “a few”. A weakness is a countable noun.