Using INI data files in XNA

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 just wanted to check how I should be using INI data files for XNA - I have two of them, one of which is a save that starts off blank and one that's a data file containing level information.

    I've added the data file (runningfree-x.ini) to my Binary Data in the data elements dialog box, and the INI object is just pointing to "runningfree-x.ini", but it doesn't seem to get included in the exported project. I've inferred from the debugger that Visual Studio expects to find these files in:

    "C:\\Users\\DavidN\\Documents\\SavedGames\\runningfree-xw\\Running Free Xbox\\Player1\\"

    I can manually put my data file in there and it works, but how does this approach work when exporting to the XBox itself?

    Thanks!

    Please login to see this link.
    Please login to see this link.

  • David - The Binary is already added to the CCN (IIRC); you also reference the entire binary filename, so if it displays "c:\myfolder\runningfree-x.ini" then that's exactly what you would "Set FileName" as in XNA. Ensure 'Use Application Directory' property (or whatever it's called) is checked.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • I am working on a game saving/loading system using INI files, and I think I am having this exact same problem.

    I created an INI file containing values that determine which game levels are locked or unlocked, and added it to the Binary Data tab (the file name is "SaveGame01.ini"). Then I set up an event like this:


    +Run this event once
    -Set current file to "SaveGame01"
    -Set current group to "LevelsCompleted"
    -Set current item to "Level1_2Complete"
    -Set global value Level1_2Complete to current value of INI

    This setup works great on the PC--I can see that the appropriate levels are unlocked based on this global value--but when I run the game on the Xbox nothing happens. The above explanation by Danny isn't totally clear to me... Is there something I need to do to the project in Visual Studio to get the Xbox to recognize and read this INI?

    Thanks for the help!

  • Thanks for responding Francois, I just posted it--Bug #344.

    I suspect there may be some workarounds for this issue, it seems that others have been able to use INI successfully with their XBOX projects, but right now this is really kicking my butt! I think I have tried every possible combination of events, with no success. Usually when I am this stumped by something it is because I am missing a really obvious answer. :) I will keep playing around with it and post again if I find a way to make this work.

  • Don't know if this is the same issue, but i am having problems with my game crashing on windows 8 phone when it trys to access a ini/array file.

    I've added them as binary files.. get this error in the Visual Studio when running the app in debug.

    An exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll but was not handled in user code

    Games Twitter : Please login to see this link.
    Websites: Please login to see this link. - Game Dev.

  • The only working way is to set the ini file to "CONTENT" (and not compile) below you setup "copy if newer", then you setup the two compilation process to "binary.something", and your app will correctly build with your ini file. The problem is, I don't know how to access a file added with the build... Auto-creating a file at firt run stay the best solution.

  • I found an easier way to add ini files to the project, set:
    -Build to "none"
    -Copy to "copy if newer"

    But the same problem remains, how to access the file with MMF... It seems that it ise easy if we use XNA code, but i don't know how the ini mmf extension for XNA works... It needs an update to setup TWO kind of access. One to read an write a document in the game cache, and one to read-only a document added with the game.

Participate now!

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