How to write "data" in files?

This forum is currently in read-only mode.
  • Hello,

    First of all I am new here and I try to learn a lot about this wonderful tool.

    I am trying to write some data into a file. For example, I want to write the player name. I inserted an INI object in my Layout and then I stuck. I read on wiki and I searched the forums with no luck.

    The idea is to create a new ini file after the user enter his name into a text box and press the "Create button"

    I have tried something like:

    INI: Set INI file to "profile.ini"

    INI: Write string EditBox.Text to item "Name" in group "Player"

    but nothing happens..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • INI: Set INI file to "profile.ini"

    There's no path there, just the file name. Odd though, I believe if you left out the path it used to default to C:\, but there's nothing there. Try this:

    INI: Set INI file to AppPath & "profile.ini"

    Be sure to save your .cap first so it knows where AppPath is at. This will create the .ini in the same directory as your .cap (or your .exe when you build it).

  • yeah it seems I have to specify AppPath before enter the file name. I though it will work like binary files

    I observed the "System" has also a "Write to INI file" function. Is there any diference?

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