Issues with Hovered since update?

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
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Issues with Hovered since update?

#1 Post by octacon100 » Sun Sep 28, 2014 7:33 pm

Hi All,

Sorry to be a pain, but I'm unable to figure out why my hovered code doesn't work after the update. It seemed to be working in version 6.16.5, but now, I can't get this screen to get any hovered code to work. Images are not changing, and text is not appearing. I'm calling this screen using ShowMenu(), so maybe that has something to do with it? Hovered works on other screens but not this one:

Code: Select all

screen people:
    tag case_files
    modal True
    zorder 0
    
    default tt = Tooltip("")
    default tt1 = Tooltip("")
    default tt2 = Tooltip("")
    
    #timer 0.1 repeat True action If(minutes2 == -1 and timerGameOver == True, true=[Play("sound", buttonSFX), SetVariable ("inTestimony", False), SetVariable("timerGameOver", False), SetVariable("showTimerChange", False), Hide("testimony"), Hide("nextButton"), Hide("backButton"), Jump("gameOver")], false=[SetVariable ("tick", "tock"), countdownTimer()]) 
    
    frame:
        background "#0008"
        xfill True
        yfill True
    
        add "GUI/timer_back.png" xpos timerBGX ypos timerBGY
        fixed:
            xpos timerX
            ypos timerY
            xmaximum 80
            ymaximum 40
            
            if minutes2 > minuteWarning:
                text "[minutes2:0.0f]:[seconds2:04.1f]" xalign 1.0 color "#fff" size fontSize
            elif minutes2 > -1:
                text "[minutes2:0.0f]:[seconds2:04.1f]" xalign 1.0 color "#f00" size fontSize
            else:
                text "0:0.0" xalign 1.0 color "#f00" size fontSize at blink
                
        add "GUI/confidence_back.png" xpos confidenceBGX ypos confidenceBGY
        fixed:
            xpos confidenceX
            ypos confidenceY
            bar:
                value AnimatedValue(confidence, range=confidenceMax) 
                xmaximum 150
                ymaximum 50
                left_bar Frame("GUI/HealthBar_full.png", 50, 0)
                right_bar Frame("GUI/HealthBar_empty.png", 50, 0)
                thumb None
                thumb_shadow None
    
        fixed:
        
            imagebutton idle "GUI/caseFilesButton_idle.png" hover "GUI/caseFilesButton_hover.png" xanchor 'left' yanchor 'top' xpos 0.871 ypos topMarginMenu action [Play("sound", buttonSFX), Hide("people"), Show("case_files")]
            imagebutton idle "GUI/cancelButton_idle.png" hover "GUI/cancelButton_hover.png" xpos 0.0 ypos 1.0 xanchor 'left' yanchor 'bottom' action [Play("sound", buttonSFX), Return()]
            #textbutton "Examine" xpos rightMargin ypos bottomMargin xanchor 'right' yanchor 'bottom' action Return(True)
        
            frame:
            
                background "#0000"
                xfill True
                yfill True
                xpadding 100
                ypadding 120
                xalign 0.5
                yalign 0.5
            
                vbox:
            
                    grid 5 2:
                
                        spacing 14
                        for i in range(len(caseFiles.personnelList)):
                            imagebutton: 
                                idle caseFiles.getPersonnelImage(i)
                                hover caseFiles.getPersonnelImage(i)
                                action [ Play("sound", buttonSFX), SetVariable("selectionNumber", i), SetVariable("selectedAnItem", True), SetVariable("showCaseFilesTypeScreen", people), Hide("case_files"), Show("evidence_detail") ] 
                                hovered [tt.Action(i), tt1.Action(caseFiles.personnelList[i].name), tt2.Action(caseFiles.personnelList[i].description) ]
                        for i in range (10 - len(caseFiles.personnelList)):
                            image "CaseNotes/clear.png"
                        
                    #text "[tt.value]"
                    vbox:
                            yoffset 30
                            xoffset 20
                            spacing 20
                            xmaximum 600
                            text "{b}[tt1.value]{/b}"
                            text "[tt2.value]"
Any help would be great! :)
Image
Current Digital Projects -
Image
Regiera Hope Completed Game Forum Post

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Issues with Hovered since update?

#2 Post by PyTom » Sun Sep 28, 2014 7:50 pm

What version are you on. Assuming you're on 6.18.1, can you put together a replication so I can try this code out?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Re: Issues with Hovered since update?

#3 Post by octacon100 » Sun Sep 28, 2014 7:59 pm

Hi PyTom,

Thanks for your time! Sure, I'm on 6.18.1, I'll put some quick code together and send it to you. What's the best way to do that?
Image
Current Digital Projects -
Image
Regiera Hope Completed Game Forum Post

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Issues with Hovered since update?

#4 Post by PyTom » Sun Sep 28, 2014 8:15 pm

Email is fine, or upload it somewhere and pm or post a link.

The important thing is it be a game I can run, that demonstrates the problem in a couple of clicks. I may have to run it dozens of times to fix the problem, so it's important the demonstration is fast.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Issues with Hovered since update?

#5 Post by PyTom » Mon Sep 29, 2014 10:55 pm

So, the problem here was the use of:

Code: Select all

imagebutton ... action [ Play("sound", buttonSFX), ... ] 
especially when it is displayed when the sound is playing. The problem with this is that as the sound stops playing, it causes Ren'Py to restart the interaction repeatedly, which prevents Ren'Py from responding to mouse movement. That's a bug, which I've fixed. I've also made buttons stop participating in selection if they're using a non-music channel, which should make this code do the right thing.

That being said, there's a better way to write this:

Code: Select all

imagebutton ... activate_sound buttonSFX action [ ... ] 
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Re: Issues with Hovered since update?

#6 Post by octacon100 » Tue Sep 30, 2014 9:13 am

Great, thanks very much! You work fast! Thanks for showing me the activate_sound function, I'll use that instead.
Image
Current Digital Projects -
Image
Regiera Hope Completed Game Forum Post

Post Reply

Who is online

Users browsing this forum: zyric