User Tag List

Results 1 to 8 of 8

Thread: Using INI data files in XNA

  1. #1
    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)

    Using INI data files in XNA

    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\\running free-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!

  2. #2
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,003
    Mentioned
    20 Post(s)
    Tagged
    2 Thread(s)
    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.

  3. #3
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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!

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Can you post this bug in the XNA bug box section?
    This way I will not miss it and correct it (when Fusion 2.5 is over)...

  5. #5
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JasonDarby's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    4,925
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    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.IsolatedStorageExceptio n' occurred in mscorlib.ni.dll but was not handled in user code

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleXNA Export Module
    Dobermann's Avatar
    Join Date
    Feb 2009
    Location
    France
    Posts
    630
    Mentioned
    24 Post(s)
    Tagged
    0 Thread(s)
    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.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleXNA Export Module
    Dobermann's Avatar
    Join Date
    Feb 2009
    Location
    France
    Posts
    630
    Mentioned
    24 Post(s)
    Tagged
    0 Thread(s)
    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.

Similar Threads

  1. [BUG 256.34 Unicode] Can't load Binary Data files
    By Olivier in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 30th January 2013, 06:06 AM
  2. Where to place the data files for a MMF2 program.
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 16
    Last Post: 2nd July 2009, 03:57 AM
  3. getting data from .txt files
    By ajp in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 30th January 2008, 04:54 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
  •