Creating a simple score keeping mechanic? [SOLVED]

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
SplashyDashyBomBashi
Newbie
Posts: 4
Joined: Thu Nov 08, 2018 12:36 pm
Contact:

Creating a simple score keeping mechanic? [SOLVED]

#1 Post by SplashyDashyBomBashi »

So, I'm incredibly new at this and want to create a scenario for a dating sim where depending on your answers, your overall 'score' with a character will go up or down. So, for example, you say something they like, you get maybe +5 to their overall score. I want to try to figure this out and I know it's possible (and probably super easy and I'm asking a dumb question) but I'm afraid of screwing up my program so far. I've done it before and I really don't want it to happen again. Can anyone help me?
Last edited by SplashyDashyBomBashi on Fri Nov 09, 2018 11:20 am, edited 1 time in total.

User avatar
Enchant00
Regular
Posts: 136
Joined: Tue Jan 12, 2016 1:17 am
Contact:

Re: Creating a simple score keeping mechanic?

#2 Post by Enchant00 »

You can create a variable called SCORE and change its value depending on the choice. Should be something like this:

Code: Select all

    h " It's time for the Mega-Lottery Quiz!"
    
    $ score = 0    #This is the variable that stores your score

    menu: 
        "Question 1: What color is the sky?"

        "BLUE":
            $ score += 5

         "INDIGO":
            $ score += 3

         "Azule":
            $ score += 1

         "RED"
            $ score -= 100
BTW, you use the (-=) if you want to deduct, and (+=) if you're going to add.

SplashyDashyBomBashi
Newbie
Posts: 4
Joined: Thu Nov 08, 2018 12:36 pm
Contact:

Re: Creating a simple score keeping mechanic?

#3 Post by SplashyDashyBomBashi »

Thanks - I'll try this out! I'm not very good at this, so we'll see how I do!

User avatar
Enchant00
Regular
Posts: 136
Joined: Tue Jan 12, 2016 1:17 am
Contact:

Re: Creating a simple score keeping mechanic?

#4 Post by Enchant00 »

SplashyDashyBomBashi wrote: Fri Nov 09, 2018 11:05 am Thanks - I'll try this out! I'm not very good at this, so we'll see how I do!
Don't worry about it :lol: If you have any problems, don't hesitate to ask away.

Post Reply

Who is online

Users browsing this forum: Andredron