How to allow players to partially replay: My 'Main Menu' trick used in Telvoikai


#1

VERY IMPORTANT// This is extremely complicated donacode, and I highly recommend an advanced knowledge of how the code in Episode works before attempting this!

What this does:
Allows players to replay and recustomize within a chapter, before spending a pass.

What this does NOT do:
Allow players to go BACK after a pass is spent to replay an entire chapter.

This is what my main menu looks like:

While my menu does use ‘tappable overlays’ to get this look, the scene choices are not actually limited to tappables- it’s a coding trick I decided to use for this story.
To replicate without tappables, here is the gyst of what I did. I have added a # commentary in italic bold :

#This step is important- at the beginning of each chapter you need to have a reset for each of the choices as well as the ‘scenes’. This will make more sense when you look further down.

@SCENEONE =0
@SCENETWO =0
@SCENETHREE =0
@CHOICEONE =0
@CHOICETWO =0
@CHOICETHREE =0

label MAINMENU
@transition fade out in 2
INT. MAINMENU
#load your backdrop here, set your music etc.

label MAINMENUCHOICES

NARRATOR
Main menu options:
choice
“Customization.”{
#this is something I added just because I know how popular customization is in Episode.
#it also allows players to switch their gender (physically as well, to save space)

goto CUSTOMIZATION
}
“Scene One.”{
if(CUSTOMIZATION=0){
#this is a check I have in place to make sure they have been customized at least once.
NARRATOR
Please visit customization first.
@speechbubble reset
goto MAINMENUCHOICES
}elif(SCENEONE=1){
#this tells the script that scene one has been played. See commentary below for how I did this
NARRATOR
Clicking this will reset your progress in any completed scenes.
It will not affect customization.
Are you sure you wish to proceed?
choice
“Yes.”{

@SCENEONE =0
@SCENETWO =0
@SCENETHREE =0
@CHOICEONE =0
@CHOICETWO =0
@CHOICETHREE =0
#this needs to have a reset for every single choice you have available as well as resetting scenes 1-3
goto SCENEONE
}
“No!”{
@speechbubble reset
#oops didn’t mean it! back to main menu :wink:
goto MAINMENUCHOICES
}

}else{
#this is what happens if they have customized and they are ready to play scene one!
goto SCENEONE
}
}
“Scane Two.”{

if(SCENEONE=0){
#this checks to make sure they have played scene one
NARRATOR
Please complete Scene One.
@speechbubble reset
goto MAINMENUCHOICES
}elif(SCENETWO=1){
#this checks to see if they have played scene 2 already, to prevent anything from messing up
NARRATOR
Please restart from scene one to replay to avoid errors.

@speechbubble reset
goto MAINMENUCHOICES

}else{
#this is if they have played scene one and not scene two
goto SCENETWO
}
}
“Scene Three.”{
if(SCENETWO=0){
#same as above, checking for scene two and below checking for three
NARRATOR
Please complete Scene Two.
@speechbubble reset
goto MAINMENUCHOICES

}elif(SCENETHREE=1){

    NARRATOR
Please restart from scene one to replay to avoid errors.

@speechbubble reset
goto MAINMENUCHOICES
}else{
goto SCENETHREE
}
}
“NEXTCHAPTERBUTTON”{
if(SCENETHREE=0){
#this makes sure they have played scene three, again same as above
NARRATOR
Please complete Scene Three.
@speechbubble reset
goto MAINMENUCHOICES
}else{
}
goto NEXTCHAPTER
}

label CUSTOMIZATION

#for this section I added a few more tricks. For those familiar with donacode who wish to attempt this, I used character points for MALE and FEMALE. Inside the MALE I do
@ MALE =1
@ FEMALE =0
_#reverse for the female. Recalling the script later I use if(MALE=1){ _
#if that doesn’t make sense to you, best to avoid trying to allow a replay of customizations and only have it once OR only have one gender

label SCENEONE

#this is where your script for scene one goes. At the end of the chapter make sure to include a:
_@ SCENEONE =1 < no space after the @ , just avoiding tagging someone _

#now, lets say that this is the only place with a ‘choice’. THIS IS IMPORTANT… rather than actually add any gains inside the choice, the choice looks like this:

NARRATOR
What do you pick?
choice
“Option one.”{
@ CHOICEONE =1

}
“Option Two.”{
@ CHOICEONE =2
}

#^^ notice both of those reference CHOICEONE. Assigning them different values allows me to reference them later easily.

goto MAINMENU

label SCENETWO

#same as scene one- at the end make sure to include
@ SCENETWO =1
goto MAINMENU

label SCENETHREE

#You got it by now, yeah?
@ SCENETHREE =1
goto MAINMENU

label NEXTCHAPTER
@transition fade out in 2

#load your menu, etc. This is the section that checks all of the player’s choices.

    NARRATOR
Ready to read more? Great! Let's make sure the correct playthrough is saved.

choice
“Skip this, just end chapter.”{
#this allows the player to skip if they like, or if they know they only had one run so checking doesn’t matter
NARRATOR
Of course! Thank you for reading!
goto CHOICESENDINGS
}
“Yes, please! I want to be sure!”{
#this goes to check the choices and SPEND A PASS AFTER
NARRATOR
Of course! Let’s see…
}
“Oops! Go back to Main Menu, please!”{
#whoops! This is a rescue in case the player didn’t mean to choose they are ready
NARRATOR
Of course! Here you go.
goto MAINMENU
}

#this section can get LONG FAST. You’d be surprised, haha. EVERYTHING you want the script to remember for the story goes here.

if(CHOICEONE=1){

    NARRATOR

It looks like you picked Option One for choice one.
Is this correct?
choice
“Yes.”{
#the script continues
}
“No.”{
#if the player didn’t realize they had a different play, this allows them to go fix it before it’s too late.
NARRATOR
Oops! Please make sure to reset and play with the correct choices.
I will bump you to the main menu. Click |color:red|Scene One, then ‘reset all’.|
Make sure to pick the set of choices you want!
goto MAINMENU

}
}else{

    NARRATOR

It looks like you picked Option Two for choice one.
Is this correct?
choice
“Yes.”{
#the script continues
}
“No.”{
#if the player didn’t realize they had a different play, this allows them to go fix it before it’s too late.
NARRATOR
Oops! Please make sure to reset and play with the correct choices.
I will bump you to the main menu. Click |color:red|Scene One, then ‘reset all’.|
Make sure to pick the set of choices you want!
goto MAINMENU

}
}

#^^ that continues for EVERY SINGLE CHOICE for that chapter. Once they have selected “yes” to everything, OR if they skipped to the end, the below plays (invisibly, and unknown to the player):

label CHOICESENDINGS
#this is where your actual gains and affinity points etc go

if(CHOICEONE=1){
#this is if they picked option one
gain IPICKEDOPTIONONE
}else{
#…and option two
gain IPICKEDOPTIONTWO
}
NARRATOR
Looks like we are all set! Loading the next chapter now.

goto ENDTHISCHAPTER

label ENDTHISCHAPTER

@zoom reset
#all done! This needs to be THE VERY LAST THING in your chapter script

A note on GEM CHOICES- if you add gem choices do NOT use the ‘reset’ trick inside. Put the gain RIGHT INSIDE THE GEM CHOICE, or you will have some very angry people who have to spend gems multiple times.

If you have any questions or if anything isn’t clear, feel free to ask below!

And if you want to show some support or thanks feel free to give Telvoikai a try (Link on my profile.) :smiley:


Coding Story for Replayable Chapters
#2

Cool!
I’m not sure if I missed this throughout the guide, but I have a question.
If the reader goes through the choices a couple of times, how will that affect the storyline for the next episode (assuming that there will be choice remembrance codes in the next episode).


#3

Because of the way I have the choices coded nothing is permanent until after it is too late to play the chapter over. An example to help explain:
CHAPTER ONE

Player plays scenes 1-3
Choiceone =2
Choicetwo =3

They decide to replay. On selecting scene one a second time, “choiceone” and “choicetwo” are reset to 0.

Player plays scenes 1-3.
Choiceone =1
Choicetwo =3

The player decides they are happy with these choices and clicks “next chapter”.

The prompt says “choice one 1, choice two 3?”

They say “yes.”

THEN the gains and character points, etc, are applied permanently and the next chapter loads. (For example:if( choiceone =1 ){ gain BLUE})
CHAPTER TWO
“Choiceone” and “choicetwo” are reset to 0 on load.

Player plays the next chapter, but permanently had “BLUE” applied and cannot go back to chapter one to redo those choices. They COULD choose to replay chapter two a few times to see how choices from chapter one affect it before deciding which run of chapter two they are happiest with before saying “OK, LOAD THREE”

Does that help?

Eta: for example say in chapter 1 a player decides to flirt with someone, changes their mind and doesnt on a replay of 1. Clicks chapter two, and it now remembers they did NOT flirt.

In chapter two that character will act as if they did not flirt, because that play was ‘erased’ with this system. They cannot go back and add the flirt, it is now too late. They could replay chapter two a few times and see what happens if they do or dont flirt for the first time THERE…

… and so on.


#4

No, I totally get it!
What genius :ok_hand:t3::ok_hand:t3:


#5

Thanks! Hopefully people find use for it :smiley:


#6

Mind = blown!


#7

This is very useful but I have a question though


#9

Thank you for sharing all this coding! I would have a much harder time without your examples, and it gives me a template to use for experimenting and learning. Your explanations help a lot.

Would you recommend splitting the episode up into scenes (as you’ve done here) for simplicity or are they just your visual preference? From what I read here, coding-wise, it’s the same as having the reader play through the whole chapter again.

I might try to edit it so that, for example, readers wouldn’t have to replay the first or second scene over again and could just replay the third scene in a row if they so wished it. Basically, they wouldn’t have to replay the chapter in its entirety if they’re already satisfied with the choices made in the earlier scene(s). Am I just underestimating the coding that would go into that?

Really, thanks again for sharing. I’ve always loved visual novels and having a load/save feature for replayability, so it’s exciting to see that something similar can be done through clever coding. :tada:


#10

Sure what is the question?


#11

Entirely for preference. It could just be a main menu where they, say, can recustomize at will or perhaps replay a mini game for fun, or as I have included a photo album or glossary.

The scene snippets I included are primarily for anyone who likes to change clothes a lot, or if something unlocks they want to go see it again right away.

I do actually have it coded to allow players to see all three at once in “settings”. I call it “no breaks”.

And you’re welcome! :slight_smile:


#12

Oh never mid :sweat_smile: I though that you could go to each choice which could mess up the script but isn’t the tappables overlay still in betta reading which I don’t think that many people can use though


#13

The tappables are in beta, yes, but the code tutorial above actually doesn’t use them. I was only showing the main menu so people could see what I did as a reference. :slight_smile:
The code I showed above would actually show up as a regular choice. I do use ‘tappables’ in Telvoikai, yes.


#14

Ah I see :sweat_smile: Well this template you made is amazing! :smile:


#15

Oh, I’m sorry if I accidentally missed it in your example! Good to know that it’s fairly customizable and there can be flexibility in how it all looks and is replayed. Your template leaves a lot of room for author personality, and (once released) tappables will take that even further. I hope to see others utilizing it.

Love your stories, by the way. They’re so unique and inspire me to stretch what can be done through Episode script. :slight_smile:


#16

I don’t think I actually say! To add another option it would just be another choice added under the list of main menu choices with just

“Custom menu option.”{

goto CUSTOMMENUOPTION
}

If it is something they can visit repeatedly (like changing clothes in a bedroom or something), there is no need for the extra code inside the choice. Just the goto, and then in the other place make sure there is somehow a way for them to get back to the “main menu”. :slight_smile:

And thank you so much for reading my stories :smiley: <3


#17

Thank you for posting this guide!!
When reading your story I was honestly wondering how you were letting us redo an episode when it’s not possible to lose gains. This is so smart!


#18

Thank you! And yeah, the gains are permanent once loaded at the end of the chapter. During a chapter with this I actually have to reference two very different code sets (which is why I warn it is complicated)-

  • Choices made during the current chapter being read
  • Choices made before the current chapter being read

One is called out with “CHOICEONE, -TWO, .etc” and the other is actually referencing gains and permanent character counters (Ex: GAVEN =4 if flirted, etc.)

It can certainly get complicated fast!

I actually originally was inspired to come up with this because a lot of people have requested being able to replay EoR and Duemadiri and replays max out at five. I wanted some way to allow partial replays to hopefully add an extra cushion to that without affecting the story too much.


#19

Came back and skimmed this and realized I didn’t fully answer you-

To make it so they can replay just two or just three, it could be done two different ways:

  1. Just remove the restriction but make sure that inside each choice you use an = and not a + or you will have some crazy odd values when it comes to chapter end. You also may need to customize each choice if anything in scene one can alter scene two- just a double check to make sure they can’t come up with funky combinations this way. It should be ok most of the time, though. An example of what I mean:
    Scene one- Pick pick roses.
    Scene two- continues as normal
    Scene three- A comment saying “do you want an aqua vase to go with your pink roses?” And they say “Yes.”
    Player decides to replay scene one, and picks red roses. The script still remembers that they have an aqua vase with pink roses because of scene three.

The ‘next chapter’ would say: You chose red roses. You chose an aqua vase to go with your pink roses.

Hopefully that makes sense. Avoiding issues like that is why I did it the way I did- this way I don’t need to worry about it in the least.

  1. Add a restriction that limits which chapters can be replayed. Meaning- if THREE has been read, they cannot reread TWO unless they reset BOTH CHAPTERS. Then add a warning for them:

Scene One- nothing changes here
Scene Two- Add a check for 2 and 3 and warn BOTH CHAPTERS will be reset.
Scene Three- Add a check for 3 and warn choices will be reset.

With using each choice as an “=” rather than a “+”, it actually makes most resets unnecessary. The reason I still have so many checks and balances is to protect myself if I notice an error somewhere later, and to prevent odd issues like I describe in #1.


#20

No worries! :slight_smile: Thank you for the explanation and suggestions. They always help.


#21