Invalid indent, expected at least one line in 'if' true block?

What does it mean if I get this error? (And I can’t find how to post code so it keeps it’s indents, but here it is until I find it.) This is the problem code.

        *if (favor = 0)
          #Say, "I don't want anything right now."
            *set uprising_victory true
            *set ashlander_favor true
            "As you wish. Whatever you may need, my tribe or our descendants will provide." 
            *goto home

Oh look, it kept it’s indents anyways. Good for it. :stuck_out_tongue:

It looks like you’re missing the *choice command.

I have the choice command, just further up.The problem only happens with this one specific choice, but I can post the entire thing.

      You consider the soldiers, and you make your decision. 
      *temp attack_wurm "noattack"
      *temp favor 0
      *temp attack 1
      *label 2
      *hide_reuse
      *choice
             
        *allow_reuse #Say, "Teach me what you know."
          "What would you like to learn about?"
          *choice
            #Say, "The lay of the land."
              *set favor +1
              (Geography increases)
              *set geography +10
              *line_break
              "To the south of us are the WolfLands, a sparsely settled expanse of grass, the people there being
              nomadic horse warriors, never settling in one place for long. The forest we are in is a strip running 
              along the mountains that we know as The Spine. The forest spills out into a desert wasteland of Prana.
              The spine itself runs along the continent to touch both seas." 

              "How do you know that much?" You ask, surprised.

              "Our tribe is not content with staying still. We did some exploring of our own, and bought maps from 
              the horse peoples of the south. To live ignorant is to live a sordid life."
              *if (favor = 2)
                *set uprising_victory true
                *goto home
              *else 
                *goto 2

            #Say, "Your history."
              *set favor +1
              (History increases)
              *set history +10
              *line_break
              "Very well." She says. "We are not humans." She starts. "Our tribes fled our homeworld just before it 
              got torn apart. The very fabric of our world was riddled with holes, allowing foreign magic and 
              creatures to enter with no knowledge and often by accident. Eventually, the entire plane tore itself
              to pieces, hoping to salvage what  was left. While the plane itself lives, it can no longer support 
              life. Our shamans cut a small hole into this world allowing us to escape before it happened, and many 
              others did the same. Humans know little of us, and think us mavolent spirits and demons." 
              *if (favor = 2)
                *set uprising_victory true
                *goto home
              *else 
                *goto 2

            #Say, "The nature of magic."
              *set favor +1
              (Arcana increases)
              *set arcana +10
              *line_break
              "Magic is a strange thing. Why some people can wield it, and some cannot is a mystery that may never be 
              solved. Though we may never know that, we know where magic comes from. Using magic is the act of 
              drawing
              upon another worlds essence, or aspect. Each aspect embodies something, and a mage uses that to his or 
              her advantage. Whether it be light, dark, chaos, each world is aspected."
              *if (favor = 2)
                *set uprising_victory true
                *goto home
              *else 
                *goto 2

            #Say, "The nature of machines."
              *set favor +1
              (Technology increases)
              *set technology +10
              *line_break
              "I'm sorry to say we know very little about machines. Other than what we have stumbled upon, we have 
              seen very little. Though we still make puzzle cubes." She searches through her bag and pulls out a 
              cube, it's sides all about the size of her palm. She examines your paws, then says. "With a little 
              effort, you should be able to use the puzzle cube." She hands it to you, and greatly to her surprise, 
              you swallow it. 


              "Second stomach." You say, grinning.
              *if (favor = 2)
                *set uprising_victory true
                *goto home
              *else 
                *goto 2

            #Say, "The flora and fauna of the land."
              *set favor +1
              (Nature increases)
              *set nature +10
              *line_break
              "The flora and fauna here are temperate in terms of aggressiveness and numbers. Very little here will 
              think about attacking you, and very few plants are poisonous. Though one you have to watch out for is
              a small white flower. If ingested or gets into your bloodstream, the chalky substance on the petals
              will kill even you in minutes, and there is no known cure that we or the horse nomads know of. 
              *if (favor = 2)
                *set uprising_victory true
                *goto home
              *else 
                *goto 2

        #Ask, "What was so important about the creature I killed?"
          That creature was one of our apprentice shamans, driven insane by the transition from our world
          to yours. She was a lower order of shapeshifter, a zem'ena, able to transform herself into a single
          creature at will. Even as an apprentice, she knew our practices and our hidden ways. She was able 
          to elude detection and her insanity made her ferocity unmatched. The fact that you were not one of 
          us could very well be the only reason you survived. 
          *goto 2

        *if (attack = 1)
          *allow_reuse#Say, "Help me attack the soldiers of the Wurm."
            "Before you make what could be a rash decision, let me give you insight as to what the situation is. 
            There is an uprising in progress in the northern wastelands of Prana that stretches along the 
            country. The peoples of Scoria invaded one year and seven months ago from south beyond the plains in the 
            name
            of expansion, of an empire to cover the world. Though they are conqerors, the changes they make more 
            often
            than not are more benifical to the well being of everyone. Even the deities of the conqoured are added 
            into 
            the pantheon. But some people just want bloodshed and destruction, and that is the Wurm's rallying call."


            "You can't possibly be the only one who would help me. How do you know anyone else is going to 
            help?" You say, skeptical.


           "The creature you killed was not just my burden, it was the burden of my entire tribe. We all share a part
           in my debt to you. That, and I am my tribes highest ranking shaman. They will listen to me." 


           "Are you very certain you want our help in attacking the rebels?"
           *choice
             #"Yes, i'm sure."
               *set uprising_victory false
               *set attack_wurm "true"
               *set favor +1
               *set attack 2              
               *if (favor = 2)
                 *Goto home
               *else
                 *goto 2 
            *allow_reuse#"No, I've changed my mind." 
              "Very well."
              *Goto 2



        *if (attack = 1)
          *allow_reuse#Say, "Help me attack the resisting soldiers."
            "Before you make what could be a rash decision, let me give you insight as to what the situation is. 
            There is an uprising in progress in the northern wastelands of Prana that stretches along the 
            country. The peoples of Scoria invaded one year and seven months ago from south beyond the plains in the 
            name
            of expansion, of an empire to cover the world. Though they are conqerors, the changes they make more 
            often
            than not are more benifical to the well being of everyone. Even the deities of the conqoured are added 
            into 
            the pantheon. But some people just want bloodshed and destruction, and that is the Wurm's rallying call."
                 
              
            "You can't possibly be the only one who would help me. How do you know anyone else is going to 
            help?" You say, skeptical.
                  
                 
           "The creature you killed was not just my burden, it was the burden of my entire tribe. We all share a part
           in my debt to you. That, and I am my tribes highest ranking shaman. They will listen to me." 
                     
              
           "Are you very certain you want our help in attacking the refugees?"
           *choice
             #"Yes, i'm sure."
               *set uprising_victory true
               *set attack_wurm "false"
               *set favor +1
               *set attack 2              
               *if (favor = 2)
                 *Goto home
               *else
                 *goto 2 
            *allow_reuse#"No, I've changed my mind."
              "Very well."
              *Goto 2
                  
                
        *if (favor = 0)
          #Say, "I don't want anything right now."
            *set uprising_victory true
            *set ashlander_favor true
            "As you wish. Whatever you may need, my tribe or our descendants will provide." 
            *goto home

From looking at the code I’d expect it to begin throwing tantrums from this point forth:

*if (attack = 1)
          *allow_reuse#Say, "Help me attack the soldiers of the Wurm."
            "Before you make what could be a rash decision, let me give you insight as to what the situation is. 
            There is an uprising in progress in the northern wastelands of Prana that stretches along the 
            country. The peoples of Scoria invaded one year and seven months ago from south beyond the plains in the 
            name
            of expansion, of an empire to cover the world. Though they are conqerors, the changes they make more 
            often
            than not are more benifical to the well being of everyone. Even the deities of the conqoured are added 
            into 
            the pantheon. But some people just want bloodshed and destruction, and that is the Wurm's rallying call."


            "You can't possibly be the only one who would help me. How do you know anyone else is going to 
            help?" You say, skeptical.


           "The creature you killed was not just my burden, it was the burden of my entire tribe. We all share a part
           in my debt to you. That, and I am my tribes highest ranking shaman. They will listen to me." 


           "Are you very certain you want our help in attacking the rebels?"
           *choice
             #"Yes, i'm sure."
               *set uprising_victory false
               *set attack_wurm "true"
               *set favor +1
               *set attack 2              
               *if (favor = 2)
                 *Goto home
               *else
                 *goto 2 
            *allow_reuse#"No, I've changed my mind." 
              "Very well."
              *Goto 2



        *if (attack = 1)
          *allow_reuse#Say, "Help me attack the resisting soldiers."
            "Before you make what could be a rash decision, let me give you insight as to what the situation is. 
            There is an uprising in progress in the northern wastelands of Prana that stretches along the 
            country. The peoples of Scoria invaded one year and seven months ago from south beyond the plains in the 
            name
            of expansion, of an empire to cover the world. Though they are conqerors, the changes they make more 
            often
            than not are more benifical to the well being of everyone. Even the deities of the conqoured are added 
            into 
            the pantheon. But some people just want bloodshed and destruction, and that is the Wurm's rallying call."
                 
              
            "You can't possibly be the only one who would help me. How do you know anyone else is going to 
            help?" You say, skeptical.
                  
                 
           "The creature you killed was not just my burden, it was the burden of my entire tribe. We all share a part
           in my debt to you. That, and I am my tribes highest ranking shaman. They will listen to me." 
                     
              
           "Are you very certain you want our help in attacking the refugees?"
           *choice
             #"Yes, i'm sure."
               *set uprising_victory true
               *set attack_wurm "false"
               *set favor +1
               *set attack 2              
               *if (favor = 2)
                 *Goto home
               *else
                 *goto 2 
            *allow_reuse#"No, I've changed my mind."
              "Very well."
              *Goto 2
                  
                
        *if (favor = 0)
          #Say, "I don't want anything right now."
            *set uprising_victory true
            *set ashlander_favor true
            "As you wish. Whatever you may need, my tribe or our descendants will provide." 
            *goto home

I’m honestly more surprised that part of the code actually somewhat works than that part of it doesn’t work.

1 Like

why? I don’t see anything wrong with it?

Cecilia probably spotted some things I haven’t yet, but at first glance, you’re missing some spaces.

*allow_reuse (also *selectable_if and other option modifiers) requires a space between it and the option.

Like so:
*allow_reuse #This is an option!

I think every one of those options is broken, which means any commands nested under them aren’t registering or aren’t registering correctly.

It’s probably mainly that I personally don’t code things that way. If I only want certain choices to pop up for certain stats I’d just use *selectable_if

I get a bit confused from code as complicated as this.

But going through it, plus the random test and quick test and they work fine?
Though I did just notice

          *if (favor = 2)
            *set uprising_victory true
            *goto home

breaks things unintentionally, making it impossible to have uprising_victory false if you pick them last…

I just dislike having things greyed out. I prefer to have them there, or have them gone. It wreaks a lot of the story.

Then why don’t you just do
*if (attack = 1) #Say, “Help me attack the soldiers of the Wurm.”

I haven’t tested it, but I figure it’d work in the same way as adding a *selectable_if in front of the option and you’d have to worry less about indentation.

Because I never thought of it? :stuck_out_tongue: Opps.

I’m still getting “Invalid indent, expected at least one line in ‘if’ true block” close to everywhere. What does it even mean?

That it doesn’t see any text in an *if statement.
So basically

*if
  No text

not sure how it manages that though. Probably something with indentation.

*if and *selectable_if are pretty much interchangeable (except obviously one might be invisible, the other might be greyed out.) Except for one thing - line spacing. It’s recommended to put all *if statements on their own line (I believe it’s because it can cause problems with autotesting?) while *selectable_if only works if it’s on the same line. Like so:

*selectable if (attack=1) #Say, "Help me attack the soldiers of the Wurm."

*if (attack=1)
   #Say, "Help me attack the soldiers of the Wurm."

p.s.: You don’t need spaces in equations. A small thing, but the file size adds up over time.

Are you sure that every *if statement has at least one line of code under it? Have you double-checked your indents? If so, the only thing I can think of that would break your code EVERYWHERE is if you’re using the wrong kind of text editor. Something like Word will claim it has carriage returns when the .txt doesn’t actually recognize the line breaks.

1 Like

Oh, OK. I never noticed.

Every if statement that’s causing me problems has at least a goto under it. :confused:

That’s not all the code I have, but its the only code that’s causing me problems, everything else works fine. I’m using notepad. I checked my indents over and I didn’t find anything wrong with them.

First, you have a number of extra spaces in your code, I’m not sure if it’s what causing your errors (I’m checking further ATM).

*choice
               <- This blank line should not be here
  *if (true) #Choice
    Blah
               <- Neither should this
  #Choice

Oh, I think I might see your problem…

First, you have some unnecessary line breaks that could be causing trouble. There’s one between a choice and its list of options.

Also, you have *if statements listed under options. You can nest a choice in another choice, but if you use an *if statement in an option, it causes problems with quicktest. (I am not positive, but I THINK these actually work fine if you tried to play-test them.)

If you need to use *if statements, you can put a *goto label_name under the option, and cut and paste everything you previously had under the option to after that label. The other advantage of this is that things don’t indent after a *label, so you start off your indenting again from line 1 and can nest more things without exponentially increasing your spaces.

@Reaperoa Hooray for cross-posting.

I have spaces between the end of one option and the beginning of another, but never before had a space between the *choice and it’s options, though it didn’t fix anything.

so instead of using this…

            #Say, "The flora and fauna of the land."
              *set favor +1
              (Nature increases)
              *set nature +10
              *line_break
              "The flora and fauna here are temperate in terms of aggressiveness and numbers. Very little here will 
              think about attacking you, and very few plants are poisonous. Though one you have to watch out for is
              a small white flower. If ingested or gets into your bloodstream, the chalky substance on the petals
              will kill even you in minutes, and there is no known cure that we or the horse nomads know of. 
              *if (favor = 2) and (attack = 1)
                *set uprising_victory true
                *goto home
              *elseif (favor = 2) and (attack = 2)
                *goto home
              *else 
                *goto 2

do this?

            #Say, "The flora and fauna of the land."
              *set favor +1
              (Nature increases)
              *set nature +10
              *line_break
              "The flora and fauna here are temperate in terms of aggressiveness and numbers. Very little here will 
              think about attacking you, and very few plants are poisonous. Though one you have to watch out for is
              a small white flower. If ingested or gets into your bloodstream, the chalky substance on the petals
              will kill even you in minutes, and there is no known cure that we or the horse nomads know of. 

             *goto randomnumber

*label randomnumber
*if (favor = 2) and (attack = 1)
*set uprising_victory true
*goto home
*elseif (favor = 2) and (attack = 2)
*goto home
*else
*goto 2

(but with indentation)