Ripping my hair out with music.

Started by FamousAdventurer77, Wed 25/05/2011 09:23:30

Previous topic - Next topic

FamousAdventurer77

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.

Code: ags

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.
If you want to know the Bible's contents, just watch Lord of the Rings or listen to the last 8 Blind Guardian albums. It's pretty much the same thing.

arj0n


TomatoesInTheHead

Also note that the online manual is out of date when it comes to audio. The built-in manual (menu Help->Contents, F1 key, etc.) is up to date.

FamousAdventurer77

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.
If you want to know the Bible's contents, just watch Lord of the Rings or listen to the last 8 Blind Guardian albums. It's pretty much the same thing.

monkey0506

"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.

FamousAdventurer77

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?
If you want to know the Bible's contents, just watch Lord of the Rings or listen to the last 8 Blind Guardian albums. It's pretty much the same thing.

FamousAdventurer77

Unless I just leave the properties of the Music folder as DefaultRepeat = True? (Then worry about changing it for other rooms...)
If you want to know the Bible's contents, just watch Lord of the Rings or listen to the last 8 Blind Guardian albums. It's pretty much the same thing.

Khris

If you want a different RepeatStyle, put it into the command:

Code: ags
  aMusicP6.Play(eAudioPriorityNormal, eRepeat);

SMF spam blocked by CleanTalk