Quick Coding Issue


#1

You know that moment when you realize that when you said “This is a peice of cake!” you were making a complete a** of yourself? Yeah, I’m having one of those.

The Error thing says: “line 26: It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block.”

And here’s the code itself (The *finish-es are just placeholders):

You take notice of your surroundings for the first time. You're in a fairly large tent. To your left, behind the girl, is some sort of worn silver tray on wheels. Behind that is another bed-- an old cot, really-- with something or someone lying on it, wriggling about. The tray is blocking your view.
*choice
  #Sit Up.
   *if strength >=10
     Your muscles protest wearily, but you're able to lift your head up a bit before you're held back as leather straps dig into your bare chest. 
     *goto collapse
   *if strength <10
     Try as you might, your body refuses to obey, even just to lift your head.
     *label collapse
     Collapsing from the exertion, you face the girl again.
   *choice
     #"What the hell is this?"
      *set trusted -10
      *if will >=35
        Despite what she says, you able to force the words after a moment. "What the hell--"
      *if will <35
        Anger mingles with your confusion as you try to force the words, conjuring only gibberish.
      *if will <10
        You give up, though the girl seems to note your aggression.
      *if will >=10
        *choice
          #Try once more.
           *finish
     #"Please, what is happening?"
      *finish
     #Stare confusedly.
      *finish

I’ve tried everything, to no avail. any help would be greatly appreciated. And no, this is not BDSM fanfiction. It’ll be completely nonsensual in context, I swear.

Thanks again.


#2

Could you repost your code between `

code here

` tags, like that? It’s hard to tell what’s going on (and might be wrong) without the indentation.


#3

Oh, my bad. Didn’t realize I’d left out the indentation.


#4

Your indentation was all messed up in that last choice, try this:


*temp strength 10
*temp trusted 20
*temp will 40

You take notice of your surroundings for the first time. You're in a fairly large tent. To your left, behind the girl, is some sort of worn silver tray on wheels. Behind that is another bed-- an old cot, really-- with something or someone lying on it, wriggling about. The tray is blocking your view.
*choice
  #Sit Up.
   *if strength >=10
     Your muscles protest wearily, but you're able to lift your head up a bit before you're held back as leather straps dig into your bare chest. 
     *goto collapse
   *if strength < 10
     Try as you might, your body refuses to obey, even just to lift your head.
     *label collapse
     Collapsing from the exertion, you face the girl again.
   *choice
     #"What the hell is this?"
      *set trusted -10
      *if will >=35
        Despite what she says, you able to force the words after a moment. "What the hell--"
      *if will < 35
        Anger mingles with your confusion as you try to force the words, conjuring only gibberish.
      *if will < 10
        You give up, though the girl seems to note your aggression.
      *if will >=10
        *choice
          #Try once more.
           *finish
          #"Please, what is happening?"
           *finish
          #Stare confusedly.
           *finish


#5

Thanks for responding so quickly. It works except when I put

          #"Please, what is happening?"
           *finish
          #Stare confusedly.
           *finish

back on the same indent as


#"What the hell is this?"

which is what I need to do, because they’re supposed to be options of the *choice above #“What the hell is this?”. Is there any way to fix that?


#6

Sorry, I didn’t realise those options were for that choice, how’s this:


*temp strength 10
*temp trusted 20
*temp will 40

You take notice of your surroundings for the first time. You're in a fairly large tent. To your left, behind the girl, is some sort of worn silver tray on wheels. Behind that is another bed-- an old cot, really-- with something or someone lying on it, wriggling about. The tray is blocking your view.
*choice
  #Sit Up.
   *if strength >=10
     Your muscles protest wearily, but you're able to lift your head up a bit before you're held back as leather straps dig into your bare chest. 
     *goto collapse
   *if strength < 10
     Try as you might, your body refuses to obey, even just to lift your head.
     *label collapse
     Collapsing from the exertion, you face the girl again.
   *choice
     #"What the hell is this?"
      *set trusted -10
      *if will >=35
        Despite what she says, you able to force the words after a moment. "What the hell--"
      *if will < 35
        Anger mingles with your confusion as you try to force the words, conjuring only gibberish.
      *if will < 10
        You give up, though the girl seems to note your aggression.
      *if will >=10
        *choice
          #Try once more.
           *finish
     #"Please, what is happening?"
      *finish
     #Stare confusedly.
      *finish


#7

Still says

 line 26: It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block.

#8

Found a shortcut that made it work, somehow.


*comment 

You take notice of your surroundings for the first time. You're in a fairly large tent. To your left, behind the girl, is some sort of worn silver tray on wheels. Behind that is another bed-- an old cot, really-- with something or someone lying on it, wriggling about. The tray is blocking your view.
*choice
  #Sit Up.
   *if strength >=10
     Your muscles protest wearily, but you're able to lift your head up a bit before you're held back as leather straps dig into your bare chest. 
     *goto collapse
   *if strength < 10
     Try as you might, your body refuses to obey, even just to lift your head.
     *label collapse
     Collapsing from the exertion, you face the girl again.
   *choice
     #"What the hell is this?"
      *set trusted -10
      *goto angry    
     #"Please, what is happening?"
      *finish
     #Stare confusedly.
      *finish

      *label angry
      *if will >=35
        Despite what she says, you're able to force the words after a moment. "What the hell--"
       *finish
      *if will < 35
        Anger mingles with your confusion as you try to force the words, conjuring only gibberish.
      *if will < 10
        You give up, though the girl seems to note your aggression.
      *if will >=10
        *choice
          #Try once more.
           *finish 

Thanks, though. The indent thing helped me out a lot.


#9

@XAV
Oh? Sorry, I thought that worked just fine for me - I may have missed hitting copy and re-pasted the broken version.
Glad you got working anyhow, in the future if you’re ever struggling with indentation it might be worth trying to re-code the section in the IDE, as it will actually automatically indent and dedent for you, just be sure to go into the settings panel and change the tab type to spaces (if that’s what you’re using). Once you’ve fixed it you can always copy and paste it back into wherever else you’re working :slight_smile: