|
|
|
sm1le  |
Beginner | Member since: 21.04.2012, 22:37 | Posts: 44 |
Likes: 0 |
| |
|
Post Topic: a system for saving and loading Posted 25.04.2012, 10:23 |
how to implement a system of saving and load from the main menu or through any other button?
sorry for my english-google >_<
|
|
|
|
|
|
|
|
 |
Programmer410  |
Trainee | Member since: 21.10.2011, 11:48 | Posts: 131 | Location: Stuttgart, Germany |
Likes: 0 |
| |
|
Post Topic: Re: a system for saving and loading Posted 25.04.2012, 22:49 |
You can auto-save with triggers and the sve flownode in fg.
|
|
|
|
|
|
|
sm1le  |
Beginner | Member since: 21.04.2012, 22:37 | Posts: 44 |
Likes: 0 |
| |
|
Post Topic: Re: a system for saving and loading Posted 05.05.2012, 17:03 |
and can be more?plllllllssss
sorry for my english-google >_<
|
|
|
|
|
|
|
sceluk  |
Trainee | Member since: 03.08.2009, 11:47 | Posts: 153 |
Likes: 0 |
| |
|
Post Topic: Re: a system for saving and loading Posted 06.05.2012, 14:53 |
so you cant save crysis 1 style?
|
|
|
|
|
|
|
 |
Cry-Ruan  |
Crytek Staff Member | Member since: 11.07.2008, 20:25 | Posts: 11626 | Location: Frankfurt am Main |
Likes: 10 |
| |
|
Post Topic: Re: a system for saving and loading Posted 06.05.2012, 15:03 |
Here's the code to save the game: Code: auto gameFramework = gEnv->pGameFramework; auto levelPath = gameFramework->GetILevelSystem()->GetCurrentLevel()->GetLevelInfo()->GetPath(); gameFramework->SaveGame(levelPath); There's a bunch of optional params for specific save situations.
*face specialist, anti-flowgraph campaigner.
|
|
|
|
|
|
|
thefarcry  |
Beginner | Member since: 28.12.2011, 12:32 | Posts: 78 |
Likes: 0 |
| |
|
Post Topic: Re: a system for saving and loading Posted 06.05.2012, 15:19 |
Quote by Cry-Ruan: Here's the code to save the game: Code: auto gameFramework = gEnv->pGameFramework; auto levelPath = gameFramework->GetILevelSystem()->GetCurrentLevel()->GetLevelInfo()->GetPath(); gameFramework->SaveGame(levelPath); There's a bunch of optional params for specific save situations. Where does this save? Is it saved in binary of plain text?
|
|
|
|
|
|
|
sceluk  |
Trainee | Member since: 03.08.2009, 11:47 | Posts: 153 |
Likes: 0 |
| |
|
Post Topic: Re: a system for saving and loading Posted 06.05.2012, 15:43 |
So if you add that code and link it to a button or hotkey, it saves the game state as it is at that moment? Or more specifically, what info does it save? Position, active weapon, enemy pos, etc?
|
|
|
|
|
|
|
 |
Cry-Ruan  |
Crytek Staff Member | Member since: 11.07.2008, 20:25 | Posts: 11626 | Location: Frankfurt am Main |
Likes: 10 |
| |
|
Post Topic: Re: a system for saving and loading Posted 06.05.2012, 15:57 |
See the serialisation methods (CPlayer::FullSerialize, SPlayerStats::Serialize etc) in Player.cpp to track what's saved for the player. Objects implement their own serialisation. Not sure off the top of my head where that saves to.
*face specialist, anti-flowgraph campaigner.
|
|
|
|
|
|
|
sceluk  |
Trainee | Member since: 03.08.2009, 11:47 | Posts: 153 |
Likes: 0 |
| |
|
Post Topic: Re: a system for saving and loading Posted 06.05.2012, 19:58 |
Ah I see, 10x Ruan
|
|
|
|
|
|
|
 |
beast  |
Hardcore Modder | Member since: 11.10.2011, 18:41 | Posts: 841 | Location: Germany |
Likes: 2 |
| |
|
Post Topic: Re: a system for saving and loading Posted 31.07.2012, 15:26 |
Hi,
Sorry for bumping that up but whats the usual way to save session-independent data ? Like overall player statistics (# kills, play time etc) ? Is there a out-of-the-box way to do it or do i need to write my own serializations methods ? (should not be stored in user-friendly formats)
Thanks, Oliver
Last edited by beast on 01.08.2012, 09:42, edited 1 time in total.
|
|
|
|
|
|
|
 |
NeoLegends  |
Uber Modder | Member since: 21.10.2011, 23:50 | Posts: 1728 | Location: Bikini Bottom, Germany |
Likes: 0 |
| |
|
Post Topic: Re: a system for saving and loading Posted 01.08.2012, 00:19 |
Kill counts may be stored in Game Tokens which are session independent, I guess.
[cryorange]Cheers from Germany [center]  
|
|
|
|
|
|
|
 |
beast  |
Hardcore Modder | Member since: 11.10.2011, 18:41 | Posts: 841 | Location: Germany |
Likes: 2 |
| |
|
Post Topic: Re: a system for saving and loading Posted 01.08.2012, 09:57 |
Hi Neo, ah right. I wonder why that not came to my mind in the first place  Can i add tokens during runtime for all levels/game instances or do i have to add them to the library within the sandbox prior to game launches ? Thanks alot, Oliver
Last edited by beast on 01.08.2012, 10:46, edited 1 time in total.
|
|
|
|
|
|
|
 |
Lavizh  |
Media Support | Member since: 04.12.2007, 03:23 | Posts: 6860 | Location: Norway |
Likes: 29 |
| |
|
Post Topic: Re: a system for saving and loading Posted 01.08.2012, 10:24 |
Game Tokens can be accessed from any level within the game itself. Just add a new game token in the editor.
|
|
|
|
|
|
|
 |
beast  |
Hardcore Modder | Member since: 11.10.2011, 18:41 | Posts: 841 | Location: Germany |
Likes: 2 |
| |
|
Post Topic: Re: a system for saving and loading Posted 01.08.2012, 10:45 |
Hi,
yes but i dont want to handle them in the editor. Instead i need to add dynamic statistics during runtime. Is that possible using the IGameTokenSystem::SetOrCreateToken ? Or does all token have to be added using the editor ?
Thanks, Oliver
|
|
|
|
|
|
|
 |
beast  |
Hardcore Modder | Member since: 11.10.2011, 18:41 | Posts: 841 | Location: Germany |
Likes: 2 |
| |
|
Post Topic: Re: a system for saving and loading Posted 01.08.2012, 11:26 |
Hi again,
i just thought about using one single token of type string to store one XML structure. Thats how i could implement dynamic data storage i guess...That single token i'd define within the editor. Should work i guess.
But are tokens windows user dependent ? Or does all users share the same tokens ?
So long, Oliver
|
|
|
|
|