renpy/doc/cookbook/Making adult scenes optional

From Ren'Py

Jump to: navigation, search

When you wish to distribute your game to a wider audience than just hentai fans, why not make hentai optional? Using the following code, a "Hentai" option is added to the preferences. It defaults to False, so that your game would be teen-safe from the start.

init python:

    # Set the default value.
    if persistent.hentai is None:
        persistent.hentai = False

    # Add the pref.
    config.preferences['prefs_left'].append(
        _Preference(
            "Hentai",
            "hentai",
            [ ("Enabled", True, "True"),
              ("Disabled", False, "True") ],
            base=persistent))

Then when it comes time for a hentai scene:

if persistent.hentai:
    # Let's get it on.
else:
    # Holding hands is more than enough.
Personal tools