fade out a music

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
CTpenok
Corporal
Posts: 41
Joined: Tue Oct 21, 2003 10:01 am
Location: Netherlands
Contact:

fade out a music

Post 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 ?
Image
@(...:.:...)@
Corporal
Posts: 37
Joined: Wed Nov 23, 2005 3:42 pm
Location: Cambridge UK

Post 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
Image

<3 arrays.
Post Reply