Playing Songs

From OPU Wiki

So, the song-list: HOW the heck do i play those in-game songs ? The songs are obviously set up using TethysGame::SetMusicPlayList The procedure accepts 3 params: 2 indexes (or was indices?) and a list of SongIds. Now to start with the latter: the SongIds are nothing more then an array of song IDs .. simple isn't it?


I've added the following lines to my Outpost2DLL.h, but until such time that a uniform NEW version of this header becomes available - it is subject to change, so don't complain if your own source files won't compile anymore after you've downloaded any new version of the mentioned header. In other words: no guarantees and no liability crap about this posting, okay?

Here we go (this is the way you will find it in the SDK in enums.h):

enum SongIds {
songEden11= 0x00,
songEden21,
songEden22,
songEden31,
songEden32,
songEden33,
songEP41,
songEP42,
songEP43,
songEP51,
songEP52,
songEP61,
songEP62,
songEP63,
songPlymth11,
songPlymth12,
songPlymth21,
songPlymth22,
songPlymth31,
songPlymth32,
songPlymth33,
songStatic01,
songStatic02,
songStatic03,
songStatic04,
songStatic05
};

The way you use those enums is by creating an array of type enum SongIds (as expected):

SongIds songs[]={ songPlymth11, songPlymth12, songEP51, songEP52 };

This will set up the game to play those 4 songs (Plymth11.raw; Plymth12.raw; EP51.raw and EP52.raw). The other 2 params are important:

  • Param1 sets the array size: in our case it should be 4
  • Param2 tells op2 where to re-start playing after it's done. To explain this i've put 2 songtypes into the SongIds list. When i set param2 to 0 it'll play all 4 songs, then return to song ID#0 (=Plymth11) and start over again etc... When i set param2 to 2 it'll first play all 4 songs, then return to song ID#2 (=EP51) and continue from there..indefinately! This gives the player those 2 easy/soft songs, and then go on to the uptempo EP-songs, and never go back again (unless you restart the mission)

This should play the songs i've explained above:

TethysGame::SetMusicPlayList(4,2,songs);
Personal tools