Adult Scenes Optional

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
NikiFig
Regular
Posts: 35
Joined: Sun Mar 20, 2016 10:31 am
Contact:

Adult Scenes Optional

#1 Post by NikiFig »

I feel as if the Cookbook is relatively inaccurate - I followed the code and got errors up the yin yang. For the new GUI update, how do I add this to preferences?

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: Adult Scenes Optional

#2 Post by SuperbowserX »

Can you make a boolean at the top of your script ("define adultmode = False"), then at the start of the game, ask the user if they want to see them, and if they reply "yes", set that variable to True?

And then, when there's an adult scene, run an if statement that shows the scene if the variable is true, and shows a watered down version if it is false?

NikiFig
Regular
Posts: 35
Joined: Sun Mar 20, 2016 10:31 am
Contact:

Re: Adult Scenes Optional

#3 Post by NikiFig »

That's what I was thinking but I'm trying to avoid directly asking the user "Hey, want porn at the end of the game?" at the beginning... It's much better to just implement a button in preferences.

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Adult Scenes Optional

#4 Post by Divona »

script.rpy

Code: Select all

define persistent.adultmode = False
screens.rpy

Code: Select all

screen preferences():

    . . .

    use game_menu(_("Preferences"), scroll="viewport"):

        vbox:

            hbox:
                box_wrap True
                xfill True

                ## Adult Switch ###############
                vbox:
                    style_prefix "radio"
                    label _("Adult Scenes")
                    textbutton _("On") action SetField(persistent, "adultmode", True)
                    textbutton _("Off") action SetField(persistent, "adultmode", False)
                ##############################

    . . .
Completed:
Image

NikiFig
Regular
Posts: 35
Joined: Sun Mar 20, 2016 10:31 am
Contact:

Re: Adult Scenes Optional

#5 Post by NikiFig »

Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users