I'm using version 3.2 and think the command for this might've changed since? That or I really don't know how I screwed this one up after comparing it to the video tutorial and the lack of mention of this in the manual.
I had to create a Music folder in the game's folder (and have it placed there, not in the Debug one) and moved a MIDI file there called "Music6" since I want it to play in Room6 and be on an endless loop. I also "uploaded" it in the Audio section of the editor so it has the script name aMusic6.
function room_AfterFadeIn()
{
SetMusicRepeat(1);
PlayMusic(6);
}
Why do I keep getting "undefined token" errors? The file's named right and in the right place. The original file name didn't have a .mid extension, so is the extension even relevant? I got the same error with and without it.
Manual says: aMusic6.Play();
Also note that the online manual (http://www.adventuregamestudio.co.uk/manual/index.htm) is out of date when it comes to audio. The built-in manual (menu Help->Contents, F1 key, etc.) is up to date.
I need to stop attempting code while insomniac. Hehe.
Figures that I looked in the online manual and the not the built-in one for that...
But are extensions even relevant to use in either the script name or what you have them labeled as in the Music folder? Easily 98% of all my music files don't have extensions in the name.
So aMusicP6.Play() works....SetMusicRepeat doesn't, I still get an undefined token for that.
"SetMusicRepeat" has been replaced by the RepeatStyle of the audio type I believe. It should show up in the same area of the editor where you actually manage your audio clips, but in the "Types" folder.
No...? It says nothing in the manual about it. The only sound types that show up in the Audio panel are Music, AmbientSound, and Sound. Even if I create a new type and call it RepeatStyle, how would it actually work though?
Unless I just leave the properties of the Music folder as DefaultRepeat = True? (Then worry about changing it for other rooms...)
If you want a different RepeatStyle, put it into the command:
aMusicP6.Play(eAudioPriorityNormal, eRepeat);