[SOLVED] Character's distinct reaction when player choose one option n amount of times

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
AlyaTheArtist
Newbie
Posts: 2
Joined: Thu Feb 15, 2024 11:13 pm
Tumblr: alyasartblog
Contact:

[SOLVED] Character's distinct reaction when player choose one option n amount of times

#1 Post by AlyaTheArtist »

Basically what I wanted to do is to create a feature which will make a character say a unique line if player have asked them (called a specific menu option) some specific amount of times. For example:

menu annoy:
"Ask the same question again":
e 'Let me explain...'
jump annoy
"Bye":
return

When the player chooses "Ask the same question again" three times, this supposed to happen:

label stopit:
e 'Hey, stop it.'

I wanted to find a way to implement it myself, but I'm not good at wording unfortunately.
Last edited by AlyaTheArtist on Tue Mar 05, 2024 11:34 am, edited 1 time in total.

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Character's distinct reaction when player choose one option n amount of times

#2 Post by m_from_space »

AlyaTheArtist wrote: Tue Mar 05, 2024 1:21 am I wanted to find a way to implement it myself, but I'm not good at wording unfortunately.
So what's your problem? How to count in Renpy?

Code: Select all

default count_annoy = 0

label start:
    "Begin..."
    menu annoy:
        "Ask the same question again":
            if count_annoy == 2:
                jump stopit
            $ count_annoy += 1
            e "Let me explain..."
            jump annoy
        "Bye":
            pass
    return
You could of course also do it a bit more dynamic, let's say the question is about age...

Code: Select all

menu annoy:
    "How old are you?" if count_annoy == 0:
        $ count_annoy += 1
        e "Hey, you don't ask a girl that kind of question!"
        jump annoy
    "No really, what's your age?" if count_annoy == 1:
        $ count_annoy += 1
        e "Huh? Didn't I tell you that I won't tell!?"
        jump annoy
    "Oh come on now, don't be shy and tell me your age already!" if count_annoy == 2:
        e "Stop it you freak!"
        jump gameover
    "Bye":
        pass

AlyaTheArtist
Newbie
Posts: 2
Joined: Thu Feb 15, 2024 11:13 pm
Tumblr: alyasartblog
Contact:

Re: Character's distinct reaction when player choose one option n amount of times

#3 Post by AlyaTheArtist »

Thank you sm! The additional example was very interesting, too

GeraldineRushing
Newbie
Posts: 4
Joined: Mon Oct 30, 2023 4:28 am
Contact:

Re: [SOLVED] Character's distinct reaction when player choose one option n amount of times

#4 Post by GeraldineRushing »

Thanks for answering. I am a student in college. I don't like writing, and in writing, what I hate the most is coursework-writing, and sometimes to tackle it, I take help from experts at https://oxessays.com/services/coursework-writing oxessays. They are the best; if I say so, they get your work done on time and at the most affordable price.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]