The Daily Click ::. Forums ::. Klik Coding Help ::. AGHH I HATE INI
 

Post Reply  Post Oekaki 
 

Posted By Message

/\/\@RCU$ [Modern Game Creations]

GOTW Cheater

Registered
  06/11/2006
Points
  688
11th December, 2006 at 01:21:34 -

Omg can someone please make a download available that lets you see how you use the INI object which i can edit myself, because im really confused about it...sorry

(It will also help a lot of others)

 
/\/\@R(U$

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
11th December, 2006 at 01:56:24 -

TGF/MMF/TGF2/MMF2?

And have you tried the DC search? There are plenty of tutorials and articles around.

 
n/a

/\/\@RCU$ [Modern Game Creations]

GOTW Cheater

Registered
  06/11/2006
Points
  688
11th December, 2006 at 02:02:04 -

TGF2 sorry ill look

 
/\/\@R(U$

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
11th December, 2006 at 02:42:43 -

Okay, here's a very simple example:

http://aggggge.funpic.org/ini.mfa

That application simply stores the text you write in that edit box, and lets you load it later on. INI is very easy. All INI files contain groups, which in turn contain items, which hold the data itself. The first thing you want to do is to specify the INI file you're going to use. Usually you want to access an INI file from the same directory as your game. To do that, you use the expression Appdrive$ + Appdir$ + "filename.ini". You can of course replace "filename.ini" with anything you want. You can also just specify a filename, like just "data.ini", but then it'll save it under C:\windows\ or somewhere.

After you've specified the INI file you're working with, you can start loading and saving data. To do that, you simply use the functions the INI object provides. To save string data, you use the Set string - (group, item) action. You then specify the group and the item in which you want to store the data, and then the data itself. The Set value - (group, item) is exactly the same, but for numbers. If you ever need to convert numbers to strings, or strings to numbers, you can use the str$() and Val() functions respectively.

To load data, you have to use one of the INI object's expressions, like the Get string - (gruop, item) expression. You pass the group and item name as arguments, and it returns the data. Simple.

I don't know if it'll make it easier for you to understand, but you can open up an INI file in Notepad. INI files are structured like this:

[group]
item = value
item2 = blablabla

[another_group]
abc = 123
blabla = omgwtfbbq



Happy coding, hope this helps.

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
11th December, 2006 at 06:46:11 -

I'm not gonne help you, since you apparently hate INI.

 
Old member (~2004-2007).

/\/\@RCU$ [Modern Game Creations]

GOTW Cheater

Registered
  06/11/2006
Points
  688
12th December, 2006 at 03:57:01 -

No its just i hate it how i cant work it out.

 
/\/\@R(U$

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
12th December, 2006 at 05:48:02 -

What is it that you don't understand? Did you look at my example mfa?

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
12th December, 2006 at 14:44:00 -

Give him the OpenGL X object to cry about.

 
Old member (~2004-2007).

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
12th December, 2006 at 14:48:53 -

Or Win32 API.

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
12th December, 2006 at 19:32:23 -

you have to read the tutorials posted on the site, I did when i didnt know how and now i know ini's inside and out. use the search!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click