Skipping the elseifs and jumping to the first label?

I’m having trouble with label and *if at the start of a new scene.

The error I’m getting is: When the player’s race is other than turian, it skups through and just starts at *turian_whatsgoingon

My code looks like this:
*label one
*page_break You begin to hear voices through the fog…
*if (race = “turian”)
*a bunch of story and exposition stuff goes here
*choice
#“What’s going on?”
*goto turian_whatsgoingon
#“Leave me alone.”
*goto turian_leavemealone
#Stay silent.
*goto turian_staysilent
*elseif (race = “quarian”)
Hey you’re a quarian and this is as far as I’ve got.
*finish
*else (race = “krogan”)
Hey you’re a krogan and this is as far as I’ve got.
*finish

*label turian_whatsgoingon
“What’s…going on?” Your voice is quiet and hoarse as it comes out, but the room is quiet enough for her to sufficiently hear you.
*line_break
*line_break
“I’m afraid the Blue Suns got us. Well, only four of us, anyway. Everyone else either died, or got away, presumably. I doubt they’d use two ships just for us.” She looks up and over her shoulder, scanning the room for a bit before turning back to you.
*choice
#“Four of us?”
*goto turian_us?
#“Blue Suns?”
*goto turian_bluesuns?

Is it definitely spelled correctly where you’ve set race earlier and in lower case?

Yep, everything is spell checked! When you actually are the turian race it goes through all the dialogue perfectly, that’s why I’m confused.

First, the *else command is being used incorrectly. I also recommend setting your race variable to a numeral instead, so there’s less room for error. Finally, instead of using multiple *finishes, just put one at the end with a label and jump to that label. This will make sure that your file always ends in the same spot every time.

*label one
*page_break You begin to hear voices through the fog…
*if (race = 1)
    *a bunch of story and exposition stuff goes here
    *choice
        #“What’s going on?”
            *goto turian_whatsgoingon
        #“Leave me alone.”
            *goto turian_leavemealone
        #Stay silent.
            *goto turian_staysilent
*elseif (race = 2)
    Hey you’re a quarian and this is as far as I’ve got.
    *goto finish
*else
    Hey you’re a krogan and this is as far as I’ve got.
    *goto finish

*label turian_whatsgoingon
“What’s…going on?” Your voice is quiet and hoarse as it comes out, but the room is quiet enough for her to sufficiently hear you.
*line_break
*line_break
“I’m afraid the Blue Suns got us. Well, only four of us, anyway. Everyone else either died, or got away, presumably. I doubt they’d use two ships just for us.” She looks up and over her shoulder, scanning the room for a bit before turning back to you.
*choice
    #“Four of us?”
        *goto turian_us?
    #“Blue Suns?”
        *goto turian_bluesuns?

*label finish
*finish
2 Likes

Still isn’t working. I adjusted for them to goto finish like you suggested (though I didn’t change the race variable because I don’t have the patience and change every instance of it lol. Here’s a screenshot, you can see how I’m indenting then.

I haven’t read the previous posts but I see your *elses are indented incorrectly. They need to be in the same level as that *if (race = "turian").

(Assuming the possible races here are Turian, Quarian and Krogan)

*if (race = "turian")
	.
	.
	.
	*choice
		#"What's going on?"
			*goto turian_whatsgoingon
		.
		.
		.
*elseif (race = "quarian")
	Hey you're a quarian...
*else
	Hey you're a krogan...

Another hint is that you don’t need two *line_breaks; if you leave a blank line it will jump a line regardless. Using double line breaks also breaks the game for screen readers.

	.
	.
	.
	"Bah, if a little hit to the head...
	*line_break
	*line_break
	"You realize [i]you're[/i] here...
	.
	.
	.

Can simply be:

	.
	.
	.
	"Bah, if a little hit to the head...

	"You realize [i]you're[/i] here...
	.
	.
	.

And it will have the same effect. This works both inside indented blocks (like the one in the example) and in blocks without indentation (like what you have in *label turan_whatsgoingon).

Also, not sure if you’re using notepad for making this, but I recommend a better text editor like Notepad++ or CSIDE. They have color coding, indentation indications and search and replace functions (would make it easier to replace the variables that @trevers17 mentioned.

2 Likes

As @GoldenSilver said, your *elses aren’t indented properly. You also can’t use two *elses - you have to use *elseif for every check you want to occur before the final *else` check.

I recommend using CSIDE to replace the variable. It has a find/replace all function that will make changing the variable a two minute process, and it also has auto indentation when typing so you don’t have to worry about incorrect indentations.

1 Like

Ok so, maybe it’s a problem with what I’m running it on. I just downloaded CSIDE (which is amazing I never knew this existed thank you so much) and it works perfectly there. When I playtest it on dashingdon then it doesn’t work.

1 Like

Are you sure the files in dashingdon are updated? Maybe try CTRL+F5 to reload the page while inside the game, it may have cached old files.

While playing the game on dashingdon you can also add “/scenes/” to the current URL to see the files in your game. Check there if they are correctly updated.

1 Like

Yeah everything’s been updated (multiple times) and I cleared the cache so I really have no idea why it’s doing that.

Can you post the link for the game so we can take a look?

Sure! Here’s the link for it.
https://dashingdon.com/go/4556

It loooks like your files have not updated yet. Maybe try removing them completely from dashingdon and reuploading them?

1 Like

Oh yeah, well that would do it. The file it shows on my computer doesn’t even have the *elses in there at all no matter how many times I reupload the .txt file. How would I remove those files entirely? Is it possible without deleting the entire game?

Dunno then. You might have to ask in the dashingdon thread; I remember a friend having a similar issue to yours.

If your files are named the same, they should overwrite automatically.

They are named the same, which is why it’s weird…ah well, the only reason I was using dashingdon was because I couldn’t playtest it after the whole firefox update, but CSIDE certainly fixed that problem for me. The only thing I need to work out with that is getting the images to work, but otherwise it’s all good.

1 Like

Try force-clean refresh your browser (Shift + F5, or Ctrl + Shift + R). It probably still using the cached data.

Yep! here’s the update about the text part:
I ended up just changing the beginning entirely because all the text between everything was screwing up the indents and…welp, indents are really important turns out

So to get the working version all I did was move all the exposition to a new label and replaced it with this, works on dashingdon and CSIDE!:

1 Like

From what I remember, for images to work in dashingdon they all need to be in the main folder.

1 Like