So I'm trying to get my teleport transitions to automatically play a sound effect when used (so that I don't have to manually play the sound effect each time I use it.) I adapted the voice beep code into this.
Code: Select all
init python:
def telein(event, **kwargs):
if event == "show":
renpy.music.play("snd/vfx/teleport.mp3", channel="sfx01")
elif event == "slow_done" or event == "end":
renpy.music.stop(channel="sound")
The code I'm using to make the teleport transitions is kinda old (and copy pasted from a tutorial) plus I'm not sure if I could do something similar with another sort of updated code.
Code: Select all
#Teleport In/Out
$ slowtele = ImageDissolve("img/fx/teleportalt11.png", 5.0, 8)
$ telein = ImageDissolve("img/fx/teleportalt11.png", 1.0, 8)
$ teleinramp = ImageDissolve("img/fx/teleportalt11.png", 3.0, ramp=[ 16 * i for i in range(0, 15) + range(15, 0, -1) + range(0, 15) + range(15, 0, -1) + range(0, 15) + range(15, 0, -1) + range(0, 15) ] )
$ teleout = ImageDissolve("img/fx/teleportalt11.png", 1.0, 8, reverse=True)