route that unlocks when all of the other routes are complete

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
User avatar
Seiza
Regular
Posts: 28
Joined: Sun Nov 09, 2014 4:50 am
Projects: The Cruel Fate of War
Tumblr: Cj2ymail
Location: Philippines
Contact:

route that unlocks when all of the other routes are complete

#1 Post by Seiza »

Hello, I'm new to ren'py and i've been meaning to ask,
How do you create a route that unlocks only when all of the other routes have been played?
(i.e. There are four routes, route a, b,c, and d, and route d can only be played once the player has completed routes a,b, and c)
and if possible, kindly specify the code itself? (My only programming experience involves Javascript and HTML+CSS web development so i'm not really good when it comes to the python based ren'py engine...
Thank you in advance...

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: route that unlocks when all of the other routes are comp

#2 Post by xela »

Code: Select all

if all([a, b, c]):
    # show route d option.
a, b and c can be any object that returns True when that route is in an unlocked state.
Like what we're doing? Support us at:
Image

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: route that unlocks when all of the other routes are comp

#3 Post by xavimat »

I can elaborate on xela's proposal:

Code: Select all

label start:
    $ a, b, c, d = False, False, False, False
    $ show_d = False

label end_route_a:
    $ a = True
label end_route_b:
    $ b = True
label end_route_c:
    $ c = True

# checking endings:
    if all([a, b, c]):
        $ show_d = True
You need to put this pieces of code in the correct place, not all together as in my example.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Seiza
Regular
Posts: 28
Joined: Sun Nov 09, 2014 4:50 am
Projects: The Cruel Fate of War
Tumblr: Cj2ymail
Location: Philippines
Contact:

Re: route that unlocks when all of the other routes are comp

#4 Post by Seiza »

Thank you so much! After trying the code and putting the pieces in the right place i was finally able to make the route unlock! :)

Post Reply

Who is online

Users browsing this forum: Ocelot