User Tag List

Results 1 to 6 of 6

Thread: Best way to do multiple Save Slots?

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,416
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Best way to do multiple Save Slots?

    I am doing a game that I think will benefit from having the player choose 1 of 3 save slots instead of just having everything in one save.

    My question is what would be the most convinient way to do this? I am using ini and it must be compatible with Flash. My initial thought was to just use 3 ini:s for each save slot, but I don't know if that is supported in Flash? Can Flash apps store multiple ini:s? (I think they are stored in the cookies).

    I don't know how to program this in a smooth way though if I used 3 of them because now I just have events that store the group item and value in one ini. I would need some way to easy make the event pick the right ini first so I don't have to have 3 times as many events for each ini..

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Apr 2009
    Location
    Florida
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, never did it in flash, but for a windows .exe with a multi save for 3 profiles i have done this int he past.

    start of frame> set directory path to save location (all_documents, etc)

    every .01 seconds> check 'if file exists' "profile1" if it does make PLAYbutton1 visible (and player presses it to start profile1) and CREATEbutton2 invis

    if file does not exist, then make CREATEbutton2 visible, if this gets clicked, it will create the file "profile1"
    this will then make PLAYbutton1 visible and turn CREATEbutton2 invis

    if that makes sense to you, you should be able to adapt it...

  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)
    You can save it all in one ini file... Just save groups/items like this:

    Group1,Group2,Group3
    Item1,Item2,Item3

    When the player picks a slot to save or load from, just set a global variable for that slot number (1, 2, or 3) and then when you access the ini file to read/write data, just include that global variable in the group/item names:

    "ini item name" + Str$(global variable)

    So say you have a "health" value that you store for each player. It would store in the ini as "health1" for player 1, "health2" for player 2, etc.

    An even cleaner method would be to just store all ini items into separate groups for each save slot... so like:

    Group_1, Group_2, Group_3 would be your 3 save slots and then you'd just change to whatever group your save slot is on and save/load items from that group.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can save multiple inis in flash.

    Best to do is name inis like this: "SaveSlot"+Str$(slotnumber), so you can easily access the ini depending on the slot you are currently in and do a simple check whetever the slots exists.

    Have first item in ini when you create a slot to exists=yes

    (to check create slots)
    Make a loop but not fastloop(you need i think atleast 1 refresh to load another ini)
    load ini "SaveSlots"+Str$(LoopIndex)

    compare to item "exists"= yes... load some stats from it etc..
    otherwise if that condition does not trigger you just percieve that slot as empty

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,416
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I don't seem to be able to do a number to string conversion when trying to retrieve from the ini? I just get an error :s Maybe I am writing it wrong?



    GroupItemValue( "Group"+Str$(SaveSlot), "Item", "Value")

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I meant that you use that in the ini filename, you should be able to so by doing set current file to "SaveSlot"+Str$(slotnumber)

    Your "GroupItemValue( "Group"+Str$(SaveSlot), "Item", "Value")" does not work because there is no value in that expression, it goes like this:

    GroupItemValue( "Ini", >Group name<, >Item name<)

Similar Threads

  1. How much slots does a string use?
    By BartekB in forum Lacewing
    Replies: 7
    Last Post: 27th September 2013, 10:11 AM
  2. Best way to save data I need to sort multiple ways?
    By TheDigitalAlchemist in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 23rd April 2012, 11:59 AM
  3. Saved Game Slots
    By gamer123 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 29th January 2012, 08:38 PM
  4. Making items & item slots for RPG, please help.
    By Iwantmyrpg in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 28th August 2008, 08:36 AM
  5. Ways for INIs to save multiple game files?
    By Jdsfrog in forum Multimedia Fusion 2 - Technical Support
    Replies: 31
    Last Post: 15th April 2008, 05:02 AM

Posting Permissions

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