Loading Multiple Ini Files

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I would like to create a "save game system" using ini files.
    However, instead of only having one ini file, or a predefined number of "save slots", I would like there to be no limit.

    I messed around with this a bit whilst stuffing my face with easter chocolates yesterday..
    I've managed to create various ini files, but cant seem to figure out how to display these various files to the user for selection.

    I envision this being some sort of list that is populated with the names of all of the various ini files - the user clicks on the name from the list, and the information is loaded.
    Cant figure the list part out - any thoughts?

  • The File-Folder extension allows you to run a browsing loop on a folder, which returns all of the files in the specified folder. You could use that to load all of the ini files from your game's save directory. However, the disadvantage of a method like this is that it is only compatible with the exe runtime.

    If you want something that is compatible with all runtimes, then each time you create a new ini file, add an item to a list, which would contain the names of each of the ini files. Save the list, and then when you want your user to be able to load the ini files, load in the list, and you can display that to the user.

  • Game_Master - Thanks for taking the time to reply.
    It would be ideal for this application to run on all available runtimes, so I dont want to lock myself into limiting extensions..

    I understand the concept of what you are proposing - what I don't understand is: once the list of the ini file names is created, where is all of this list data stored? If I want to be able to restart the application and load one of the various saved files, obviously this list information needs to be saved as well.. So, would I use an ini for that as well? Like, one master ini that stores all of the names of the various ini save files?

    I appreciate your time on this!

  • Hi everyone,
    Another option would be to create a kind of chained-list using two parameters in each INI file telling which file is the next one and which one is the previous one.
    ouly

    Please login to see this link.

  • I understand the concept of what you are proposing - what I don't understand is: once the list of the ini file names is created, where is all of this list data stored? If I want to be able to restart the application and load one of the various saved files, obviously this list information needs to be saved as well.. So, would I use an ini for that as well? Like, one master ini that stores all of the names of the various ini save files?


    The list object allows a list to be saved (so you could save the list to the same directory as your ini files).

    You could have a system like this:
    1. At the start of the frame, load the list (e.g. "save_list") from a file into the list object.
    2. When the user saves the game as a new save, add an item to the list object containing the name of the ini that the save is associated with. Then save the list (the list object has this functionality) to your game directory (it could be the same location as your ini files).
    3. If the user wants to load a save file, display the list object to them, and ask them to select the name of the save from that list.
    4. When the select a save, you can use the selection of the list object as the file name of the ini file.

    I can make an example if you want - just let me know.

  • Game_Master - I've never played with the list object, so I was unaware of its built-in save functionality.
    I really appreciate you taking the time to expand on this topic.
    I'm going to play around with it this afternoon, and see if I can get something working.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!