How do I code to remember a question?

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
sinsie
Newbie
Posts: 1
Joined: Wed Jan 10, 2018 2:05 pm
Contact:

How do I code to remember a question?

#1 Post by sinsie »

I am rather new to renpy and I have been trying to get a string of script to remember a previous choice but I can't seem to figure it out. What I am trying to accomplish is if in a previous choice a character said something and it is later remembered. I've removed my nonsense code below because I am starting to believe that I am not even in the correct ball field.

Code: Select all

menu:
    "How courteous of him to consider me.":  <---This here is the option that will give certain info I don't want repeated below
        jump nicecount
    "He has no right to treat our family like that.":
        jump meancount
   label nicecount: <--- this is where the information I don't want repeated is said
       BLOCK OF CONVERSATION HERE 
        jump contcarriagetwo
label meancount:
        BLOCK OF CONVERSATION HERE
        jump contcarriagetwo
label contcarriagetwo:
        p "What is he like father?" <--- at this question I want the father to either answer with information that was given above or give new information.
        

I hope cutting out the dialogue didn't make this too mess I just didn't think plugging in 20 lines of dialogue would help. Any ideas on how would be an efficient way to do this?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How do I code to remember a question?

#2 Post by Ocelot »

Code: Select all

$ was_nice = False
menu:
    "How courteous of him to consider me.":  <---This here is the option that will give certain info I don't want repeated below
        $ was_nice = True
        jump nicecount
    "He has no right to treat our family like that.":
        jump meancount
   label nicecount: <--- this is where the information I don't want repeated is said
       BLOCK OF CONVERSATION HERE 
        jump contcarriagetwo
label meancount:
        BLOCK OF CONVERSATION HERE
        jump contcarriagetwo
label contcarriagetwo:
        p "What is he like father?" <--- at this question I want the father to either answer with information that was given above or give new information.
        if was_nice:
            # what to say if you chose nice answer
        else:
            # What to say otherwise
        
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Bing [Bot]