Hello,
It's already me again 😀
I am trying to improve a few things and now i on the sounds, musics parts.
Until now i was doing little tricks here and there to prevent music to start over again when reentering a room before the end of the music.
I found a thread on the forum here:
https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/changing-rooms-without-the-music-starting-over/
I am trying to use the 2nd method with audio channels
In GlobalScipt.asc i have:
Code: ags
In GlobalScript.ash i have:
Code: ags
And finally in my room i have:
Code: ags
Unfortunately it gives an error in the GlobalScript.asc
"GlobalScript.asc(13): Error (line 13): Nested functions not supported (you may have forgotten a closing brace)"
this is this line:
Code: ags
Can you please help me if you can see the mistake i made.
Thank you very much.
It's already me again 😀
I am trying to improve a few things and now i on the sounds, musics parts.
Until now i was doing little tricks here and there to prevent music to start over again when reentering a room before the end of the music.
I found a thread on the forum here:
https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/changing-rooms-without-the-music-starting-over/
I am trying to use the 2nd method with audio channels
In GlobalScipt.asc i have:
function game_start()
{
bool IsAudioClipPlaying(AudioClip* clip)
{
for (int i = 0; i < System.AudioChannelCount; i++)
{
if (System.AudioChannels[i].PlayingClip == clip)
{
return true; // found it
}
}
return false; // nowhere
}
}
In GlobalScript.ash i have:
import bool IsAudioClipPlaying(AudioClip* clip);
And finally in my room i have:
function room_AfterFadeIn()
{
if (!IsAudioClipPlaying(aMusic1))
{
aMusic1.Play();
}
}
Unfortunately it gives an error in the GlobalScript.asc
"GlobalScript.asc(13): Error (line 13): Nested functions not supported (you may have forgotten a closing brace)"
this is this line:
bool IsAudioClipPlaying(AudioClip* clip)
Can you please help me if you can see the mistake i made.
Thank you very much.