Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → MP3s in MotS.... Sort of...
MP3s in MotS.... Sort of...
2002-11-09, 2:15 AM #1
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.

[http://www.theswanfamily.freeserve.co.uk/Mp3logo.jpg]
2002-11-09, 3:04 AM #2
Oh my goodness, nasty idea man. Looks cool, it would be great for an sp mots level [http://forums.massassi.net/html/eek.gif]
Team Battle.
2002-11-09, 3:11 AM #3
Now that I think about it couldnt you load the last bitmap into the program... I dont know how to do it as its been awhile since I've done windows cased operations in vb. Then you could just check for the next one? (cause its just an array)

Anyways theres another way you can recieve messages, through triggers in mp that are broadcasted. But you need to need to know what format they are sent in :/ I might take a peek.
Team Battle.
2002-11-09, 4:04 AM #4
Neat idea... yeah, polish it up and release it... as a tutorial/program package, preferably. Just remember to allow the user to select the program to play the MP3/MIDI/whatever files.

------------------
The Mega-ZZTer's Gaming Haven!

New and improved! With a brand new chocolately taste!

2002-11-09, 4:12 AM #5
Thanks for the feedback. It should be able to play any files the Windows Media Control can play (which includes MP3s, MIDI and a whole bunch of other stuff).
2002-11-09, 4:13 AM #6
The only problem I could see with it is that JK/MotS pauses for a second when taking a screenshot, does it not?

------------------
His pot is blacker than his kettle!

Phoenix Swords
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2002-11-09, 4:16 AM #7
Yep, it does, but on any reasonably modern computer the pause would be unnoticeable. On my P600 it pauses slightly in 1280x1024, but in 640x480 you can't tell.

Also, long music files would often be used mainly for cutscenes, so a small pause wouldn't matter anyway.

[This message has been edited by Chris Swan (edited November 09, 2002).]
2002-11-09, 6:25 AM #8
Why didnt I think of that? [http://forums.massassi.net/html/frown.gif]


A great idea, d00d. But 1 thing, clean up that interface!!
And when the moment is right, I'm gonna fly a kite.
2002-11-11, 2:19 PM #9
And then you can seemlessly integrate it into one big ol' ap that runs MotS thru a batch, plays MP3s, etc.

When you do release this to the community, could you consider releasing the source (which would then be available for a program as mentioned above, with credit given to you)?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-11-11, 5:11 PM #10
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
Why didnt I think of that?</font>


Becuase you suck! HAHAHAHAH! [http://forums.massassi.net/html/wink.gif] No really, I don't know, I didn't think of it either, it's a very clever idea! Just a cheap trick, but what's wrong with cheap tricks? *Glares at his drivable swoop for JO SP* [http://forums.massassi.net/html/smile.gif]
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2002-11-12, 5:56 AM #11
Yep, sure. I'll release the source code too. I'm not a very good VB programmer, but the program's not too complex, so it shouldn't be too hard to see what everything does.

↑ Up to the top!