INI and Text help

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have some problems with the INI and text object. It's pretty hard to explain, but I'll try my best to do it-

    I was trying to build a dialog system for my game. The system was simple, all the dialogs are stored in an INI file, the cap has an global variable. When you left click, the global variable's value increases by 1 and there's an event for each specifc value which loads the corresponding dialog text from INI and writes it in the text object. For eg-

    If global('dialog') value is 0 then load the item "diag1" from the INI.

    ---[RIGHT CLICK], global('dialog') increases to 1.

    If global('dialog') value is 1 then load the item "diag2" from the INI.

    and so on.

    The problem here is that the event works for every other value except the one it's currently checking.

    Here's a cap -

    http://dl.dropbox.com/u/5811650/Repulsion/inierror.rar

    The expected text that you should see when you preview should be - "CHECK DIALOG", but instead you get a blank text object.But if you left click to increase the value of 'dialog' from 0 to 1, then the text appears.

    Some other things to note-

    • this only happens with the 'write text' action. The 'set text' action works fine.
    • if you change the initial value of 'dialog' variable in the editor, then run the preview, then too it doesn't work(which happens as expected)

    Any idea whats causing this? :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey here is it

    Click Here (.rar)

    I hope this is what you are looking for!

  • Thanks that works great!

    But I have a doubt though -

    To my knowledge, the INI 'get string item' takes string values for both the parameters but in your example the event is -

    INI.ItemString(global('dialog'), "1")

    the 'dialog' is an integer variable.

    And also does anyone know why my method doesn't work.

    Again, thanks for your help. :)

  • And also does anyone know why my method doesn't work. Your method works, you just don't see an effect. The problem is that you are writing the text instead of setting it. Now whatever low milliseconds you tell it to use, the fastest it can write is by 1 letter per tick.

    On the other hand you tell it to restart writing at every tick. The result is a blank text box (tick x: no letter, tick x+1: letter 1, tick x+2: letters 1-2, etc.)

    You can see more clearly what I mean when you add a "trigger once" to event 4. Now it has enough time to write the whole text.

  • It worked, thanks for clarifying!

    An action keeps executing if the condition is true <-- Need to mug this up.

  • Again, thanks for your help. :)

    No Problem

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