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.
-
Kinmoku
- Miko-Class Veteran
- Posts: 560
- Joined: Mon Aug 11, 2014 9:39 am
- Completed: One Night Stand
- Projects: Love IRL, Memories
- Tumblr: gamesbykinmoku
- itch: kinmoku
- Location: Germany
-
Contact:
#1
Post
by Kinmoku » Thu Aug 06, 2020 11:56 am
Hi all,
I want to add a sound effect when a screen appears. This screen is a popup/ notification kind of thing, so I want a sound to play with it.
I don't really know what I'm doing, but I tried this:
Code: Select all
on "show" action Play(audio, "sounds/notification.wav", selected=False)
However, it doesn't work and comes up with an error:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/forum_ff.rpy", line 61, in script
pause
File "renpy/common/000statements.rpy", line 416, in execute_pause
renpy.pause()
File "renpy/common/00action_audio.rpy", line 64, in __call__
renpy.music.play(self.file, channel=self.channel, **self.kwargs)
TypeError: argument of type 'StoreModule' is not iterable
Any ideas how to do this?

Last edited by
Kinmoku on Fri Aug 07, 2020 3:29 am, edited 1 time in total.
-
drKlauz
- Veteran
- Posts: 237
- Joined: Mon Oct 12, 2015 3:04 pm
-
Contact:
#2
Post
by drKlauz » Thu Aug 06, 2020 12:54 pm
Code: Select all
on "show" action Play("audio", "sounds/notification.wav", selected=False)
Channel is string id, you send audio module instead.
-
Kinmoku
- Miko-Class Veteran
- Posts: 560
- Joined: Mon Aug 11, 2014 9:39 am
- Completed: One Night Stand
- Projects: Love IRL, Memories
- Tumblr: gamesbykinmoku
- itch: kinmoku
- Location: Germany
-
Contact:
#3
Post
by Kinmoku » Fri Aug 07, 2020 3:28 am
drKlauz wrote: ↑Thu Aug 06, 2020 12:54 pm
Code: Select all
on "show" action Play("audio", "sounds/notification.wav", selected=False)
Channel is string id, you send audio module instead.
Ah, thank you

It works now.
Users browsing this forum: Bing [Bot], Google [Bot], _ticlock_