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.
-
HEllRas
- Regular
- Posts: 32
- Joined: Fri Aug 06, 2021 9:57 pm
- Tumblr: albinostudio
- itch: albinostudio
-
Contact:
#1
Post
by HEllRas » Fri Feb 04, 2022 3:44 am
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
Last edited by
HEllRas on Fri Feb 04, 2022 11:14 am, edited 1 time in total.
-
Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
-
Contact:
#2
Post
by Ocelot » Fri Feb 04, 2022 4:31 am
You defined a character, named mr after you created MusicRoom, overwriting it.
< < insert Rick Cook quote here > >