Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Save Game in MMF2


Proto Dan

Recommended Posts

Okay, so I want to know how to make a simple save game feature using Multimedia Fusion 2. Basically, every time you finish a level, I want the game to save automatically. Next time you open the game, it will skip to the level you were on most recently. None of the tutorials I found on YouTube (or anywhere, for that matter) really helped me. I'd really appreciate it if someone here could.

Link to comment
Share on other sites

You have several methods of saving data in MMF2. For small amounts of data, .ini files (encryption optional) are more than enough. If you manage more data, then an array would be better suited.

The logic behind this works as follows:

INI files have groups and items on them. A group can contain several items inside. With the ini object, what you want to do is write the frame of the level you're in (use get frame number expression) to an item, e.g. CurrentFrame. This item can be set as part of the SaveData group, along with lives and other variables. Finally, you write the file to disk. The following expression will save the file inside a "save" folder in the game's directory:

 

appdrive$+appdir$+"\save\data.sav
To load data, load the file through the ini object when the frame starts, and check if the saved value is different than 0. If it's not 0, then jump to the specified frame according to the file. If the value is 0 (or nonexistent), then proceed with a new game.

I think I had an example of this method lying around somewhere. I'll look for it and post back later.

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...