INI and Text help

For questions about using Classic.

Post » Mon Aug 08, 2011 10:13 pm

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? :/
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Mon Aug 08, 2011 10:25 pm

Hey here is it

Click Here (.rar)

I hope this is what you are looking for!
B
7
S
2
G
1
Posts: 193
Reputation: 1,745

Post » Tue Aug 09, 2011 8:11 am

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. :)abhilash28632011-08-09 08:11:43
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Tue Aug 09, 2011 9:08 am

[QUOTE=abhilash2863] And also does anyone know why my method doesn't work. [/QUOTE] 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.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Aug 09, 2011 9:47 am

It worked, thanks for clarifying!

An action keeps executing if the condition is true <-- Need to mug this up.
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Tue Aug 09, 2011 9:55 am

[QUOTE=abhilash2863]

Again, thanks for your help. :)[/QUOTE]

No Problem
B
7
S
2
G
1
Posts: 193
Reputation: 1,745


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests