Z
zendraw
Guest
how do you set the gain of a track once? i see no function to check if the gain is depleting or increasing.
if (e)
{
if (!battlechase)
{
battlechase=1;
if (!audio_is_playing(mp3battlechase)) {scrplaymsc(mp3battlechase, global.volmsc*.5, 5000)};
else {audio_sound_gain(mp3battlechase, global.volmsc*.5, 3000)};
}
} else
{
if (battlechase)
{
battlechase=0;
if (audio_is_playing(mp3battlechase)) {audio_sound_gain(mp3battlechase, 0, 3000)};
}
}
if (audio_is_playing(mp3battlechase)) {if (audio_sound_get_gain(mp3battlechase)<=0) {audio_stop_sound(mp3battlechase)}};
/// @desc scrplaysfx();
/// @arg track
/// @arg loop
/// @arg gain
if (global.volmsc<=0) {exit};
var s=-4;
if (audio_exists(argument0))
{
s=audio_play_sound(argument0, 0, argument1);
if (argument2)
{
audio_sound_gain(s, 0, 0);
audio_sound_gain(s, global.volmsc, argument2);
}
}
return s;