Mismatched sound assignation

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
Karrion
Regular
Posts: 73
Joined: Fri Jan 18, 2019 8:33 pm
Projects: Murder on the Marine Express
Organization: 1564 Studio
itch: 1564-studio
Contact:

Mismatched sound assignation

#1 Post by Karrion »

I'm having this very weird problem where if I put a play action on a button, it changes another button instead of the one it's supposed to change, while the button itself does not play any sound.

The two button codes are like this:

Code: Select all

imagebutton idle "images/boton.png" action [ShowMenu("chat_menu"),Play("sound","sound/sfx_access.wav")]
imagebutton idle "images/button_back.png" action [Return(),Play("sound","sound/sfx_exit.wav")]
Changing the first Play action changes the sound of the second button and the first button does not reproduce anything. I'm sure I'm changing the correct buttons since everything else corresponds as it should. Anyone knows why this is happening?

Edit: If I put the play action before the return/show menu, everything works as intended. My only problem now is that even if I put the play sound before the FileSlotAction in the load screens, the sound does now play. It does when saving but not when loading.
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!

Image

Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!

Image

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Mismatched sound assignation

#2 Post by RicharDann »

Try using activate_sound instead:

Code: Select all

imagebutton idle "images/boton.png" action ShowMenu("chat_menu") activate_sound "sound/sfx_access.wav"
The most important step is always the next one.

User avatar
Karrion
Regular
Posts: 73
Joined: Fri Jan 18, 2019 8:33 pm
Projects: Murder on the Marine Express
Organization: 1564 Studio
itch: 1564-studio
Contact:

Re: Mismatched sound assignation

#3 Post by Karrion »

The mismatching was solved by putting the Play action before the ShowMenu, however, the sound not playing on some transitions (such as when exiting the game or when loading a save), still don't work, neither by putting Play before the other action, nor by using activate_sound
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!

Image

Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!

Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], decocloud