Question about "If" and "goto" error message


#1

I keep getting an error message for the following code (and all similarly structured code):
*if (character=“prince”)
*goto kidnapped
The error pops up as “invalid indent, expected at least one line in ‘if’ true block”

Does this mean that every “if” statement must be followed by straight text? I have several characters that I want to link to the same response text, but I’m new to this and am not sure why the code I’m using wouldn’t work.

Suggestions/help me?


#2

Yes, you need to have some kind of text after the *if. So that means you’ll have to duplicate the responses for each *if, or segment the speech in such a way that you don’t have to duplicate much. It depends on how much response text there is. You could always *goto a new paragraph, like so:


*if character="prince"
  *goto para1
[Additional *ifs]
*label para1
[Response Text]

Or, if the response text is short, you might as well include it (this example is a fake_choice, but it works similarly to your *if code):


*fake_choice
  #Offer a handshake.
    "Hmph."
  #"Pleasure to meet you."
    "Hmph."
  #"I'm terribly sorry about dragging you out here like this."
    "Hmph."
  #"Shall we get to work?"
    "Hmph."

Does that help?


#3

Oooooooh, I was just missing the indentation after the if statement. Derp. Thank you so much for your help Saracenar!


#4

Haha, there is also that. Indentation is everything!


#5

@MetaStrategy

When you post your code in the forum use “< pre>” before it and “< /pre>” after it (without the quotation marks and spaces). That way your indentation will be preserved. Without that, the forum will always display your code without any indentation at all.

If you did it right it should appear in a yellow box.