Page 1 of 1

[SOLVED] MusicRoom Problem

Posted: Fri Feb 04, 2022 3:44 am
by HEllRas
Hey
I am using the code from the documentation. "Play" action not working.
AttributeError: 'ADVCharacter' object has no attribute 'Play'.
I tried changing it to just "play". I tried to use what I found "renpy.music.play".
I just don't know what to do. Perhaps someone solved this?
I would really appreciate your help.

Code: Select all

init python:

    # Этап 1. Создайте представителя MusicRoom.
    mr = MusicRoom(fadeout=1.0)

    # Этап 2. Добавьте музыкальные файлы.
    mr.add("audio/mainMenu.wav")
    
screen music_room:

    tag menu

    vbox:
        xalign 0.5
        yalign 0.2

        # Кнопки для воспроизведения каждого трека.
        textbutton "1. Main Menu" action mr.Play("audio/mainMenu.wav") xalign 0.5

Re: [OPEN] MusicRoom Problem

Posted: Fri Feb 04, 2022 4:31 am
by Ocelot
You defined a character, named mr after you created MusicRoom, overwriting it.