Text Bleeps not working?

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
twodee
Newbie
Posts: 12
Joined: Tue May 08, 2018 4:30 pm
Contact:

Text Bleeps not working?

#1 Post by twodee » Sun May 13, 2018 11:24 am

Hi guys :)

I'm trying to input text bleeps into my game, but I can't seem to get them to work (likely because I'm using the wiki). Here's my code, what should I do?

Code:

Code: Select all

define k = Character("K", color = "#FFFFFF", callback=k_test_sound, what_prefix='"', what_suffix='"', ctc="ctc_animation", ctc_position="fixed")

init python:
    def k_test_sound(event, loop=True, **kwargs):
        if event == "show":
            renpy.music.play("k_test_sound.ogg", channel ="sound")
        elif event == "slow_done" or event == "end":
            renpy.music.stop(channel="sound")
            
label start:
    k "Testing, testing"
And here's the error I'm getting:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 6, in script
    define k = Character("K", color = "#FFFFFF", callback=k_test_sound, what_prefix='"', what_suffix='"', ctc="ctc_animation", ctc_position="fixed")
  File "game/script.rpy", line 6, in <module>
    define k = Character("K", color = "#FFFFFF", callback=k_test_sound, what_prefix='"', what_suffix='"', ctc="ctc_animation", ctc_position="fixed")
NameError: name 'k_test_sound' is not defined

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Text Bleeps not working?

#2 Post by Remix » Sun May 13, 2018 11:39 am

Use:

init -1 python:

So it runs your python before the defines are ran
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: No registered users