The Daily Click ::. Forums ::. Klik Coding Help ::. Global Values and Ini
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
11th August, 2013 at 11/08/2013 11:20:55 -

Okay! I'm re-writing this as I've figured out how to use the ini to save/load a Global Value - This saves which level the player has reached.

But now I also need to save the Hi Score, and the number of lives the player has. Do I do this using the same ini? Do I have to "set" the ini differently when using it to store numerous values? Would it be better to use numerous ini objects..?

Edited by -Liam-

 
Image

Tell 'em Babs is 'ere...

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
11th August, 2013 at 11/08/2013 22:37:29 -

You can use the same INI for sure. Do something like

[STATS]
HIGHSCORE = ***
LIVES = ***
OTHER STAT 1 = ***
OTHER STAT 2 = ***

and so on. You just have to reference them correctly

 
n/a

Deleted User
13th August, 2013 at 13/08/2013 07:51:00 -

Your article is very good ,I agree with your point of view I would also recommend to you that we have the game.
---------------------------------------------------
http://www.d3joy.com/
http://www.sellgw2.com/

 

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
17th August, 2013 at 17/08/2013 16:53:16 -

Thanks Windybeard.

I'm not sure I understand how to reference these values though. I have it set up like this:

Start of Frame
Set Ini to "ini"
Set global Value A to value of( "Ini" )

That works for loading Global Value A. But I'm confused about expanding upon this. I can get this far:

Start of Frame
Set Ini to "lives"

... But then am I supposed to just load value of "Ini" like I did before? Because it doesn't know what "lives" is. and it wont let me change "Ini" to "lives" as it's not valid. Sorry I'm pretty new to the ini.

 
Image

Tell 'em Babs is 'ere...

Akai_R



Registered
  16/04/2008
Points
  436
17th August, 2013 at 17/08/2013 23:48:42 -

Set lives of player to > Get value (Group - Item)
So for example,
Set lives of player to > Get value > STATS > LIVES

 
______
http://akai-r.com/

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
18th August, 2013 at 18/08/2013 20:09:51 -

Do you know how to use groups within the ini Liam??

This is what Windybeard is trying to explain.

Ini's are pretty powerful in the fact that you can have a load of information for your game within one ini file.

To seperate the info you can split it up into "groups". This is done by entering the group name into square brackets:

[group name]

So for example an ini containing player info and level info could look like this:

[player_info]
lives=3
score=4572
current_lvl=5
continues=2

[1]
high_score=340
time=64

[2]
high_score=420
time=86

etc..

to reference these groups simply use the ini command - set group

Hope that helps

 
n/a

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
21st August, 2013 at 21/08/2013 09:54:27 -

Thanks Lembi. I don't want to sound completely uninformed, but I don't really understand anything about inis, other than they save and load data.

What does Set "file" do? "Group"? "Item"? "Value Item"? "Value Group - item" You don't have to explain all that, but it's just a bit confusing. There's just so much to it.

So I need to separate everything into groups...

Start of Level
-Set current file to "ini"
-Set current group to "level"
-Set Global value A to value of( "level" )

The expression editor doesn't like that. I'm lost... Is there a tutorial for beginners somewhere?

 
Image

Tell 'em Babs is 'ere...

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
21st August, 2013 at 21/08/2013 14:29:00 -

Liam check this out, It will tell you everything you need to know to get you started with INI's. Hope it helps.

http://www.create-games.com/article.asp?id=188

Also if you are working on saving/loading i would advise taking the time to look at the Array object and learn ho to use it, it is much more versatile and much more secure than ini's however it is harder to get on with if your new to saving etc.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click