Do you know how to make 'advanced save games' where ALL data of ALL frames is stored into? Do you know how to do that? I've tried to find an article or something about INI++ saving or using arrays, but I didn't find anything useful so far.
So is there a way to store all objects of the game to a file? Or maybe just specific objects?
I was considering this, because if there is a way to do that, I would place fixed items/ammo/health etc in the levels and no matter if you leave the frame, load or save your game, the items would still be gone after you've picked them up and come back.
You can store all that information with relative ease using something like an array. It might make things easier if you plan it out ahead of time using an excel spread sheet or something. You might have something like Ammo on x,1 and all the various types of guns you're holding ammo for on 1,1; 2,1; 3,1; 4,1; and so on.
The Save Game Object exists and if you wanted to use it, is functional, but if you wanted something that will be far less limiting in the future, learning how to use arrays or INIs to save information would be the best way to go for now.
Also, one big thing people I've talked to about save games, seem to frequently miss. Yeah, you can save the information. You also have to load it. So the whole process of saving the information into the file has to be done in reverse to pick the information back up out of the file and placing it in the appropriate spots. Your game wont know how to do anything until you tell it how to do something.
Right now I'm just saving all global values to a file when you save the game. It works fine, but if I would like to add 10 collectable items to each level (let's say I have 50 levels) and I would like to check if each item has been taken or not, I would have to create 500 events and 500 global values to check each item. And another 500 events to see if the item has been taken and destroy it at start of the frame if so...
That would kinda suck
I've considered using the "Save Frame Position" event, because it seems to work fine, but I would have to save each frame for each save slot individualy - and that would kinda suck too
So I'm looking for another way... maybe with an ini? Haven't found any article about this kind of "advanced" problem yet.
Instead of using global values you could just use two inis. One temporary one to constantly update all your game's values positions and whatever to and another to actually save and load from.
There is no quick way to just save everything to an ini as far as i know.
Although pixeltheif's grid quest takes ini usage to extremes so he might have a few tips on how to best use them.
INIs are great if you want to easily edit and test your game out, but the bad part is anybody can cheat your game by editing it (unless you encrypt it, which I've had errors with before).
Sounds like an array is what you need, and with 10 items / frame, it's probably going to be tedious.
Something as easy as a string array's condition
at the start of the frame if array$(x pos 1) = "YES" then destroy object "Treasure1"
would probably be the best way to do it. Just lump all these treasure collected events into one group at the top of your code at the start of the frame and you'll be fine.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Actually, I'm using ini++ and i'm very happy with it since it has a encryption option in it! Then it will automatically encrypt/decrypt with a specified key each time you load/save. And it's working fine for me.
But dunno about storing all data of all frames, you need some kind of loop and stuff.
If you for example do like this:
You spread a value 0 in the items, so each item has a different value (1,2,3)
and when you collide with it:
-destroy
-INI save item "Str$(Alteravle value A)" in group "Item" to value "Str$(Alteravle value A)"
And then have a condition that says:
- if Alterable value A of "Item" == INI(group"Item",Item"Str$(Alteravle value A)",0) (Or something, cant remember how it looks like)
- destroy the item
I hope this helps as that is the technique i'm using in Blob III.
Please ask questions if there is something you arent clear on, as I am awful to explain stuffs .
I havnt tried that but I use the .ini to also keep track of stuff when one is playing the game. Which objects has been taken and stuff.. And also I can display the values in a load game frame for example..
That's something I found annoying about INIs is that they took longer to save/load to and you would be constantly adding to it, whereas with Arrays you can just use the actions "Save" and "Load" to load the whole file straight away. INIs are still very useful though and some people prefer to use them over arrays for everything.
inis doesnt take that much time to load, but save; yes. But this way you wont be saving all the time, just when you collide with an object and I've had no FPS etc. problems with that
Originally Posted by jthongbai That's something I found annoying about INIs is that they took longer to save/load to and you would be constantly adding to it, whereas with Arrays you can just use the actions "Save" and "Load" to load the whole file straight away. INIs are still very useful though and some people prefer to use them over arrays for everything.
ini++ holds everything in memory until you save, or load.
So it's the same speed as an array, and the file size is smaller for the most part.
Originally Posted by jthongbai That's something I found annoying about INIs is that they took longer to save/load to and you would be constantly adding to it, whereas with Arrays you can just use the actions "Save" and "Load" to load the whole file straight away. INIs are still very useful though and some people prefer to use them over arrays for everything.
ini++ holds everything in memory until you save, or load.
So it's the same speed as an array, and the file size is smaller for the most part.
First off, big thanks for all your help. It works! ... for the most part
I spread a value in the Shotgun Ammo Item at start of the frame and when I pick them up, it writes in group "level X" the value "ShotgunAmmotakenY = 1" (temporarily I've put a "save file" into the event to test it).
When the frame loads, it checks with a fast loop, if that item is in the ini file and if so, destroys that one with the correct value properly.
BUT... I cannot find the mentioned "memory" you're talking about. When I don't save the data to a file before the frame is left or reset, it saves nothing (all ammo appears).
How do I use that memory you're talking about? Couldn't find that function
To use the "store in memory until ready to save/load" function in the INI++ object, you must enable the "global data" function. Then disable both auto load and auto save. Like so:
After that make sure that in your load frame to add an event to load the ini you are using.
Then whenever you are ready to save just add the save event in your code.