The Daily Click ::. Forums ::. Klik Coding Help ::. tgf ini object help
 

Post Reply  Post Oekaki 
 

Posted By Message

tetsuya_shino



Registered
  12/08/2004
Points
  491
6th August, 2005 at 17:52:35 -

Hello all. I feel really dumb asking for help about this, but here goes. Could someone explain to me, step my step, how to use in default ini object to save and load vaules in an rpg. Nothing fancy, just something like this;

*Upon pressing "L"
~load all values to ini object~

and

*Upon pressing "S"
~save all values to ini object~

I don't understand how groups work as I don't really need more then one group. I just want to pull/record values from counter objects. Please help!



 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
6th August, 2005 at 17:57:43 -

Here's how INI's are arranged

[GROUP]
Item=value
Item2=Value

[Group2]
Item=Value
Item2=Value

From this, you should be able to figure out how to use the INI object, just make sure you set the group first. There's a bit more to it, but I'm late as it is, so if noone answers by tomorrow, I'll go in depth.

 
Craps, I'm an old man!

tetsuya_shino



Registered
  12/08/2004
Points
  491
6th August, 2005 at 18:48:36 -

Thank you very much for your reply, but I still can't seem to get it.

I have three counter objects;

currentHP
maxHP
money

Could someone write out an exsample using my counter names please?

 
n/a

hishnak



Registered
  18/04/2004
Points
  994
6th August, 2005 at 20:48:30 -

Ok, here's what you do

Start of level----Set file to Appdrive$ + Appdir$ + Name of game
Set current group to...Health or whatever
Set current Item to...Health counter
Set current value to...value of Health counter

 
I'm feeling a bit wella

:JULI@N:



Registered
  14/07/2002
Points
  641
6th August, 2005 at 21:13:20 -

Weill , as I see it, there's no need for groups, you just:

Upon pressing "S"
set current item to "currentHP"
set current value to (and then choose the corresponding counter)
set current item to "maxHP"
set current value to (and then choose the corresponding counter)
set current item to "money"
set current value to (and then choose the corresponding counter)

For loading, I don't remember if the normal INI object can get a value from a specific item or you have to download ini plus


 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
7th August, 2005 at 12:45:44 -

you can make it nice and tidy if you do this

make sure the ini object is in the frame you want.
make a group (event group i mean) that is deactivated by default.

then upon pressing 'L' activate group

then the group looks like this

always - set group (ini) to stats
always - set item to hitpoints
always - set value to counter 1
always - set item to money
always - set value to counter 2
always - close group

done.

 
.

tetsuya_shino



Registered
  12/08/2004
Points
  491
11th August, 2005 at 01:54:23 -

Thanks everyone. I know how to use ini files now. However, I have a new question. When I load or save I'm need to read/write data from over 40 different counter ojbects.

How fast does tgf read/write to inis? Is it safe to read/write so many values in one command? I'm worried tgf might hicup and skip one of ini changes.
Any advice?



 
n/a

Nuutti



Registered
  26/10/2003
Points
  1364
11th August, 2005 at 02:05:31 -

I would say it is pretty safe. For me, tgf has never skipped my events/actions.

 
P.S. sorry for my mangled english.

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
12th August, 2005 at 06:57:51 -

For simplicity, you may choose to spread the saving process over more than one event. So instead of having one event that saves all 40 values, it may be better to have four events that save 10 values each.

Just makes it easier for you to read and edit in the Event Editor.

 
191 / 9999 * 7 + 191 * 7
   

Post Reply



 



Advertisement

Worth A Click