Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: FamousAdventurer77 on Wed 25/05/2011 09:23:30

Title: Ripping my hair out with music.
Post by: FamousAdventurer77 on Wed 25/05/2011 09:23:30
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.
Title: Re: Ripping my hair out with music.
Post by: arj0n on Wed 25/05/2011 09:44:29
Manual says: aMusic6.Play();
Title: Re: Ripping my hair out with music.
Post by: TomatoesInTheHead on Wed 25/05/2011 10:01:11
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.
Title: Re: Ripping my hair out with music.
Post by: FamousAdventurer77 on Wed 25/05/2011 19:24:58
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.
Title: Re: Ripping my hair out with music.
Post by: monkey0506 on Wed 25/05/2011 20:40:29
"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.
Title: Re: Ripping my hair out with music.
Post by: FamousAdventurer77 on Wed 25/05/2011 20:44:31
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?
Title: Re: Ripping my hair out with music.
Post by: FamousAdventurer77 on Wed 25/05/2011 20:47:23
Unless I just leave the properties of the Music folder as DefaultRepeat = True? (Then worry about changing it for other rooms...)
Title: Re: Ripping my hair out with music.
Post by: Khris on Thu 26/05/2011 01:51:13
If you want a different RepeatStyle, put it into the command:

  aMusicP6.Play(eAudioPriorityNormal, eRepeat);