I was working on my game last night very dilligently when all of the sudden (and for no foreseeable reason) things began to REALLY screw up. MMF started confusing the values for my game's two global numerical arrays at random! What I mean by this is that it'd think that the 1st array's #5 slot was the 2nd array's #5 slot and so on... even WITH THE CORRECT FILENAMES AND ETC.
At first I thought that maybe I had switched the arrays somewhere when a value was changed or a file was loaded / saved, but after MUCH testing I found the coding to be correct. Everything I looked at was right. So then I tried to save each array whenever leaving a frame, and load the arrays at the start of the next frame. This of course, shouldn't have to happen since they are both global, but I figured why not I may as well try it since I worked so hard on my stupid game already. So after a long time I had it done... and? It STILL didn't work! The same values were still mixed up and I didn't know why.
Then I figured that maybe MMF couldn't load both arrays fast enough since they were both on the same event line so I put the load / save files separate from the other events of that line. Nope! How about if I re-arrange the event order? NOPE!! How about if I use a timer to give the program a "pause" while the game loads it up and gives it enough time??? NO WAY, STILL SUCKS!
To make this LONG-ass story longer, the only way I was able to fix this was to basically scrap the smaller array and combine everything into a single global array. And now, finally, it works as it should
All of this took about 3 hours of time that should have been spent on better / more fun elements. For whatever reason, MMF seems to confuse values if you have 2 (or more?) global arrays in your program. Unless it's just my copy! I wanted to share this with people so that they can avoid this awful, awful lesson in debugging hell. If your game can use only one global array, I suggest that you just use the one and everything should be okay!
Edited by the Author.
Edited by the Author.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
8th March, 2007 at 04:59:49 -
I only ever needed arrays in other programming languages, but have had no need for them in MMF yet. I will when I make a level editor and the like though.
Old member (~2004-2007).
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
8th March, 2007 at 05:28:15 -
Hi. I'm not banned.
Old member (~2004-2007).
DaVince This fool just HAD to have a custom rating
Wow, that's strange as I've used arrays in all but 2 of my MMF games so far. Maybe it's because I got so accustomed to having them in my VB projects? Anyhow, you're all welcome as it really is the biggest pain in the ass to see when bad things happen to your game like this did!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
9th March, 2007 at 01:36:40 -
Hi.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath