How can I fadeout music when loading a saved file? [SOLVED]

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
ERT
Newbie
Posts: 14
Joined: Sun Mar 08, 2015 11:00 am
Organization: Studio AWE
Contact:

How can I fadeout music when loading a saved file? [SOLVED]

#1 Post by ERT »

I am using FileAction function to load game from a saved file, and use config.main_menu_music to play music on the main menu.

What I want to do is when loading game from the main menu (load screen is actually not main menu screen, but there still is music same with the main menu) I want to fade the music out, rather than just cut the music and show the loaded (in-game) situation.

I tried adding Stop action before the FileAction, but it didn't work.

Code: Select all

    action [Stop(channel='music',fadeout=2.0), FileAction(i)] 
Last edited by ERT on Mon Sep 24, 2018 1:25 pm, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How can I fadeout music when loading a saved file?

#2 Post by Imperf3kt »

use label after_load

Code: Select all

label after_load:
    stop music fadeout 2.0
    return
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

ERT
Newbie
Posts: 14
Joined: Sun Mar 08, 2015 11:00 am
Organization: Studio AWE
Contact:

Re: How can I fadeout music when loading a saved file?

#3 Post by ERT »

Imperf3kt wrote: Mon Sep 24, 2018 7:38 am use label after_load

Code: Select all

label after_load:
    stop music fadeout 2.0
    return
This code works well. Thanks!

Post Reply

Who is online

Users browsing this forum: Google [Bot]