Recently I had a problem with zX where Game Maker: Studio gave me the error “Unable to find audio resource – using default sound (Windows Ding)” after a bit of investigating I found that this was due to the file that was being pointed to by the .sound.gmx while had an absolute directory as opposed to a relative one, which cause GM to miss a file that it a simple reference to.
So Game Maker was pointing to D:\Games\zX-Hyperblast\Studio\hyperblast\zX_Hyperblast.gmx\\sound\audio\snd_death_cyborg_large.wav instead of just snd_death_cyborg_large.wav
There were about 76 of files with this kind of error in them. So I wasn’t going to sit around and hand edit all of them, the GM editor is rather slow, and I doubt hand editing each .gmx file was going to be much faster. So I wrote some python programs to edit them for me. (I think it likely took me longer to write the programs than it would have taken to just edit the bloody files, but the practise was good. And hopefully I can share some tools with other people to help them out.)
The two scripts GMSoundDiff, and GMSoundSimple sorts through the .gmx files and browsers the xml to see where it is pointing and if there is a file at the location it is pointing, if there isn’t it will write the name of the .gmx file and the name of the audio file it is trying to find. GMSoundSimple will strip out the absolute directory of the sound files so they will just be relative, but there are a couple of implementations that are specific to zX in there, but I rather doubt those are likely to be that big of an issue, and if people really want to use them I can go back and fix up the scripts so that they are more generalized for people to use.
I suppose that there are two quirks that go with this. The scripts are command line and require you to have Python 3.3.x+ installed and you your path to bash the scripts. The scripts will also only work if placed in the Sounds file in Game Maker. This unfortunately does mean that this is really more something for programmers to speed up debugging GM than something for every GM dev to just use. I’m likely going to write more scripts for speeding up working with GM as I go along and find annoying places where the editor is simply lacking, and when I accumulate enough of these I’ll probably just bundle them to gether into a neat little programme that you can point at a GM project and it will just work from that. But I really woulnd’t expect that any time soon.
The scripts have a nice little GitHub Repo and if you want to know more about the scripts or are actually using them I would suggest getting in touch with me on Twitter if there is something going wrong with the scripts.*
*Disclaimer: these scripts will edit you .gmx files which Game Maker DOES NOT recommend you do! So you do so at your own risk. You might want to be using a Version Control System to make sure that you do lose any essential data.