User Tag List

Results 1 to 7 of 7

Thread: INI Problem

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Captain_Harris's Avatar
    Join Date
    Aug 2011
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question INI Problem

    i have a problem with set a global value from ini.

    on start of frame i want to set a global value to the value in the ini.
    on the first run of the game the global value should be "1", ( i have set the global value to "1" )
    on start of frame it loads the empty ini file, so that the global value is not "1"

    i hope you understand what i mean. how can i do this ?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure if I get this right, let's see.

    I'd check if the value is 0, which means the game is launched for the first time. Then set the value to 1 before switching to the game frames. You may consider using "Run this event once" instead of start of frame, just to be on the safe side.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2006
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my apps I check to see if the .ini exists. If yes, I load the values I need. If no, I create an .ini to be used setting values.

    Pseudo code:
    If sfx = "On" then do ...
    If sfx = "" then create .ini, set sfx ="On"

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Captain_Harris's Avatar
    Join Date
    Aug 2011
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm ..... how can i check if .ini exist ?

  5. #5
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,455
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    At the current time there is no way to detect if a file exist. You should in your INI file store some value you can check during runtime.

    For example store the value: "IniExist" to be equal "1" or similar. At the start of your app you can load the ini file and check if the variable "IniExist" is equal to 1. If not you initialize the ini file with the default data for you app.

    A better way would be to include the INI file as a binary file. If the INI file isn't created yet the iOS runtime will load the INI file from the binary files. When saved it will store it in the App's private documents folder and use that in the future. The iOS runtime only looks for files in the embedded binary files if no other file is found with that filename.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Captain_Harris's Avatar
    Join Date
    Aug 2011
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    INI Problem

    Thank you Guys for your help. I've made it so ....
    I've set the Global value to 1.

    Then

    Start of Frame
    +
    If Global Value is different then 1
    -
    Set Global Value to "Value from Ini"

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My apps check to see if a value is not one; if so they create the INI with default settings including the value being set to one otherwise load the settings. This works great. Only set the INI filename on Start of Frame.

Similar Threads

  1. Pulling Problem and Shooting Problem
    By Duggabboo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st March 2010, 06:24 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
  •