Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help How to make music fade out and new music fade in?
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#1
How to make music fade out and new music fade in?

I have a set up where when an enemy appears alternative music will start playing (rather than the default enemy music), however when the enemy leaves I want the music to return to the normal level music so I use stopmusic and playmusic commands, but the stopmusic is instant which I would prefer to be a fade, is there any way to do this as the music suddenly stopping is quite jarring?

(This post was last modified: 04-01-2013, 03:21 AM by serbusfish.)
04-01-2013, 02:11 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: How to make music fade out and new music fade in?

Sorry, but there is no script that mentions how to fade out a sound. But you can fade in a sound, though.

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-01-2013, 06:09 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#3
RE: How to make music fade out and new music fade in?

(04-01-2013, 06:09 AM)JustAnotherPlayer Wrote: Sorry, but there is no script that mentions how to fade out a sound. But you can fade in a sound, though.

Wrong, as well, it's music he's asking for, not a sound.
void StopMusic(float afFadeTime, int alPrio);

Stops music.

afFadeTime - time in seconds until music stops
alPrio - the priority of the music that should stop

Simply increase the FadeTime.
(This post was last modified: 04-01-2013, 06:30 AM by Statyk.)
04-01-2013, 06:29 AM
Find




Users browsing this thread: 1 Guest(s)