The Daily Click ::. Forums ::. Klik Coding Help ::. A stable global technique?
 

Post Reply  Post Oekaki 
 

Posted By Message

Retainer



Registered
  02/06/2005
Points
  218
23rd March, 2008 at 07:07:15 -

I need to be able to access a whole bunch of values globally. Which technique of bringing them global is the most stable?
Just making the objects global crashed the game consistently.

Also, is there a way to "freeze" all the object and counter values in a frame while going to a different frame for a couple of seconds? Or do I have to copy everything over in INIs to make it really stable?

Thanx!

 
Alien Invasion. Going forward!
http://www.create-games.com/project.asp?id=1092

Retainer



Registered
  02/06/2005
Points
  218
23rd March, 2008 at 08:44:23 -

Oh yeah, stupid me. I'm using MMF2.

 
Alien Invasion. Going forward!
http://www.create-games.com/project.asp?id=1092

-Nick-

Possibly Insane

Registered
  24/11/2002
Points
  2468

VIP Member
23rd March, 2008 at 08:51:35 -

I find it hard to believe that it was global objects causing the crash, did you actually completely narrow it down to the crash being caused by them?

Personally, i would use one of the array objects to save data between frames.

Alternatively, do everything in the same frame. From what you describe it sounds like you just want to build a menu or inventory or something similar? It's perfectly possible to create that inside the main game frame. Just remember to pause your game and bring up the menu on a higher layer, then resume the game when the play exits the screen!

Image Edited by the Author.

 
Project: Roller Coaster is on it's way!
http://www.projectrollercoaster.co.uk/
http://www.craftsncreatures.com

Retainer



Registered
  02/06/2005
Points
  218
23rd March, 2008 at 09:22:35 -

Yeah, I pretty much isolated the problem to making the active objects global holding the buying and selling information in the menu frame. When the only modification I make is them non-global, I can jump from the menu frame and the level frame without problems. When they are global, I can only jump to the menu frame once and back. The next time, the app will crash.

I had the menus in the level before, but the menus grew too complex to be worth it.
example :
Image

I found a really interesting way of doing it in this thread:
http://www.create-games.com/forum_post.asp?id=215351&show=all#post_215562

Ofcourse, when using the exact technique described by DeadmanDines, the game crashes when exiting down the sub-application when in menu frame.

Feels more and more like I can blame the extraordinary stability of Vista on this one..

 
Alien Invasion. Going forward!
http://www.create-games.com/project.asp?id=1092

-Nick-

Possibly Insane

Registered
  24/11/2002
Points
  2468

VIP Member
23rd March, 2008 at 09:34:32 -

With a game like that you really, really, really want to be using an array.

 
Project: Roller Coaster is on it's way!
http://www.projectrollercoaster.co.uk/
http://www.craftsncreatures.com

Retainer



Registered
  02/06/2005
Points
  218
23rd March, 2008 at 09:39:30 -

Hmm, think I solved the problem. I had a couple of Magic Deques global in the level frame which caused the program to crash when re-entering the level. I don't need them global anyways since the current level automatically pauses with this awesome sub-application thing.
Too bad though I can't seem to have anything at all global

 
Alien Invasion. Going forward!
http://www.create-games.com/project.asp?id=1092

-Nick-

Possibly Insane

Registered
  24/11/2002
Points
  2468

VIP Member
23rd March, 2008 at 09:43:35 -

I personally have never had a problem with global things. It might be the way you're using them as opposed to them actually being global. All the crashes i've had in MMF have been my fault rather than MMF.

 
Project: Roller Coaster is on it's way!
http://www.projectrollercoaster.co.uk/
http://www.craftsncreatures.com
   

Post Reply



 



Advertisement

Worth A Click