Posted By
|
Message
|
Jon C-B I create vaporware
Registered 23/04/2008
Points 237
|
5th October, 2009 at 03:00:09 -
Hi, I was wondering how you can save in my game how much money you have, what weapons you have, and what level youre on
n/a
|
Sumo148 Super amazing fantastic user
Registered 26/01/2009
Points 530
|
5th October, 2009 at 03:12:40 -
using INI object, Array object, Save Game object, etc.
n/a
|
0ko
Registered 11/01/2009
Points 318
|
5th October, 2009 at 19:14:56 -
Here's a poorly made example file featuring the array object, frame one involves saving and loading using names (I.E. you type in "george" and click save then you have to have that same thing typed in when you load).
Frame two is simply saving and loading with a set name: "save".
(ignore the last two events in frame two)
Enjoy!
http://www.mediafire.com/?w1egrm1miwo
n/a
|
Jon C-B I create vaporware
Registered 23/04/2008
Points 237
|
5th October, 2009 at 22:01:24 -
Sorry I meant with the ini
n/a
|
UrbanMonk BRING BACK MITCH
Registered 07/07/2008
Points 49667
|
5th October, 2009 at 22:35:26 -
http://www.jsoftgames.com/iniexample.zip
Here you go. Look at the code. I commented it a bit.
n/a
|
0ko
Registered 11/01/2009
Points 318
|
5th October, 2009 at 22:56:53 -
I have no idea why somebody would prefer ini over array.
Shed some light on this perhaps?
n/a
|
UrbanMonk BRING BACK MITCH
Registered 07/07/2008
Points 49667
|
5th October, 2009 at 23:22:18 -
array files are larger.
A one by one by one array storing a 4 character string is 34bytes
A ini storing the same thing in a group and an item of the same length is only 17bytes
ini's are readable outside of mmf without much effort.
Of course this is all entirely dependent upon the programmer. Large Cnc array's do compress well because they have large patterns of repeating characters.
If you're going for small size however I'd suggest the binary object.
n/a
|
0ko
Registered 11/01/2009
Points 318
|
5th October, 2009 at 23:31:14 -
The amount of data you would have to be save/loading would have to be a lot to notice much of a difference.
Also, this guy here is only saving three values.
Explain THAT!
n/a
|
0ko
Registered 11/01/2009
Points 318
|
5th October, 2009 at 23:33:04 -
Arrrgh firefox timed out while loading, so I had to resend data.. and voila! double post.
Edited by 0ko
n/a
|
Jon C-B I create vaporware
Registered 23/04/2008
Points 237
|
5th October, 2009 at 23:41:30 -
Thanks for the example UrbanMonk I think itll help. And the only reason I didn't ask about using an array is that I never learned how to use it
n/a
|
0ko
Registered 11/01/2009
Points 318
|
5th October, 2009 at 23:48:55 -
THAT'S WHAT EXAMPLE FILES ARE FOR, LIKE THE ONE I POSTED!
Uhhh replace "edittext" with "save" in frame two's comment (I was in a hurry, okay?)
but that doesn't mean you have to use my example, there's very good ones on this site, simply run a search in "downloads" or "articles" using the word "array".
Edited by 0ko
n/a
|
Jon C-B I create vaporware
Registered 23/04/2008
Points 237
|
7th October, 2009 at 22:53:43 -
Sorry but I think ini's fine for what I'm doing. But what if you want to check whether the player has for example the Bone Saw, a pistol and a lazer? Could they each be strings in a group called something like current weapons?
n/a
|
UrbanMonk BRING BACK MITCH
Registered 07/07/2008
Points 49667
|
7th October, 2009 at 23:28:06 -
Sure. You can organize the data any way you like. It was just an example.
n/a
|
Jon C-B I create vaporware
Registered 23/04/2008
Points 237
|
7th October, 2009 at 23:34:15 -
So if you buy a gun at the shop I add the weapon to group Weapons as a string or object i guess. Then can I make a condition that if you press 2 and item Gun is in group weapons, set gun to player? Just checking this with you before I try it
n/a
|
UrbanMonk BRING BACK MITCH
Registered 07/07/2008
Points 49667
|
8th October, 2009 at 00:37:49 -
I'd do it like this.
[Save1]
gun=1
0 not having the gun and 1 having the gun
But like I said whatever you like.
n/a
|
|
|