Help fixing a bug

I keep getting the message “home line 22: It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block.” but when I check the scene home at line 22 I don’t seem to be doing that.

(Starting at line 22) (note that I am using dashes “-” to denote spaces as they’re used in the original file, since it’s not formatting them correctly on this post)
#I go right, hoping she doesn’t know that I’m awake. Maybe I can avoid he
-*if resistant
–*set boldness %+5
–*goto_scene right1
–*set curiousity %+15
–*set boldness %+8
–*goto_scene right2

I am using a *goto before the end of the indented block but the error keeps coming up. Any suggestions?

Sometimes it’s the line of code above that’s causing the problem. Do you have another choice option above that one that doesn’t end in a *goto or *finish?

To properly format your code, highlight it and then click the </> preformatted text button.

Can you also copy and paste everything from the start, as opposed to starting at line 22?

Pretty sure it’s because it requires either goto or finish. You are using goto_scene which although it makes sense in your head as being the same because they are both goto, for the system they aren’t in any way related. You can easily sidestep it by having a label lead to goto_scene command
For example
*goto right1

*label right1
*goto_scene right1

Just as an FYI when you do that it’s helpful to include the commands at the bottom separately so you can keep track of your possible exit points. Also creating custom ends and beginnings or linking to your save system is easily copy and pasted this way.

Sure, so the whole file is this:

*label home

My head aches some, the dull thrumming rousing me from my unnatural sleep.
Rubbing the crust away from my eyes I pull my heavy body to sit up and look
around. The room is made in brown and green colors, the ceiling high above
my head. The sound of rain pounding against glass fills my ears, and I
notice the large panels lining one wall, going from the floor to nearly
twice my height before becoming brick.

The bed is soft. The rich texture between my fingers is fur; and I notice
that the mattress is lined with animal pelts.

It feels absolutely bizarre; the edges, the walls of the room look so clean
and modern -- glass so clear it's only noticeable by the raindrops sliding
down, brick that's clean and set in straight rows with paintings of strange
symbols hanging in a band around the room -- but everything else is rough
and rustic -- the bed lined with furs, the wooden dresser knotted and
thick, the lampshade made of thin stretched rawhide.

This is not what I had expected of Witcher's home.

When I get up there is a plush rug beneath my feet, and when I step off of
it the floorboards are smoother than they seemed from the bed and warm. The
first door I come to is open, revealing a bathroom with stone tiles and a
standing shower -- I ignore it.

Venturing to the other door I open it out into a hallway with wooden walls
and more strange paintings -- these smaller than the ones from the other
room -- spaced evenly all the way down the hall.

There are lamps throwing light in small pools going each way down the
corridor, and I wonder for a long moment which way to go; but a slight
sound to my left makes me think that Witcher might be down that way.

 #I head left to go see her.
  *if resistant
   *set boldness %+15
 #I go right, hoping she doesn't know that I'm awake. Maybe I can avoid her.
  *if resistant
   *set boldness %+5
   *goto_scene right1
   *set curiousity %+15
   *set boldness %+8
   *goto_scene right2

Thanks for the information Pyromanci; doing that seems to have fixed the
problem I was having and I’ll keep your advide in mind.

You have a problem with your first choice, I think.

 #I head left to go see her.
  *if resistant
   *set boldness %+15

There’s no elseif in there. If you don’t have the resistant stat then you’re not going to hit the finish.

There is nothing actually wrong with the way you are using *goto_scene there, it’s perfectly valid, so there’s really no need to change it.

The problem is, as @FairyGodfeather mentions, the first #Option (i.e. that *if resistant needs an *else to avoid falling out *if not resistant).

When you ‘fall out’ of a *choice statement in cases like this, the line number given in the error message is actually the one where it ends up after the error, not the line causing the error, so the ‘fall out’ is occurring somewhere above line 22 (i.e. you have no code to cover the possibility of *if not resistant).

1 Like

Thanks for the information. It will help tremendously. :slight_smile: