Renpy became buggy?

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.
Message
Author
User avatar
kuzai
Regular
Posts: 85
Joined: Sat May 12, 2012 8:15 pm
Projects: Custom Lover, PuppyShipping DWH, Yu-Gi-Oh!: Chat
Location: Canada
Contact:

Re: Renpy became buggy?

#16 Post by kuzai »

philat wrote:Okay, so this is unsolicited (perhaps) advice, but I would say the real issue here is that the code is way, way too repetitive, bordering on impossible to debug unless it's a labor of real, burning passion. Anyone else, they take one look, their eyes glaze over, and nobody can read it. Pull out common elements (like hiding screens or adding points, etc.), and don't repeat them. Using parameters with screens is also a good choice, although rejiggering that would require more knowledge of how the whole thing is going to work so I'm not going to attempt it. (At the very least, however, having five different affinity screens seems like madness. Just have one affinity screen and use parameters.)

That said, the basic symptom is as others have pointed out -- it's very likely that you're calling a screen somewhere that isn't returning to the main flow of the script. Where the error is, I can't tell at this point.

As such, I would recommend that you just bypass the issue entirely -- return from the screen instead of jumping, then jump using the returned value. Below is a basic skeleton for what the script would look like in such a structure.
Alright I edited as you stated but now I'm getting an error traceback about the call expression saying "Could not find label 'None'."

I don't understand this
I forgive and forget. Because I have a good heart and terrible memory

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Renpy became buggy?

#17 Post by philat »

Oh, probably because I moved the call hidechars bit between returning the variable from the screen and calling the label. Stick a $ jumplabel = _return (or any other variable name you're comfortable with) after calling the screen and change call expression _return to call expression jumplabel.

User avatar
kuzai
Regular
Posts: 85
Joined: Sat May 12, 2012 8:15 pm
Projects: Custom Lover, PuppyShipping DWH, Yu-Gi-Oh!: Chat
Location: Canada
Contact:

Re: Renpy became buggy?

#18 Post by kuzai »

philat wrote:Oh, probably because I moved the call hidechars bit between returning the variable from the screen and calling the label. Stick a $ jumplabel = _return (or any other variable name you're comfortable with) after calling the screen and change call expression _return to call expression jumplabel.
Ahh not sure I follow, you mean like this?

Code: Select all

label repoptions:
    
    if chosen_option < 2:
        call screen repchatopt 

        $ jumplabel = _return
       
        $ chosen_option += 1
        call hidechars 
        call expression _jumplabel
        
        jump repoptions
I'm sure I did this wrong because I get a "jumplabel not defined" error, I'm sorry, I'm a kinda literal person when seeing examples
I forgive and forget. Because I have a good heart and terrible memory

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: Renpy became buggy?

#19 Post by xavimat »

You have "call expression _jumplabel", but the underscore shouldn't be there: "call screen jumplabel"

[The underscore at the beginning of a variable name usually are used as internal names (sorry, i don't know the proper words to describe it). So the returned value of a called screen is stored in "_return"; that's something Ren'Py does.]
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)

User avatar
kuzai
Regular
Posts: 85
Joined: Sat May 12, 2012 8:15 pm
Projects: Custom Lover, PuppyShipping DWH, Yu-Gi-Oh!: Chat
Location: Canada
Contact:

Re: Renpy became buggy?

#20 Post by kuzai »

xavimat wrote:You have "call expression _jumplabel", but the underscore shouldn't be there: "call screen jumplabel"

[The underscore at the beginning of a variable name usually are used as internal names (sorry, i don't know the proper words to describe it). So the returned value of a called screen is stored in "_return"; that's something Ren'Py does.]
Alright I fixed that issue but now I have other problems, whenever I enter chat as soon as I click on the Casual Rep button my other options don't show up and the characters suddenly disappear and it only let's me click the casualrep button until it moves on, however what boggles me is that it doesn't move on until I click it 4 times and I only want it to end after 2 clicks.

EDIT:Okay I fixed the other errors but my day still doesn't proceed until I click 4 options and I only want two

This is what my code looks like in this script

Code: Select all

default chosen_option = 0
default select_repcasual = False #Ignore these for now they're for a later date
default select_repbashful = False
default select_repcreep = False
default select_jerk = False
default select_flirt = False


screen repchatopt:
        vbox xalign 10 yalign 0.090:
            if repcasual == True:
                imagebutton auto "reputations/repcasual_%s.png" action Show("casualchatopt")
            if repbashful == True:     
                imagebutton auto "reputations/repbashful_%s.png" action Show("bashfulchatopt")
            if repcreep == True:
                imagebutton auto "reputations/repcreep_%s.png" action Show("creepchatopt")
            if repjerk == True:
                 imagebutton auto "reputations/repjerk_%s.png" action Show("jerkchatopt")
            if repflirt == True:
                 imagebutton auto "reputations/repflirt_%s.png" action Show("flirtchatopt")

                 
                 
screen casualchatopt:

    
    tag menu

    frame:
        style_group "repcasual"
        xalign 0.1
        yalign 0.3       
        vbox:
            textbutton "How are you?" action Jump("casualhowareyou"), Hide("casualchatopt") #I've tried changing Jump to Return but it just jumps to the main menu
            textbutton "What do you think of the weather?" action Jump("casualthinkofweather"), Hide("casualchatopt")
            textbutton "You know... you're kind of annoying" action Jump("casualkindofannoying"), Hide("casualchatopt")
            textbutton "You're cute, you know that right?" action Jump("casualyouknowyouarecute"), Hide("casualchatopt")
            textbutton "You're a good person, I really like you" action Jump("casualgoodperson"), Hide("casualchatopt")
            textbutton "I don't really like you..." action Jump("casualdislikeyou"), Hide("casualchatopt")
            textbutton "Cancel" action Hide("casualchatopt")
            
label repoptions:
    
    if chosen_option < 2:
        call screen repchatopt


    else:
        jump finishchat

And here is when you chat

Code: Select all

##ANZU CHAT HOW ARE YOU CASUAL
label casualhowareyou:
    
        $ chosen_option += 1
        if anzuchat == True:
            
            hide screen casualchatopt
            show screen anzuaff_screen
            
            if anzulike_points >=7:
                show anzu2 at center                
                $ anzulike_points += 1
                a "Hmm, just living a normal day really"
                a "School has been keeping me busy, but it's nice to see you here"

                
            elif anzulike_points >= 0:
                show anzu2 at center
                show screen anzuaff_screen
                $ anzulike_points += 1
                a "I'm alright, haven't had much of anything going on lately"
                a "I was enjoying watching Yugi and Joey duel today, those two are always at it"
                
        call hideaffscreen
        jump repoptions
I forgive and forget. Because I have a good heart and terrible memory

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

Re: Renpy became buggy?

#21 Post by Enchant00 »

Ok, I'm trying to understand what you mean by your options not showing. Are you referring to the ones' about the "How are you" and "What do you think"? I tried copying your screen and testing it on renpy and it looks fine to me
Screen.png
Also, the character not showing may be an issue from your if call statements. Where exactly is the anzuchat called or set to True? It might be that it still return false which is why your character is not showing and the character is invisible. Also instead of using

Code: Select all

 elif anzulike_points >= 0:

Use

Code: Select all

 elif anzulike_points < 7:

[/code]
# Unless its possible to accumulate negative affection, then just set it to >= 6

I also tested your if conditional, but it seems to be working out well. And it calls the part about "I'm alright, haven't had much of anything going on lately"
Anzu2.png
* I'm not sure what's wrong with your code and I'll try to replicate your code again and debug it more in depth to see what's really wrong :lol: All I could say is that the problem is more likely a call issue somewhere or a miss-set boolean.

User avatar
kuzai
Regular
Posts: 85
Joined: Sat May 12, 2012 8:15 pm
Projects: Custom Lover, PuppyShipping DWH, Yu-Gi-Oh!: Chat
Location: Canada
Contact:

Re: Renpy became buggy?

#22 Post by kuzai »

Yeah, I said I fixed those errors the only one that remains is the one where my day won't proceed to the next until 4 options are selected but I only want it to proceed after 2 are selected. If it does move on after 2 are selected on your end then I'm confused as where to look in my scripts because all of the "chosen_options" are just in those specific scripts.

EDIT: Oh thank gods I figured it out, it was because I had a chosen_option -= 2 at the athome screen, now it moves on after two choices are made... I'm such an idiot

However I have yet another issue *sigh* I apologize dearly...

My new problem is my action Jump won't jump to the labels, I can click on the casualrep option but when the menu of casualchatopt pops up and I select an option it just stays there and won't jump.
But it will move on if I click two options, it just won't play out the labels (I found it only does that for Yugi, when I play Anzu's part it plays the label but the casualchatopt screen doesn't disappear)

I changed up the code and now Anzu's chat labels are working but Yugi's isn't

My code for the screen

Code: Select all

default chosen_option = 0
default select_repcasual = False
default select_repbashful = False
default select_repcreep = False
default select_jerk = False
default select_flirt = False


screen repchatopt:
        vbox xalign 10 yalign 0.090:
            if repcasual == True:
                imagebutton auto "reputations/repcasual_%s.png" action Show("casualchatopt")
            if repbashful == True:     
                imagebutton auto "reputations/repbashful_%s.png" action Show("bashfulchatopt")
            if repcreep == True:
                imagebutton auto "reputations/repcreep_%s.png" action Show("creepchatopt")
            if repjerk == True:
                 imagebutton auto "reputations/repjerk_%s.png" action Show("jerkchatopt")
            if repflirt == True:
                 imagebutton auto "reputations/repflirt_%s.png" action Show("flirtchatopt")

                 
                 
screen casualchatopt:

    
    tag menu

    frame:
        style_group "repcasual"
        xalign 0.1
        yalign 0.3       
        vbox:
            textbutton "How are you?" action Jump("casualhowareyou")
            textbutton "What do you think of the weather?" action Jump("casualthinkofweather")
            textbutton "You know... you're kind of annoying" action Jump("casualkindofannoying")
            textbutton "You're cute, you know that right?" action Jump("casualyouknowyouarecute")
            textbutton "You're a good person, I really like you" action Jump("casualgoodperson")
            textbutton "I don't really like you..." action Jump("casualdislikeyou")
            textbutton "Cancel" action Hide("casualchatopt")
            
label repoptions:
    
    call hideaffscreen
    if chosen_option < 2:
        call screen repchatopt


    else: 
        jump finishchat
My code for the label

Code: Select all

##RANDOM ENCOUNTER CHATS
##ANZU CHAT HOW ARE YOU CASUAL
label casualhowareyou:
    
        hide screen casualchatopt
        $ chosen_option += 1
        if anzuchat == True:
            
            show screen anzuaff_screen
            
            if anzulike_points >= 7:
                show anzu2 at center                
                $ anzulike_points += 1
                a "Hmm, just living a normal day really"
                a "School has been keeping me busy, but it's nice to see you here"

                
            elif anzulike_points >= 0:
                show anzu2 at center
                show screen anzuaff_screen
                $ anzulike_points += 1
                a "I'm alright, haven't had much of anything going on lately"
                a "I was enjoying watching Yugi and Joey duel today, those two are always at it"
                
        jump repoptions

                

##YUUGI CHAT HOW ARE YOU CASUAL
        if yugichat == True:
            
            show screen yugiaff_screen
            
            if yugilike_points >= 7:
                show yugi3 at center
                $ yugilike_points += 1
                y "There's not a whole lot going on"
                y "I was just roaming here to think to myself"

                
            elif yugilike_points >= 0:
                show yugi3 at center
                $ yugilike_points += 1
                y "I've been good"
                y "Everyone seems to be relaxed today"
                
        jump repoptions
I honestly see nothing wrong, I tried changing if Yugichat == True to elif yugichat == True but it just says it needs an expected statement?
I forgive and forget. Because I have a good heart and terrible memory

Post Reply

Who is online

Users browsing this forum: No registered users