Posted By
|
Message
|
Corny
Registered 26/10/2003
Points 232
|
5th June, 2006 at 15:52:02 -
So I read through alot of ini-tutorials and posts in the boards this afternoon, I did what the tutorials told me to do (i was using this one http://www2.create-games.com/article.asp?id=188 and some others).
I'm using TGF, as stated in the title.
I set up a ini-object, calling it just like the *.ini I created in the games folder. In the Ini, there's the follwing written
[medals]
einseins=0
einsdrei=0
zweizwei=0
...
the point of this would be that you can get medals for each level through achieving certain goals. Of course, I want these to be saved so that you could look at the your achievement and unlock extracontent and stuff. However, thanks to my retardness, I'm not able to save or even load data...
E.g. Here's how I tried to load data, but it seems i can't even get the program to read anything in the ini :
I tried the following to at least get the data (trying around to find my mistake)... First I created a counter called einseins for medal einseins, and changed the ini manually to
[medals]
einseins=1
einsdrei=0
zweizwei=0
I wanted to get the darn value of einseins=1 (meaning the player has collected medal "einseins"). So I "coded" the following for my previously created and oh-so-beloved ini-object :
Set current group to "medals"
Set current item to "einseins"
Set counter to Value of "INI"
so that the counter for the medal einseins would get the value 1 from the inifile
then following the usual
If counter=1, then... it should show the collected medal...
But nada = it won't work. No value from the ini, nothing. Tried saving values, too, but it wouldn't work either (at least nothing changed in the ini).
Maybe I'm failing at something absolutely noobish, sorry for doing so, but after getting upset far too often in the last few hours, I just want to finish up my project (this being one of the last things not finished...) and... well... I know that there are many nice people here who could give me advise...
n/a
|
Matt Boothman The Nissan Micra of forum members
Registered 20/09/2002
Points 109
|
5th June, 2006 at 18:09:55 -
Firstly, I suggest not calling the INI object in the level editor, instead call it in the event editor:
- Start of frame: Set current file to appdrive$ + appdir$ + "yourini.ini"
Make sure the ini is in the same directory as the saved .gam file.
Then,
- Start of frame: Set counter to GroupItemValue( "YourINI", "medals", "einseins" )
..obviously replacing "YourINI" with the name of the INI object.
That's how I do it anyway.
http://soundcloud.com/normbo - Listen to my music.
|
axel Crazy?
Registered 05/02/2005
Points 4766
|
5th June, 2006 at 21:34:57 -
GroupItemValue doesn't work in TGF, Noodle.
- Set current file to appdrive$ + appdir$ + "yourini.ini"
- Set current group to "medals"
- Set current item to "einseins" (Or whatever)
- Set counter to value of INI
That should do it
n/a
|
Werbad
Registered 18/09/2002
Points 235
|
6th June, 2006 at 10:03:53 -
Yeah... don't use the standar ini-object, it sucks... Use INI+ as Phizzy said
n/a
|
Matt Boothman The Nissan Micra of forum members
Registered 20/09/2002
Points 109
|
6th June, 2006 at 21:13:14 -
INI+ is actually much, much worse than normal INI, fuckmouth.
http://soundcloud.com/normbo - Listen to my music.
|
Corny
Registered 26/10/2003
Points 232
|
6th June, 2006 at 23:41:11 -
thanks everyone. a friend of mine and I got it to work finally, but it didn't make the cut for the playable demo well I'll include it in the next version. again, thanks ^^
n/a
|
|
|