đź–¤ HOW TO: Labels and Gotos đź–¤

Hey there, I’m going to talk about labels and gotos! :wave: :revolving_hearts:

A goto leads to a label that it shares the same name with. For example goto friend would lead to label friend. You can have duplicate gotos within an episode that all share the same name but you can’t have duplicate labels in an episode. This can be seen with a customization template; for example, when you’re getting your hair customized and choosing from short hair styles, all the gotos share the same name and will lead you back to one label for short hair styles. In addition, you can name your label and goto anything however label and goto names cannot contain spaces or special characters such as &. If you write label spooky house, you will get an error. You also can’t end an episode on a label.

UPDATE:

Labels can now go inside of if/elif/else statements and they can now go go inside of choices. You can stick with the old way of putting a goto in if/elif/else statements and/or choices that would lead to a label outside of them (and then you can use another goto to merge both pathways, and this that would lead to a label that it shares the same name with) if you’re used to that.

Example

if (BAD) {

goto villainbranch <—if they have chosen being bad before and have the gain/flag BAD (or whatever the gain name is), then this goto will take them to the label it shares the same name with (so goto villainbranch will lead to label villainbranch, which we know is inside the choice “I’m a villain” down below)

} elif (GOOD) {

goto herobranch<—if they have chosen being good before and have the gain/flag GOOD (or whatever the gain name is), then this goto will take them to the label it shares the same name with (so goto herobranch will lead to label herobranch, which we know is inside the choice “I’m a hero!” down below)

} else {
<—Here they may have previously been good or bad or chose another option, since they didn’t gain GOOD or BAD so in this case, they have the option to choose whether to be good or bad in this situation.
}

#else pathway continues (you are asked if you’d like to play through the hero or villain choice) So in other words, it’s your choice. See, it’s fun being neutral : D

WISE SOUL
Hi, are you a hero or a villain for this choice?

choice “I’m a hero!” {

label herobranch (people who had gain/flag GOOD and then reached goto herobranch there were lead here)

YOU
I’m a hero!

#continue

} “I’m a villain” {

label villainbranch (people who had the gain/flag BAD and then reached goto villainbranch there were lead here)

YOU
I’m a villain!

#continue

}

#Back to the main story-line

Also since labels are allowed in choices, it appears that you can include dressing games and CC template inside of choices now. In addition, they work with if/elif/else (labels go inside). When I coded it, it didn’t give me an error :blob_hearts:

*I highly suggest you go over the example.

Anyways, to continue:

A reminder that if you do get a duplicate label warning because you have two labels (let’s say label makeup) in your episode, you can fix the duplicate label by either adding something to it or re-naming it. For example, I can add a 2 to it so that it becomes label makeup2. However, remember that if you do this, you need to add a 2 to the gotos as well so that they will lead to label makeup2 (so, ONLY for the gotos that would lead to this label). If you forget to do this, then you’ll get an error saying your label doesn’t exist. If you do add a 2 to the gotos so that it becomes goto makeup2 but miss one, then what will happen is that goto makeup in your second makeup game that you labeled makeup2 will lead ALL THE WAY back to label makeup which will just mess up everything up. You don’t want that, you want a smooth flow to your story. So yeah, if you have a dressing game in your episode, and decide to use it again, you will need to change the label for the second one and make sure the gotos of the second dressing game match the new label you use as well.

The duplicate labels rule is only present per episode. If you use label fun in episode 1, you can use it again once in episode 2 and so forth.

P.S I go more into why it’s bad to duplicate labels on my thread: JemU776's Help Thread (link will automatically lead you to the post about it)

Feel free to check it out <3

Here’s a picture:

Let me know if you want me to post anything else and I hope that this helps, now I’m off to listen to MIW and other cool bands/singers xoxo :kiss:

^^

25 Likes

Thanks for checking this out guys, you all rock :tulip: :rose:

BRANDI (think_rubchin)
(Should I enter this haunted house or not?)

The ) should be there, it’s making my eye twitch lol :joy:

4 Likes

Love it Jem! Thank you! BOOKMARKED! :heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::fire::fire::fire::fire::fire::fire::fire::blush::blush::blush::blush::blush::blush:

1 Like

Jem you are a gem! :yay:
I needed this to.

2 Likes

@lanafrazer_episode and @LiyahxWrites thank u guys :nerd_face:

3 Likes

Bump :disco:

2 Likes

This is absolutely amazing! Thank youuuu!! :heart:

1 Like

Bump :100:

Bump :blob_sun:

Bump :chef:

Bump :chef: :chef:

Bump :chef:

FF: I learned how labels and gotos work after creating my own CC template :joy:

Bump :metal2: :v: :black_heart: :metal: :black_joker:

1 Like

Bump! :blob_sun:

Remember guys you cannot have a customization template inside of if/elif/else and choices. It has to be outside of them. This is because labels aren’t allowed inside of if/elif/else and choices and a CC template is full of labels.

Some examples below:

Incorrect:

NARR
Who would you like to customize?

choice
“Jem”{
#CC template for Jem
}“Brandi”{
#CC template for Brandi
}“Done”{
NARR
Very well, let’s move on!
}
#continue (incorrectly coded) story

How to fix this, correct:

label friends

NARR
Who would you like to customize?

choice
“Jem”{
goto gem
}“Brandi”{
goto flower
}“Done”{
goto finish
}

label gem
#CC template for Jem
goto friends

label flower
#CC template for Brandi
goto friends

label finish
NARR
Very well, let’s move on!
#continue (correctly coded) story

Same applies to if/elif/else.

Incorrect:

if (HERO){
#CC template for Jem
}else{
#CC template for Brandi
}

Correct:

if (HERO){
goto gem
}else{
goto flower
}

label gem
#CC template for Jem
goto storyline

label flower
#CC template for Brandi
goto storyline

label storyline
#continue story

…So yeah, just remember that labels cannot go inside of choices and if/elif/else statements but luckily gotos can!

1 Like

Bump. :penguin:

1 Like

Can also be written like:

goto label friend

The command redo exists as well.

Ex.
redo friend

The difference between a redo and a goto:

You can write a full storyline under a label.

I’d recommend this if the full story-lines are EXTREMELY different (ex. a guy love option path under one label and a girl love option path under a different label) Regardless, you’ll need a goto at the end of the storyline that takes the reader to a label it shares the same name with, so they can read through the ending credits. Forgetting to do this means the reader will read through the other path as well which is something you don’t want (a big no-no).

You can write both of the scenes under separate labels. If the story-lines for both girls are very different, then yes, I’d recommend to write the whole story-line under that label.

Ex.

#choice that decides what path you want to play as if you’re on the first episode. If episodes 2 and up, if/elif/else method can be used to lead to a path.

label no_shower
#whole story line here for girl who went to work without showering
goto end

label drunk_ok
#whole story-line here for girl who got so drunk and ends up in jail
goto end

label end
#ending credits

But if the storyline is about the same girl and based on a decision the reader picks, you can just use labels to show the actions of what they selected and then merge back to the main storyline.

#there would be coding above here, leading to the separate paths.

label no_shower
#scene for girl going to work without showering. Doesn’t take up full episode and once it’s over:

goto merge

label drunk_ok
#scene here for girl who got so drunk and ends up in jail, doesn’t take up full episode and once it’s over:

goto merge

label merge
#story-line is back to main

I believe this is what you mean, hope it’s understandable :blob_hearts:

2 Likes

Thank you! I accidentally deleted the post as I was trying to edit it :joy::two_hearts:

1 Like

:joy: haha, i love you so much :yay: :kissing_heart: :blob_hearts:

1 Like