play music without loop new command?

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
User avatar
jack_norton
Lemma-Class Veteran
Posts: 4087
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

play music without loop new command?

#1 Post by jack_norton »

I am trying to find what is the right syntax:

Code: Select all

play music "snd/work.ogg" loop False
doesn't work... I can use python but I'd like to know what is the right one! :D I think it's correct until loop, but somehow false doesn't work (in python yes):

Code: Select all

$renpy.music.play("snd/work.ogg", loop=False)
also maybe could be useful to update the doc since not always we want looping music :)
follow me on Image Image Image
computer games

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: play music without loop new command?

#2 Post by PyTom »

For the play music command, you should give it "noloop".
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4087
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: play music without loop new command?

#3 Post by jack_norton »

ahh ok thank. Would have never guessed it :D
follow me on Image Image Image
computer games

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: play music without loop new command?

#4 Post by henvu50 »

If you give music the noloop command, it causes rollback to stop the currently played music. It also causes the music to no longer be played after loading a save game.

Is there a way to stop music looping, but without the rollback stopping the music that should be playing, and ensuring when you load a save game, the song that was queued to play once, starts playing?

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot]