Making A Dating Sim

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
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Making A Dating Sim

#1 Post by RayDizzle »

I feel like I've been posting on the forums a lot lately... I am struggling quite a bit with making a dating sim but I will persist!!! So, I'm trying to make a game where you go to different places using an imagemap to talk to different people or do different interactions (a lot like the patchesis games). And all was going well but the character I'm currently coding (the first one) keeps repeating the same dialogue over and over. He says the first line of dialogue but then keeps repeating the second every time I talk to him. I think I know what the problem is I'm just unsure of how to solve it. I've used if statements to determine what he says but because the first if statement is already true, that's the one he uses instead of the one underneath which is the one I want him to say. Here's the code:

Code: Select all

label movie:
    show dylan
    menu:
        "Talk":
            if hp >= 1:
                $ hp -= 1
                if dylan_relationship == 0:
                    d "Oh hey, how's it going?"
                    menu:
                        "Err...":
                            $ alright = False
                            p "Uh....uh...um..."
                            d "You alright? You seem a little...off..."
                            jump movie
                        "Alright.":
                            $ alright = True
                            p "I'm alright. How about you?"
                            d "Yeah, I'm pretty good. Nothing spectacular but not bad either. Thanks."
                            if charisma >= 20:
                                $ dylan_relationship += 5
                            else:
                                $ dylan_relationship += 1
                            jump movie
                   

                
                elif alright == True:
                    d "Hey, it's you again! Sorry, I never caught your name before."
                    menu:
                        "Tell him your name":
                            $ chose = "name"
                            p "Oh, sorry. My name's [player_name]."
                            d "[player_name], I like that."
                            if charisma >= 20:
                                $ dylan_relationship += 5
                            else:
                                $ dylan_relationship += 1
                            jump movie
                        "Refuse to tell him":
                            p "Why should I tell you?"
                            hide dylan
                            show dylanangry
                            d "Whoa! No need to get defensive. I was just asking."
                            hide dylanangry
                            jump movie
                elif chose == "name":
                    d "What's up?"
                    menu:
                        "Nothing":
                            p "Not a lot."
                            d "That's cool."
                            jump movie
                        "Just wanna talk":
                            $ chose = "talk"
                            p "Just came by to talk."
                            d "That's cool. I'm pretty much always here so come by anytime. It's nice to have the company."
                            if charisma >= 20:
                                $ dylan_relationship += 5
                            else:
                                $ dylan_relationship += 1
                            jump movie

User avatar
Ozitiho
Regular
Posts: 90
Joined: Mon Sep 22, 2014 3:29 pm
Location: Netherlands
Contact:

Re: Making A Dating Sim

#2 Post by Ozitiho »

He repeats the second line because:
elif alright == True
Is still true. The code doesn't continue to
elif chose == "name"

To fix this, you can either change the order to check for chose == "name" first. Or you can set alright to false when chose is set to "name".

I feel like Ren'py might have a clever trick for this, but frankly I wouldn't know. Personally I'd just keep track of a number to display what scene should be shown...
if scene == 1:
Do this scene

I think this rather fits in the Renpy support forum btw... Not that it bothers me, just saying.

User avatar
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Re: Making A Dating Sim

#3 Post by RayDizzle »

Thank you so much! That helped immensely! And I'll change it over as well. 😆😆

Post Reply

Who is online

Users browsing this forum: No registered users