INI files

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Convert multiple Excel files into JSON files and import them into construct3.
  • Can an .ini hold more an 1 variable? Or do I need to have 2 ini files to have name and high score?

  • [Highscore]

    username=points

    username2=points

    ...

    Dont work? :S

  • .ini files can hold as many variables as have been declared in the .ini file its-self.

    [Groups Are Declared Like This]Items_Like_This = value
    
    [This Is Another Group]
    
    Items_Like_This = differentvalue
    
    More_Items = value[/code:3t8la607]
    
    You should be able to work the rest out through the relatively self-descriptive Construct events.
  • Plus w/ Get Token expression, Write String action, and various system features in construct, you can easily store multiple values in one INI item.

    Will probably explain how sometime soon.

  • I have the score working but can't seem to add the player name that you type in the field. Little help please

    http://www.box.net/shared/e8xn5qsple

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This has made the expression list harder to read. But I'll try fixing that later.

    This stores two variables in one item, one is a string, the other is a value.

    Say I have a string that looks like this

    Ohmah.1

    I can use the GetToken Text Manipulator to get either the string, or the value.

    GetToken("Ohmah.1",1,".") - Will return "Ohmah"

    GetToken("Ohmah.1",2,".") - Will return "1"

    Both as strings of course, but if you wanted to you could return them as integers.

  • I ma just6 missing something with the ini I tired this but get an error:

    INI.ItemValue("PlayerName", "PName", "High Score", "Score")

    ShadeKirby500: I can't get the simple .ini, so I have no clue what do you with your GetToken tip. Sorry. (Perls before swine and all.)

    Can anyone mod my posed code? I think it just needs 2 lines,

  • http://dl.dropbox.com/u/1646976/ini.cap

    Think that'll help.

    Also:

    ZOMGbananas INI tut -

    Mine with CRC32 (just ingnore the CRC32 and look at the reading & writing) -

  • Your the MAN Minor!

    I was so close! I didn't know you needed an & to make that work. Not sure if that fact is covered anywhere either.

    Thanks

  • OK this worked fine on my Layout 1 sheet, but does not on my lay out 2 sheet. Are there special rules?

  • Did you include your layout 1 sheet in your layout 2 sheet? Are you missing any objects in layout 2 that you need to run the events?

  • How do you include sheet 1 into sheet 2 please.

  • Right-click in layout 2's event sheet, select "Include event sheet"

    Then click on the include bar and pick the sheet for layout 1.

    If you are going to be reusing your ini code over and over again, then you might want to make it in it's own event sheet. You can add "loose" event sheets in the project bar by right-clicking and selecting "Add new" on the event sheets icon. Then you can double-click them to edit them, and add them to any layout by including them, etc.

    Oh, and to rename your event sheets you can click on the name twice, slowly. Same with anything else in the project tree.

  • OK tried the include and it still does not work. I just am missing 1 little piece. Can anyone correct my mistake? The fist page can write the ini fine the second (race) page does not automatically write the 5000 score at the end.

    (file below)

    Note: start sounds removed for file size so there is a pause ay the beginning.

    Thank you all for being so patience on this.

  • You didn't put your .cap in the zip... you just put in your .persist file. I can't do anything with that

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)