I finally figured it out. It is the stupidest bug ever, and it isn't my bug at all. I'm afraid I'm going to blame DBP for this one.
The crash wasn't directly related to the sound, it was happening during the sound loading. The way it works is every sound is an entity based on an event. For example, the 'walk' event can have 20 sounds associated with it. When you 'playSound("walk",x,y,z,mustplay)' it picks one of those sounds and plays it. It works the same for music.
Anyway, when you engine starts up it loads every entity script file, parses it, and reads values from it. You request a value like this... 'findScriptValue$(name$)', 'findScriptValue(name$)', and 'findScriptValue#(name$)', where name$ is the variable name you are requesting the value of. If you request a value that does not exist it simply returns a 0 or a blank string. No problem, it works every time.
The exact cause of the crash was requesting a string script value that didn't exist and then asking for any string script value. When you requested a new script string value it would immediately crash, but wouldn't execute a single line of code from the function that was crashing it. It's hard to debug something when nothing is being executed. Here's the function in question...
function findScriptValue$(tvariable$)
value$=""
tvariable$=trim$(fast lower$(tvariable$))
for iter=1 to commandCount
if commandList(iter).command=tvariable$
value$=commandList(iter).value$
exitfunction value$
endif
next iter
endfunction ""
Like I said, that works just fine under XP but it chokes in Vista, but not in a way that makes sense. But, when I changed the very last line it worked...
function findScriptValue$(tvariable$)
value$=""
tvariable$=trim$(fast lower$(tvariable$))
for iter=1 to commandCount
if commandList(iter).command=tvariable$
value$=commandList(iter).value$
exitfunction value$
endif
next iter
value$=""
endfunction value$
So passing an empty string doesn't crash the program, but causes it to crash the very next time that function is called. What the hell is this? Why would something so simple work in one OS and not another? It doesn't even actually get to the function before it crashes either. Maybe I'm just crazy and you should never return an empty string and I didn't get the memo. If I wasn't half insane I'd have never found this bug and I'd have ended up paying $50 to get Vista removed from my laptop. I guess life can go on now.
Thanks for the advice guys. Now that I've gotten past that let's see if I can make GH work for real in Vista.
[Edit]
GH does not run without crashing. But guess what, it doesn't work. Here's the game in progress...
The MP3s also take 9 years to load. Everything else is lightning fast, but it seriously takes 5 minutes to load the music alone.
I'd venture a guess that this my Nvidia 8700M GT drivers are to blame, but Nvidia doesn't have any downloadable drivers for that particular graphics card. They seem to have forgotten they sell it. I can't use the new DarkPhysics upgrade either because of this, thus I can't enter the competition. I just can't win
Vista itself is a nice enough OS, but it really sucks for what I'm trying to do with it.
Come see the WIP!