Code: Select all
renpy.music.register_channel("sfx1", "sfx")
Making it short, I need a init block, but I don't know anything about it.While running game code:
File "game/script.rpy", line 231, in script
$ renpy.music.register_channel("sfx1", "sfx")
File "game/script.rpy", line 231, in <module>
$ renpy.music.register_channel("sfx1", "sfx")
Exception: Can't register channel outside of init phase.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 231, in script
$ renpy.music.register_channel("sfx1", "sfx")
File "C:\Users\Potato\Downloads\Ren'py\renpy\ast.py", line 814, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Potato\Downloads\Ren'py\renpy\python.py", line 1719, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 231, in <module>
$ renpy.music.register_channel("sfx1", "sfx")
File "C:\Users\Potato\Downloads\Ren'py\renpy\audio\audio.py", line 676, in register_channel
raise Exception("Can't register channel outside of init phase.")
Exception: Can't register channel outside of init phase.