Coding an optional Scene

Use this forum to help develop your game-making skills, and get feedback on writing, art, music, or anything else you've created that isn't attached to a game in progress.
Locked
Message
Author
User avatar
Morhighan
Miko-Class Veteran
Posts: 975
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Coding an optional Scene

#1 Post by Morhighan »

Be forewarned, I am only used to making Visual novels in the simplest of senses--a text based story that includes art and music. Therefore, my inexperience has led me to confusion. Forgive me if the question seems to simple--looking through recipes eventually had me feeling stupid.

My goal is to have a visual novel that starts with a menu at the beginning, before the story. The menu will say something along the lines of:

"This visual novel has optional adult content. Would you like to proceed with or without said content?"
And then have the choices
"With"
"Without"

Well, it's simple enough to do that menu. However, the optional content doesn't come for several chapters, at least. How do I code it so that it goes something like this? :

Choice

With: scene 1 ---> scene 2 ---> optional scene ---> blah blah blah
Without: Scene 1 ---> scene 2 ---> blahablahblah

Thank you for your help.

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: Coding an optional Scene

#2 Post by Showsni »

You'll need to store a variable to keep track of the player's choice. At the menu giving the option, do something like:

Code: Select all

"Do you want Adult Content on?"
menu:
    "Yes":
        $ adultcontent = True
        "Okay, it's on."
    "No":
        $ adultcontent = False
        "Okay, it's off."
Then when you get to an optional scene:

Code: Select all

e "Blah blah blah this is a safe scene."
if adultcontent == True:
    e "I'm naked!"
e "Safe scene again."
Or you can use labels to jump past the adult content

Code: Select all

if adultcontent == True:
    jump adultscene 1
if adultcontent == Flase:
    jump safeforminorsscene 1
Or whatever.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Coding an optional Scene

#3 Post by Jake »

For a better-integrated solution, I would look at this cookbook recipe.

If you also check the manual page on persistent data, you could set the same persistent variable in the menu at the beginning that the preference is based on, and then you give the player the opportunity to go back and change their mind post-start-of-game. You could possibly also have the initial question as a splashscreen when the game first loads rather than at the very beginning of a playthrough; with a persistent variable the value will be stored regardless of playthroughs until it's changed.
Server error: user 'Jake' not found

User avatar
Morhighan
Miko-Class Veteran
Posts: 975
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Re: Coding an optional Scene

#4 Post by Morhighan »

Thank you very much! I will be able to use these techniques.

Locked

Who is online

Users browsing this forum: No registered users