Page 1 of 1

fade out a music

Posted: Wed Oct 19, 2005 6:39 pm
by CTpenok
While a camera shows a explosion i have a soundfile (mp3) playing some music.

Code: Select all

	$player stufftext "playmp3 mainta/sound/music/mus_allies_success.mp3"
Is there a way to fade out the music ?
And if so, how ?

Posted: Thu Nov 24, 2005 7:51 pm
by @(...:.:...)@
Hi,

Start the music with this:

$player stufftext "tmstart mainta/sound/music/mus_allies_success.mp3"

Then you can stufftext tmvolume in lower and lower values to fade it out.

also stufftexting "tmstop" before starting a new sound will prevent the client having 2 pieces of music playing at once.


There are proberbly better ways, but my brain is frazzled at the moment. :shock:

If I remember right you can't cache files with scriptmaster that are not saved in a pk3. If you can then you could just cache the music with scriptmaster, then play it from the script. Perhaps:

[quote=game classes]
music( String current, [ String fallback ] )

Sets the current and fallback (optional) music moods.

musicvolume( Float volume, Float fade_time )

Sets the volume and fade time of the music.
[/quote]

cya