The Daily Click ::. Forums ::. Klik Coding Help ::. Arrays and Sub-Apps
 

Post Reply  Post Oekaki 
 

Posted By Message

CUBE



Registered
  04/12/2004
Points
  283
10th November, 2006 at 07:51:13 -

Is it possible to open an array in the main window of my game, and have the same instance of that array open in a Sub-App? Because I don't want to save the array until the user wants to save, so I can't just save and load when switching between the windows.

 
n/a

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
10th November, 2006 at 08:46:54 -

You could perhaps save and load to a temp file (in case the user doesn't want to keep the changes to the actual file).


If you tell the array to save, but you DON'T give it a path (so you only enter a filename, like "arrayfile.arr"), it'll automatically save it in the temp folder of the application.

You can then reload it again by doing the same thing. Do a 'load' action, but just type the filename without specifying a path.

MMF will automatically delete the temp files when you close the application, so you don't need to worry about cleaning them up afterwards.

 
191 / 9999 * 7 + 191 * 7

Werbad



Registered
  18/09/2002
Points
  235
10th November, 2006 at 15:13:08 -

Can't you make the array object global then? I'm not sure if it works over Sub-apps

 
n/a

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
10th November, 2006 at 17:04:48 -

I tried it and it didn't seem to.

 
191 / 9999 * 7 + 191 * 7

CUBE



Registered
  04/12/2004
Points
  283
10th November, 2006 at 19:23:16 -

The temp thing didn't work, because it saved the array in the directory of the EXE and didn't delete it once the program ended.

 
n/a

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
10th November, 2006 at 20:41:01 -

I've done something similar to what Dines is talking about before, where you have a temporary gamefile that the player uses for the game's entirety. Only when it's save / load time does it actually save to the real gamefile. I find it works well.

 
--

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

CUBE



Registered
  04/12/2004
Points
  283
11th November, 2006 at 05:26:07 -

Ah ok, I've got it working that way now. Thanks for the help

 
n/a
   

Post Reply



 



Advertisement

Worth A Click