Persistent data and point based endings?

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
Boniae
Regular
Posts: 187
Joined: Fri Apr 10, 2009 4:10 pm
Completed: I want 2 be single and Forget-Me-Not
Projects: Cry Girlhood, Dakota Wanderers, Sagebrush
Organization: Rosewater Games
Tumblr: boniae
Location: Cleveland, OH
Contact:

Persistent data and point based endings?

#1 Post by Boniae »

I'm a little bit confused when it comes to persistent variables, but I need to use them so that when you beat two endings you're able to get the last "true" ending. The tricky thing is I'm not making any extra menus, instead I'm using points to arrive at endings. It's kind of confusing, but I want some of the menus to possibly have variables at the same time, but the "true" end variable will only matter when you've beaten the other endings. So here's kind of an example of what I mean...

Code: Select all

label start:
    
    $ ending1 = 0
    $ ending2 = 0
    $ trueending = 0
    # ^ does this variable need to be different...?

menu:
        "Yes.":
            # will count towards normal endings
            $ ending1 +=1
            
        "No":
            # this variable will only count if you've beaten the game
            $ trueending +=5
            # will count towards normal endings
            $ ending2 +=1
And so then at the end when I'm branching off into the routes, I want to know how to include the persistent data variable as well with the normal point values. Sorry if this is kind of confusing, I can elaborate if needed. Thanks for any help! :D

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: Persistent data and point based endings?

#2 Post by xavimat »

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)

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot], Rhapsy