Ini just won't work

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.
  • What am i doing wrong here with ini object. It just doesn't work, and in actual project i'm working on, it gives me random numbers for different items, all ways the same numbers.

    This is anyway how it's coded. Can you fix it?
    Please login to see this link.

  • Hi,

    Can you copy-paste your code as a forum post? I'd be better for history and legacy (rather than having to download a project example)

    Just so you know, I'm using the Ini++ extension on many projects and it is very reliable for setting, reading, updating values, etc.

  • In addition to Volnaiskra's suggestion I think you should also Set Current File to AppPath$ + "frame.ini" on your first event.

    The difference being that AppDir$ will only get you the folders ex: "\Users\chrilley\Desktop\MyGame\"
    AppPath$ will get you the drive letter as well: "C:\Users\chrilley\Desktop\MyGame\"

    Adding ".ini" extension to "frame" also completes the full exact path.

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • Oh, I forgot that I did both those things when I was first checking out the file. Sorry that I forgot to mention it.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • I have two comparison mfa:s and the ini problem was solved for a while now it doesn't work anymore. Nothing has been changed from the time it worked. What does my computer do? What causes this? Any idea anyone. Volnaiskra too if @ works here.

  • So i tested with 2 other computers. W10 and other W7 or W10. .ini always worked the first time but not a single time more. It stuck the item value to the one it was first even if i modify the .ini, of jump to frame via shortcut.

  • if it works the first time and not the second time, I would assume it's linked to how you call it in the events ; are you referencing a group or an item that no longer exists ...?
    Did you change the current group in another even in a way that the item you called is no longer there...?

    By the way, not sure what you mean by ini++ doesn't have a "select file" option. If you mean opening a file at run time via events, it does have such feature. Example:

    * Start of Frame
    ini_plus_plus : Appdir$ + "data/inputs.ini" : Load file, changing the current file path, and clearing the current data in the object.

  • I just found this because this is in second page of this thread.

    With normal ini the item exists and works one time. Then i change the value, and whatever i change it to, it shows 22. The file is there to load. It exists, because i can change the value. I'll try in++ but i have issues with it:

    ----------------------------------------------------------------------------------------------------------------------------------------------
    * Start of Frame
    ini_plus_plus : Appdir$ + "data/inputs.ini" : Load file, changing the current file path, and clearing the current data in the object.
    -----------------------------------------------------------------------------------------------------------------------------------------------

    This is what i do. But then what?
    -How to set group and item?
    -How to get that value from ini++ to counter, or just jump to frame of that value?

    It's continue game/save game number of frame.

  • There are basically two ways to set or create groups and items. One way is to manually set the current group and then set the value or string of an item within that current group.

    Code
    * Upon pressing "Enter"
    	 ini_plus_plus : Set current group to "Group Name"
    	 ini_plus_plus : Set item "Item Name" to value 1 (Setting = 0)


    The other way is to set the value or string of an item within a group all at once in a single action, without using a separate action to set the current group.

    Code
    * Upon pressing "Enter"
    	 ini_plus_plus : Set item "Item Name" in group "Group Name" to value 1 (Setting = 0)


    If you want to do something like set the value of a counter to the value of an item in the INI, there are several ways to do it. The first way is to manually set the current group and then get the item value or string from the current group. (In the example below, 0 is the default value that will be returned if it cannot find the item name specified.)

    Code
    * Upon pressing "Space bar"
    	ini_plus_plus : Set current group to "Group Name"
    	Counter : Set Counter to GetItemValueG( "ini_plus_plus", "Item Name", 0 )


    A second way of doing this is to get the item value or string from a specifically specified group.

    Code
    * Upon pressing "Space bar"
    	Counter : Set Counter to GetItemValue( "ini_plus_plus", "Group Name", "Item Name", 0 )
  • Ok, so either of these two examples will allow you to set a counter to the value of an item contained in an INI++ file.

    Code
    * Upon pressing "Space bar"
    	ini_plus_plus : Set current group to "Group Name"
    	Counter : Set Counter to GetItemValueG( "ini_plus_plus", "Item Name", 0 )


    Please login to see this attachment.

    Code
    * Upon pressing "Space bar"
    	Counter : Set Counter to GetItemValue( "ini_plus_plus", "Group Name", "Item Name", 0 )


    Please login to see this attachment.


    In this first example, you set the INI++ to the Group that contains the Item that you want to read from. You then set the counter to the value of the Item contained in the Group that you set in the 'Set current group' action. Unless you need to get data from an item in a different group than the current one, you only need to use the 'Set current group' action once. All items in the current group can be retrieved with "GetItemValueG( "ini_plus_plus", "Item Name", 0 )" without needing to specify the group name a second time. Setting current group does not actually create a new group or edit any group in the ini unless you tell it to ensure a new group. It simply tells INI++ to focus on the group specified so that you can get data from the items in that group without needing to repeatedly declare which group you need.

    The second example is just like the first example, except that it only uses one action. You don't need to use the 'Set current group' action, and can instead specify both the item name and the group name it belongs to in a single action.

    Replace "Item Name" with the actual name of the item in your INI file and replace "Group Name" with the actual name of the group in your INI file.

Participate now!

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