User Tag List

Results 1 to 5 of 5

Thread: How to save information between frames?

  1. #1
    No Products Registered

    Join Date
    Jan 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to save information between frames?

    Hello!

    I'm working on a platform/rpg-game in multimedia fusion 2. I guess the best way to make levels is to make a new one in a new frame. But the problem for me is that global variables and stuff like that resets on a new frame.

    That's a big problem for me because I want to save things like xp, gold and choise of class so It can be viewed on every level in the game. So atm you need to choose your class for every new level because I don't know how to save the players choice for all levels.

    So how do I do to make it save variables 100% globally so I can access the saved information on every level? Or maybe there is a better way to handle this kind of problem.

    Thanks in advance!

  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: How to save information between frames?

    Global variables shouldn't reset on going to a new frame... that's why they're global! It may be that there's an event on your new frame that's resetting the global value to something else before you can do anything with it.

    It's likely, though, that you'll want to use an external save file for a game of this type, and store your game information in something like the INI++ object.

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: How to save information between frames?

    Quote Originally Posted by busmumrik
    I guess the best way to make levels is to make a new one in a new frame.
    Well, not necessarily. Depends on your game. The best way might be to make a level editor and a level loader and then you'd only need one frame to load your saved levels into. Not saying that's the absolute best way, but all I'm saying is that there's not really a best way. :p

    But the problem for me is that global variables and stuff like that resets on a new frame.
    Definitely should not be happening.

    Also as far as advice for using an external save... Well yeah you'll probably need that, but I'm pretty sure it's not good to be reading/writing from an external file constantly during gameplay... so you'd still want to use something like global variables (or only load the initial values from the ini when the level starts and save them when the level ends)

  4. #4
    No Products Registered

    Join Date
    Jan 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to save information between frames?

    Thank you for a quick reply!

    Oh I didn't think about that, guess I have some events that are resetting my global values to something I doesn't want it to be. Need to check through the events more carefully.

    Just another question. I want to have a kind of world map where the player can choose a place and then you enter the level (the frame). And when you have completed a level I want the player to be able to go back to that frame again (from the world map) if they have missed something like gold or a chest. But I don't want the gold that have been taken and the monsters that have been killed to respawn again.

    So is it possible to make the game remember what objects that have been destroyed and don't make them respawn when the player enter again?

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: How to save information between frames?

    It's possible.

    The method you use really depends on how much stuff you need to check for. If it's just a couple things, you could get away with storing a global value/string or something like when the player opens a chest, set the global value to something, then when the player re-enters the level, have an event make the chest empty if that global value was set.

    If you're requiring a lot of stuff to remain the same though, you'd probably want to use the same method except save that info to an ini and load up that info when the player enters the level so that the level can adjust to match what the ini has stored.

Similar Threads

  1. How to Save data across frames.
    By TheSketchySide in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 23rd November 2013, 09:52 PM
  2. Few frames vs Multiple frames - game help needed
    By Marllux in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 4th September 2013, 04:13 PM
  3. Array Doesn Save more than one information
    By Decoamorim in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 30th August 2013, 10:36 PM
  4. How to carry information across frames
    By Warmachine in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 12th July 2010, 06:25 PM
  5. Trying to save/load between frames
    By frankodragon in forum File Archive
    Replies: 3
    Last Post: 26th May 2008, 06:49 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
  •