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?
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
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.
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.
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.
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.
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.
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?
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.
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!: