Author Topic: Playlists?  (Read 1459 times)

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3237
Playlists?
« on: November 17, 2005, 06:47:04 PM »
I think we can all agree that the normal playlist for OP2 gets irritating. (Unless you didn't download op2.clm, you lazy music-hater you). So, how do I get this darned SetMusicPlaylist thing working right/not crashing the game? (I do that a lot...)
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Playlists?
« Reply #1 on: November 17, 2005, 06:56:10 PM »
Code: [Select]
	static void __fastcall SetMusicPlayList(int numSongs, int repeatStartIndex, enum SongIds *songIdList);

The first parameter is the number of songs in your playlist. This is used to bounds check the array, so make sure this is set right or you can get crashes. The last parameter is a pointer to an array of song indexes. This is the actual playlist. The second parameter is where to continue from once the playlist has reached the end. It doesn't have to start again at the first song. It might loop back to halfway through the playlist if you wanted. Thus, there is certain songs that might only be heard at the beginning of the level.

You can check Enums.h for a list of song names (based on filenames).

Example:
Code: [Select]
SongIds newPlaylist[] = { songEden11, songEden12, songEden13 };
TethysGame::SetMusicPlayList(3, 0, newPlayList);
This would play those 3 songs over and over.

Code: [Select]
SongIds newPlaylist[] = { songEden11, songEden12, songEden13 };
TethysGame::SetMusicPlayList(3, 1, newPlayList);
This would play the first song once, and then play the second two oevr and over.
 

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
Playlists?
« Reply #2 on: November 17, 2005, 08:01:07 PM »
hmm, somehting ya'll asm-readers should check out is the code for the menu music: ive had it play songs in the dir [ as wav files ] with no effort on my part  , and then finally go to the reg music. consitantly as well. might be worth checking out

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Playlists?
« Reply #3 on: November 17, 2005, 08:35:02 PM »
Err could you clarify that a little? Did you put extra wav files in the dir and they got played? Or did you replace the original? I'm not too sure what you've done here.
 

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3237
Playlists?
« Reply #4 on: December 08, 2005, 03:39:42 PM »
Yes, please elaborate. I'd like to know what you're talking about.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
Playlists?
« Reply #5 on: December 08, 2005, 03:41:18 PM »
yep, just chucked a pcm wave file in there and it playe dit first. tyed it w/ multiple and it played them in order. looks like its going alphabeticly.