View Full Version : Checkpoints/Saves

01-29-2010, 07:21 PM
Does anyone have an idea as to how to make this work? Want i want to know is how to store the world data somewhere so that the user can come back and load this checkpoint/save.

Anyone have an idea?

01-29-2010, 09:36 PM
Check out how to write into the .ini files. (There's a code called sapitu in the documentation that does exactly that).

01-30-2010, 02:56 PM
I've read that but is there no better way than to save every detail in the .ini files? Like make a hard file? Plus im not sure if that method saves the current state just characters which is of no use to me. I need to have it so that it saves the data of everything in the level.

01-30-2010, 04:41 PM
Well, i think there's no better way, maybe writing a function in a dll, but i don't know how that works... or an external program and acces it via TCPLink, still, you'd end up writing a lot of information but in different places.
About sapitu... it just saves data... you can modify the variables and their values however you like :S.

01-31-2010, 04:00 AM
Ok ill try using the saiptu scripts, but does anyone know how to get the data of the current state so, which Pawns are still active and info like that?

01-31-2010, 05:52 AM
You mean like if a pawn has died or something like that? You could write the data on the death event, or any other event, such as:
Pseudo code:

event dead() {
Pawn32 = 0;

01-31-2010, 01:52 PM
Well not dead pawns, just active ones, i need to make it so that when someone saves at a time when theres alot going on it records all the pawns in the level, so where they are how much health they have etc.

01-31-2010, 02:38 PM
you're going to have to look at how world info works and how to get information for each actor you want to save data for. i'd think a custom .ini for the save data is a good place to start, writtern through a SaveGame class and then read by a Loadgame (names may be reserved).
It wont be as simple as simply taking a "screenschot" of that tick in the map (awesome if it is), and then you have things like what AI was going to do, what events were / are / have happened. Things like pawn info seems like the least of your work, but i do believe there'd be some kind of way to work around having to script native. Just need to do a lot of research or ask nicely someone who worked on bioshock or Arkham...?? I think i've seen a few classes in the source called savegame / autosave or something similar. Not what i'm focusing on learning though so sorry I can't help more