[RE]Activate_sound is not worked in confirm window of load menu.

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
yoyuchi
Regular
Posts: 58
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

[RE]Activate_sound is not worked in confirm window of load menu.

#1 Post by yoyuchi » Wed Aug 10, 2022 3:09 am

Hello, everyone.
I don't get reply to the question, so I post the question again.
I made save, load menu using "hotspot", and activate_sound and hover_sound inserted in each slot and confirm window.
Save menu's sound works normally in slot and confirm window.
But, In "load", click "YES" activate_sound is not played at the confirm window. "NO" activate_sound works normally.

Code: Select all

screen save:    
    tag menu
    zorder 100  
    imagemap:
        ground "grp/parts/save_load/save_ground.png"
        idle "grp/parts/save_load/save_idle.png"
        hover "grp/parts/save_load/save_hover.png"
        selected_idle "grp/parts/save_load/save_selected_idle.png"
        selected_hover "grp/parts/save_load/save_selected_hover.png"
        cache False
             
        hotspot (69,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(1) 
        hotspot (243,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(2) 
        hotspot (420,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(3) 
        hotspot (594,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(4) 
        hotspot (769,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(5) 
    
        hotspot (140, 220, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FileSave(1, confirm=True):
            use load_save_slot(number=1) 
        hotspot (613, 220, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FileSave(2, confirm=True):
            use load_save_slot(number=2) 
        hotspot (1089, 220, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FileSave(3, confirm=True):
            use load_save_slot(number=3) 
        hotspot (140, 519, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FileSave(4, confirm=True):
            use load_save_slot(number=4) 
        hotspot (613, 519, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FileSave(5, confirm=True):
            use load_save_slot(number=5) 
        hotspot (1089, 519, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FileSave(6, confirm=True):
            use load_save_slot(number=6) 

        hotspot (1380, 795, 186, 81) hover_sound "sound/se/sys_hover.mp3" action [Play("sound", "sound/se/sys_cancel.mp3"), Return()] 
                
        key "mouseup_3" action [Play("sound", "sound/se/sys_cancel.mp3"), Return()]   
        key "K_ESCAPE" action [Play("sound", "sound/se/sys_cancel.mp3"), Return()]   

screen load:   
   tag menu
   zorder 100

   imagemap:
        ground "grp/parts/save_load/load_ground.png"
        idle "grp/parts/save_load/load_idle.png"
        hover "grp/parts/save_load/load_hover.png"
        selected_idle "grp/parts/save_load/load_selected_idle.png"
        selected_hover "grp/parts/save_load/load_selected_hover.png"
        cache False
        
        hotspot (69,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(1) 
        hotspot (243,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(2) 
        hotspot (420,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(3) 
        hotspot (594,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(4) 
        hotspot (769,109,155,84) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked FilePage(5) 
            
        hotspot (140, 220, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked Confirm("ロードしますか?",FileLoad(1, confirm = False)):   
            use load_save_slot(number=1) 
        hotspot (613, 220, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked Confirm("ロードしますか?",FileLoad(2, confirm = False)):
            use load_save_slot(number=2) 
        hotspot (1089, 220, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked Confirm("ロードしますか?",FileLoad(3, confirm = False)):
            use load_save_slot(number=3) 
        hotspot (140, 519, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked Confirm("ロードしますか?",FileLoad(4, confirm = False)):
            use load_save_slot(number=4) 
        hotspot (613, 519, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked Confirm("ロードしますか?",FileLoad(5, confirm = False)):
            use load_save_slot(number=5) 
        hotspot (1089, 519, 371, 217) activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" clicked Confirm("ロードしますか?",FileLoad(6, confirm = False)):
            use load_save_slot(number=6) 

        hotspot (1380, 795, 186, 81) hover_sound "sound/se/sys_hover.mp3" action [Play("sound", "sound/se/sys_cancel.mp3"), Return()] 
    
        key "mouseup_3" action [Play("sound", "sound/se/sys_cancel.mp3"), Return()]
        key "K_ESCAPE" action [Play("sound", "sound/se/sys_cancel.mp3"), Return()]        

Code: Select all

screen confirm(message, yes_action, no_action):
    modal True
    zorder 500
    style_prefix "confirm"

    add "grp/parts/ground.png"
    #add "grp/parts/quit_check.png" xpos 570 ypos 350

    frame:
        vbox:                               
            xsize 445
            ysize 234
            xalign .98
            yalign .98
            spacing 30

            label _(message):
                style "confirm_prompt"
                text_size 30                
                xalign 0.5                 
                yalign 1.7

            hbox:
                xalign 0.1
                spacing 70
                # style_group "readback"
                
                imagebutton auto "grp/parts/quitYES_%s.png" xpos 72 ypos 32 activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" action [Play("sound", "sound/se/sys_cancel.mp3"), yes_action] 
                imagebutton auto "grp/parts/quitNO_%s.png" xpos 79 ypos 32 activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" action no_action

    key "mouseup_3" action [Play("sound", "sound/se/sys_cancel.mp3"), no_action]        
    key "K_ESCAPE" action [Play("sound", "sound/se/sys_cancel.mp3"), no_action]        
There seems to be no problem with coding, but I don't know why "yes" sound doesn't work only in the confirm window of "LOAD".
I have been looking for the cause of this problem for about 3weeks, but I could not solve it yet. I'm having a hard time right now.
Is there a case where a particular sound doesn't work in the confirmation window called from a particular menu? Where should I fix it?
The sound in all confirm windows except "Load" is working normally. Only "Load" does not work.
I thought about creating a separate confirm window exclusively for "Load," but I'm a beginner in programming, so I can't even think about it.

Any advice will be of great help. I'm eagerly waiting for your help.

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

Re: [RE]Activate_sound is not worked in confirm window of load menu.

#2 Post by Ocelot » Wed Aug 10, 2022 3:38 am

yoyuchi wrote:
Wed Aug 10, 2022 3:09 am
The sound in all confirm windows except "Load" is working normally.
That is pretty strange. Sound working, I mean. It should not work anywhere. I suggest to try to force recompile the game to try to get rid of it.

In reality, activation sound does play, but is immideately canceled by Play action. Remember: most channels can only play one thing at a time. If a second audio is played, the first is canceled. If you trigger second sound immideately after playing first, you might replace that first sound too quickly to hear it.
< < insert Rick Cook quote here > >

yoyuchi
Regular
Posts: 58
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Re: [RE]Activate_sound is not worked in confirm window of load menu.

#3 Post by yoyuchi » Wed Aug 10, 2022 5:08 am

Ocelot wrote:
Wed Aug 10, 2022 3:38 am
yoyuchi wrote:
Wed Aug 10, 2022 3:09 am
The sound in all confirm windows except "Load" is working normally.
That is pretty strange. Sound working, I mean. It should not work anywhere. I suggest to try to force recompile the game to try to get rid of it.

In reality, activation sound does play, but is immideately canceled by Play action. Remember: most channels can only play one thing at a time. If a second audio is played, the first is canceled. If you trigger second sound immideately after playing first, you might replace that first sound too quickly to hear it.
Thank you for your reply.

Code: Select all

imagebutton auto "grp/parts/quitYES_%s.png" xpos 72 ypos 32 activate_sound "sound/se/sys_select.mp3" hover_sound "sound/se/sys_hover.mp3" action [Play("sound", "sound/se/sys_cancel.mp3"), yes_action]                
I wrote this for the test.
In the confirm window other than "Load"(save overwriting or game shutdown confirm), "sys_cancel" and "sys_select" sound are played simultaneously.
This is normal and of course it's for testing.
However, neither action [Play("sound", "sound/se/sys_cancel.mp3") nor activate_sound "sound/sys_select.mp3" will work in the "Load" confirm window only.
As you mentioned, I tried "force recompile" but it didn't work out.
The function of "Load" works very well. Only the sound (active_sound) does not work.
Is there anything else I can try?
It's like a bug in Renfai, but I'm so embarrassed because this is the first time.
Please help me.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]