I've developed a way of playing MP3s in MotS. Well, not exactly in MotS, but with an external program that can be called by a cog at any time. Of course, this means it would work for MIDI as well, or any other sound file you want to use.
It all began when I saw a thread here where someone asked if it was possible to reference an external program with JK or MotS, and the answer he got was a firm "No". There's no way to do this directly through cogs, but it got me thinking of what files JK and MotS create or modify when they're running. The most obvious one is the screenshots. When you take a screenshot in JK or MotS, a .bmp file is written to the game directory with the name shotxxxx.bmp, where xxxx is a number starting from 0000 and working upwards. Working with this knowledge, I created a Visual Basic app that continually scans the JK or MotS folder for new screenshots and checks their number. Then, depending on their number, a Windows Media control plays a certain MP3 (or MIDI or whatever). You'd run this program before running MotS.
Since screenshots can be taken by using the cog verb jkScreenShot();, the program can be referenced at any time by a cog.
I've tested this, and it works fine, but there are some limitations:
1. It only works with MotS, since jkScreenshot(); doesn't work in JK.
2. It currently only allows five different MP3s to be played when five different sectors are entered, but this can be increased easily. It's unlikely you'd need more anyway, because you'd probably only use MP3s for a couple of long music tracks in your level.
3. It relies on there being no screenshots in your MotS dir before you start the game, but I can easily make it work even if there are.
4. You can't take screenshots normally (F12) whilst playing the level, or it would mess it up. You can disable normal screenshots by using playeraction.
5. You have to type your MotS dir and the names of the files to play into the VB app, but I'm working on a save/load system for config files so the level creator set up the system and the player of the level won't have to do anything apart from start the program and type in their MotS dir.
6. Unwanted screenshots are left in the MotS dir, but I'll fix this by getting the VB app to delete them when you quit.
If people are interested, I'll do some more work on this and then release it to the community.
It all began when I saw a thread here where someone asked if it was possible to reference an external program with JK or MotS, and the answer he got was a firm "No". There's no way to do this directly through cogs, but it got me thinking of what files JK and MotS create or modify when they're running. The most obvious one is the screenshots. When you take a screenshot in JK or MotS, a .bmp file is written to the game directory with the name shotxxxx.bmp, where xxxx is a number starting from 0000 and working upwards. Working with this knowledge, I created a Visual Basic app that continually scans the JK or MotS folder for new screenshots and checks their number. Then, depending on their number, a Windows Media control plays a certain MP3 (or MIDI or whatever). You'd run this program before running MotS.
Since screenshots can be taken by using the cog verb jkScreenShot();, the program can be referenced at any time by a cog.
I've tested this, and it works fine, but there are some limitations:
1. It only works with MotS, since jkScreenshot(); doesn't work in JK.
2. It currently only allows five different MP3s to be played when five different sectors are entered, but this can be increased easily. It's unlikely you'd need more anyway, because you'd probably only use MP3s for a couple of long music tracks in your level.
3. It relies on there being no screenshots in your MotS dir before you start the game, but I can easily make it work even if there are.
4. You can't take screenshots normally (F12) whilst playing the level, or it would mess it up. You can disable normal screenshots by using playeraction.
5. You have to type your MotS dir and the names of the files to play into the VB app, but I'm working on a save/load system for config files so the level creator set up the system and the player of the level won't have to do anything apart from start the program and type in their MotS dir.
6. Unwanted screenshots are left in the MotS dir, but I'll fix this by getting the VB app to delete them when you quit.
If people are interested, I'll do some more work on this and then release it to the community.