Saving and recovering INI info as binary data (Windows)

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.
  • Hi everyone,

    I have been working through the guide document on using Binary data, and reading a lot of the forum posts, and I think I have it halfway working... I am trying to use an INI file that contains all the level unlocks and scores for my game, and include it as a Binary Data element. As far as reading/writing to the temporary binary file, so far so good--everything is cool until I exit and restart the application. Upon exiting and restarting, the game is no longer able to locate the save data from the previous session! I am using these actions:

    Extract Binary File: Apppath$ + "SaveGame01.ini"

    Set current file to: BinFileTempName$(Apppath$ + "SaveGame01.ini" )

    (Saving to/Loading from INI...)

    Release binary File: BinFileTempName$(Apppath$ + "SaveGame01.ini" )


    The actual path where the file exists is [C:\Disastr_Blastr\SaveGame01.ini]... I tried using this in the Extract and Release actions (as Danny does in the .pdf guide) and it did not work, nothing was saved or loaded unless I created the directory C:\Disastr_Blastr--in this case the game would generate a normal INI.

    Does anyone know what the problem is? How can I get my .exe to recover existing Binary Data after exiting and restarting the application? Thanks!

  • Binary data is data that is embedded within your EXE. When you open it, it is saved to a temporary location on your hard drive, which is why you need to access it through the binfiletempname function. When the application is closed, these temporary files are deleted. These files are also deleted when you 'release' the binary file. You cannot resave binary data back into the application.

    If you want to store player data that is persistent I would recommend saving the data somewhere else. Binary files would be useful to help create an initial or blank save file, which you could then copy somewhere else to save if that was needed.

    ---

    SUPER MEGA BEST CAT ADVENTURES Please login to see this link. and Please login to see this link. live now!

  • Ok, so maybe Binary Data isn't the best solution for what I am trying to do... The way I originally had this set up was an INI object that would create and update the file "SaveGame01.ini" in the directory C:\Disastr_Blastr. This works perfectly (as long as C:\Disastr_Blastr exists) but I would like to avoid forcing the user to create this specific directory. As a side benefit of converting to binary, it would also be nice if the save data were not easy to modify with a text editor... But the main point of what I am trying to accomplish with binary data is to allow players to simply double click the .exe and play the game without having to worry about where their save data is getting stored. Is this achievable?

  • I'm on my mobile and not near a computer with fusion, so may not be exact., But you don't need to use binary files to accomplish that.

    Just use the INI object and have an event:
    start of frame: (INI)Set current file to : "Appdir$+"myfile.INI" "

    Now I can't remember if Appdir$ returns the path and a closing slash "\" (e.g C:\Disastr_Blastr\) or if you need to include it yourself e.g "Appdir$+"\myfile.INI""

    Appdir$ is an expression built into fusion which returns the directory in which the application is being run from.

  • Hey guys, I'm having trouble finding out where to post questions concerning the audio engine without being a registered user. I am not a ClickTeam user, I am working with Joel here to get audio in his game, but we have some issues with the levels. My question is this, what are the limitations of the audio engine and what workarounds to people normally employ to ensure that the audio levels for music and and sound effects are able to work in tandem without issue?

Participate now!

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