hello guys I come to ask for a desperate help for you, this problem is being one of the worst I have ever faced (the others were very bad too but with your help they were not so horrible to fix).
Come on, I'm trying to make an audio system that when it changes rooms it plays a different song, so far I had this idea but the problem is to implement it. I can't get him to work, for example: I can get him to stop playing but he doesn't play anymore or he asks him to play only once and he stays on the same song (there are several other problems but these are some of them)
I'll put the code here for better understanding:
well, can anyone measure any tips on how to make this system work? this code was one of the many ways that I tried to execute, I tried several codes but nothing gave the result I wanted, and what’s worse is that I tried to do it in a way that it destroyed itself and played again but my other room restarts then there are several songs playing.
NOTE: I do not know if this is useful but the obj that is loading the songs is another, it is not giving a problem and the songs are being loaded normally.
I am grateful for any help, in case it is difficult to understand I will try to explain it in another way.
Come on, I'm trying to make an audio system that when it changes rooms it plays a different song, so far I had this idea but the problem is to implement it. I can't get him to work, for example: I can get him to stop playing but he doesn't play anymore or he asks him to play only once and he stays on the same song (there are several other problems but these are some of them)
I'll put the code here for better understanding:
GML:
//create event
sound = 0;
music = 0;
toque = true;
//step event
if(instance_exists(obj_transicao)) // transition obj is the room translation obj, it creates that black screen effect
{
audio_sound_gain(music,1,0)
audio_sound_gain(music,0,1000)
if(audio_sound_get_gain(music) < 0)
{
audio_stop_sound(music);
}
}
//room start
audio_sound_gain(music,0,0)
audio_sound_gain(music,1,1000)
toque = true
NOTE: I do not know if this is useful but the obj that is loading the songs is another, it is not giving a problem and the songs are being loaded normally.
I am grateful for any help, in case it is difficult to understand I will try to explain it in another way.