User Tag List

Results 1 to 3 of 3

Thread: Loading & SAVE'D

  1. #1
    No Products Registered

    Join Date
    Oct 2007
    Location
    Ash Fork, AZ (USA)
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loading & SAVE'D

    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

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loading & SAVE'D

    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.

  3. #3
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Loading & SAVE'D

    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.

Similar Threads

  1. Save As: How to save a string or list and set its filename at runtime?
    By rubes in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 16th March 2013, 05:43 PM
  2. Odd Glitches with Loading from Last Save
    By Karl in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 1st January 2010, 09:46 PM
  3. Graphics Glitch with Loading from a save
    By Karl in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 28th December 2009, 08:51 PM
  4. Save status of entire game (load / save values)
    By DEKE15 in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 13th September 2009, 10:17 AM
  5. Globally Save Object (Global Save Object)
    By Max in forum Extension Development
    Replies: 0
    Last Post: 21st July 2007, 04:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •