The Daily Click ::. Forums ::. Klik Coding Help ::. Here's a little tip that might spare you hours of frustration, Clickers
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
7th March, 2007 at 18:34:27 -

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!




Image Edited by the Author.

Image 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!

viva/volt

Awesome Sauce

Registered
  26/08/2006
Points
  1694

Game of the Week WinnerSilverNova MemberKlikCast StarVIP Member
8th March, 2007 at 01:39:41 -

I'll remember that, when I ever get round to using arrays...

 
Image
http://bfollington.tumblr.com

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
8th March, 2007 at 02:13:53 -

Well... yeah.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
8th March, 2007 at 04:17:30 -

Thanks. An useful piece of information if I ever need to use arrays.

 
Old member (~2004-2007).

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
8th March, 2007 at 04:51:43 -

*repeated for .. emphasis*

Thanks, if I need to use arrays I know where to come

 
http://www.SilverNova.co.uk


DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
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

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
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

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
8th March, 2007 at 06:53:54 -

Hi Matthew

 
Old member (~2004-2007).

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14444

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
8th March, 2007 at 19:09:24 -

I want to talk to my ectoprods friends. Hello guys!

 
.

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
8th March, 2007 at 20:15:14 -

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

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
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
   

Post Reply



 



Advertisement

Worth A Click