Need help displaying text from an INI file group/item

For questions about using Classic.

Post » Thu Jul 09, 2009 3:12 pm

Hi everyone,

I've just begun working on the dialogue system for my game and will be using INI files to store the text for dialogue. I need to display text with the text object from an ini file but am having no luck. Would anyone be kind enough to make a quick example?

thanks
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Thu Jul 09, 2009 3:29 pm

http://files.getdropbox.com/u/646697/Lucid.zip

I whipped this a few days ago.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Thu Jul 09, 2009 5:09 pm

i gotta tell you aeal, you have great taste in filenames
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Jul 09, 2009 5:13 pm

Just:

INI.ItemString("group", "item")

There's an article on the Wiki if you want a full overview of the object.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Thu Jul 09, 2009 6:02 pm

Personally I like hash tables better than INIs--INIs have very strict formatting rules, whereas hash tables are just tables.

EDIT: This makes no sense, what I wrote. I just believe hash tables are simpler. I'd use a hash table for dialogue--but I'd use an INI for settings or maybe even saved games.
B
4
G
3
Posts: 25
Reputation: 975

Post » Thu Jul 09, 2009 6:31 pm

Why not just use the timeline object for dialogue?
B
77
S
49
G
24
Posts: 346
Reputation: 16,909

Post » Thu Jul 09, 2009 6:34 pm

hash tables are ok but even then you nee to use an editor to edit the values. With an .ini file you can simply type it up in the correct format which IMO is much easier than using a special hash table editor Especially when using it for things like story I would rather use note pad and have to format it correctly than program my own editor.

@ uber lou because when doing large stories its easier to use an out side file and edit that than a bunch of internal text files.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Thu Jul 09, 2009 6:54 pm

Aeal: That may be true, but you don't need a bunch of internal text files, just use one global timeline object. Organize each cinematic, or chunk of text, into a timeline within that object and its pretty manageable. I have a lot of in game dialogue and I found it easier to use than an ini file. Maybe just preference.
B
77
S
49
G
24
Posts: 346
Reputation: 16,909

Post » Thu Jul 09, 2009 7:21 pm

Thanks Aeal,

I needed to so something slightly different, but it definatly helped. It turns out All I needed was to put quotation marks around my group name and item name.

PS. I love the easy of use of ini files in text editors, and like the fact that its an external file in this case becuase I'll be encouraging users to make translations into other languages. ;) (simply sawp the few ini files to the ones in your language)
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Thu Jul 09, 2009 8:29 pm

Holymonkey if ya need help with INIs more you can pm me as I think im pretty good with em :)
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests