Ok, now I've got my handy dandy menu screen right? Whelp... How do I work a Load... I kinda need help is there any sort of tutorial or example someone could show me or could someone give me steps for saves and loads.... Please
~Katie
Ok, now I've got my handy dandy menu screen right? Whelp... How do I work a Load... I kinda need help is there any sort of tutorial or example someone could show me or could someone give me steps for saves and loads.... Please
~Katie




There are a number of ways to save information from an MMF2 game, so picking the right one for your needs might be the hardest part.
To start off with, the latest version of MMF2 (b245) has a couple of actions that instantly load and save the state of a frame, or of your entire application. I haven't actually tried these out yet, but they allow an entire state to be saved without much work from you. There is one catch that I know of - any information that's kept in extensions that Clickteam didn't write won't be saved, because there's no way for those extensions to communicate that they should be saved as yet. Still, if your game doesn't use any extensions to hold vital data, this method might work for you.
Similar to the above is the Save Game object, which I think is installed with the first bonus pack. That's also good for instantly saving a lot of game information, but unfortunately it doesn't look like it saves global values along with the state of a frame.
There are also more manual ways of saving data, which are a bit more trouble to get set up but are more powerful in the end because they let you decide what to save. I think a good object to start off with is the INI object.
INI files are plain text, readable through a text editor, that contain groups of items with values or strings. An example short INI file might look like:
[GroupName]
Jam=94
Magnets=5
PlayerName="Jeff"
Question="Does my jumper weigh more than seventeen walnuts?"
The INI object that comes with MMF2 is for interacting with these files. To use it, drop it into your frame and use the "Set file" action at the start of the level to point it to the file you want to use as your save game. (If the file doesn't exist, it will be created as blank.)
Now that I look at it, I think its actions are worded confusingly for beginners. "Set value (group-item)" or "Set string (group-item)" are the ones that you should use most of the time for writing information to the file - the first value you give it is the group name to save to, then the item name, then eventually the value to give to that group and item - in the case of saving a global value, you'd put 'Global Value A' into the last dialog box to save whatever value was in Global Value A at that time.
To load from the INI, you have to set the global value back to whatever value is in the INI yourself when the frame is loaded. You can do this by using "Set global value" as normal, and getting data from the INI object - something like GroupItemValue$("INI Object", "GroupName", "ItemName") will retrieve the value in the INI file.
With a few of those events, it's possible to save a number of values to a file and retrieve them back when a game is loaded. I did an example of this kind of thing a while ago, at http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Board=5&Number=23445 - it's a slightly more advanced system that takes the value of a counter and uses it to change the name of the value that's being loaded, but the idea is the same.
The INI object is a good start, but eventually you'll want to move away from it and into a format that can't be modified by the player quite so easily. The Named Variable Object (bonus pack 1 or 3, I think?) is what I'm using for my current game, and what it stores is a list of variable names and their values and strings, in much the same way as INIs (but without support for groups). It can be switched between using plain INI/CSV files or more encrypted files that the user won't be able to change.




Having non-editable saves is very important to me at the moment because I'm allowing players to upload their save files to produce an online scorecard - however, it all depends on what kind of game you're making and how you're using the save.