Page 1 of 1

How to make a route available after certain number of routes cleared

Posted: Tue Mar 30, 2021 4:50 am
by Showakun
Some people ask about how to make a route available after clearing some point in the story and it's very easy but my question is about something more difficult - how to make a route available after a certain NUMBER of routes cleared, regardless of WHAT those routes are?

Let's say we have six routes and I want one available after clearing ANY three. Now that I mention it, I am a newbie and I understand that this requires understanding and implementing the concept of what "clearing" is in first place, in other words, some manipulations with persistent data which I am not sure are my level now.

But I'd still like to know! Please give the most detailed answer possible because I think it's time for me to learn this stuff.

Thank you in advance!

Re: How to make a route available after certain number of routes cleared

Posted: Tue Mar 30, 2021 5:36 am
by Showakun
Sorry for overly bumping this, but I just remembered something: "clearing" is, of course, means that changes that were made during your first playthrough are preserved in your second, and changes that are made in first and second are preserved in third, etc. It will be a pain in the ass to test, haha. But still, tell me how to do it!

Re: How to make a route available after certain number of routes cleared

Posted: Tue Mar 30, 2021 6:40 am
by Ocelot
Well, one way to do it:

Code: Select all

init python:
    if persistent.endings is None:
        persistent.endings = set()
label start:

    menu:
        "where do you want to go?"

        "movies":
            jump movies
        "cafe":
            jump cafe
        "park":
            jump park
        "those are boring, lets just spend time together" if (len(persistent.endings) >= 2):
            jump secret
    return

label movies:
    "You went to the movies"
    if ("movies" in persistent.endings):
        "Even thought you were there before"
    $ persistent.endings.add("movies")
    return

label cafe:
    if ("cafe" in persistent.endings):
        "Even thought you were there before"
    "You went to the cafe"
    $ persistent.endings.add("cafe")
    return

label park:
    if ("park" in persistent.endings):
        "Even thought you were there before"
    "You went to the park"
    $ persistent.endings.add("park")
    return

label secret:
    "You decided to spend time in company of each other"
    $ persistent.endings.add("secret")
    return
Game will remember if you already cleared one route, and, if you cleared at least 2, unlocks fourth route.

Re: How to make a route available after certain number of routes cleared

Posted: Tue Mar 30, 2021 7:46 am
by Showakun
Thank you! That's exactly what I needed!