I want to add an autosave when user walk on a tile without any promp.
Did you have any idea? Thansk =:0)
$gameSystem.onBeforeSave();DataManager.saveGame(x);
Good, I try that. Any way for know the current save used?
also, where the player will appear after reload&
DataManager.latestSavefileId() will give you the last file loaded or saved. Of course by using that, you're making the assumption that the player will be happy for you to save over their progress at a time of your choosing. I don't think I'd be happy about that.
After reload, they will appear on the trigger spot - where they were when you executed the save command.
ok So corect me if Im wrong:
DataManager.saveGame($gameSystem.onBeforeSave()); will save on the last used save file.
If I want to check if a file exist first that will be something like if ($gameSystem.onBeforeSave() !== 0)
But if no save exist and I want to force use to save, what I do?
$gameSystem.onBeforeSave() // for make the file ready for save
DataManager.saveGame(1); // it will save on file 1
you can replace 1 for
DataManager.latestSavefileId()// it will save it to last save file you used and if you dont have any save file it will save it to 1
Just one last thing, if a save file exist on save 1 and the user start a new game, did that will overwrite save1 or that will save at slot 2?
nope, it will overwrite save 1.
you can start game with new save option so the player can save with new number
No, that's not what was said at all. You need to run two commands as they were shown, and you need to use the snippet I gave to get the last savefile id.
$gameSystem.onBeforeSave();
DataManager.saveGame(DataManager.latestSavefileId());
If the player hasn't saved a game yet, latestSavefileId() will return 1. If they have saved a game, it will be the id of the last save file made. It gets this by looking at all the save files and flagging the one with the latest timestamp. So yes, if they save to slot 1 then start a new game, your autosave will overwrite their slot 1 save file.
What about just opening the save screen and prompting them to save? If they want to, they can, if they don't want to, they can skip it, and they can save into whatever slot they want.
Depends on the reason. By the OP's description, it's only at a certain point in the game, so sounds like a 'warning' autosave before a pivotal point or battle, rather than an autosave that happens each time you go to a new map. In that case it's not a bad idea to alert the player that something important might be about to happen. I'd certainly rather have that, and have to click once to choose a save slot or to cancel, than have the game overwrite my save file without telling me.
Making a new save file everytime an autosave occur is a very bad idea and the player will have all their filesaves written which is confusing, autosaves are supposed to overwrite the latest file while you are being able to do manual saves from the menu or whatever.
I agree on the prompt if your design is around choices making rather than dungeon crawler.
Did you not read the question about starting a new game, and having its autosave overwrite a different game's save file? That's what prompted the "let the player choose" suggestion in the first place. Or would you prefer to have one game in progress, saved, then start a new game and have your autosave overwrite the other game's save file?
Ok so I need to edit a little bit my code for make sure that slot 1 will never be overwriter by accident. So if lastsave=0 then I will make a promp asking user to save game before continu. I want to force him to do it. SO if he cancel that will ask him back again at long that he did not save. But how make a save popup appear?
There is an Open Save Menu event command on tab 3.
If lastsave is 0, that means the player has never saved, so you would be safe to use save file 1, because you know it's not going to exist already.
To see if they saved a game, you can use Control Variables to get the Save Count (under Game Data > Other). Then open the save menu. Then use Control Variables to get the save count again, into a different variable. Finally compare the two variables. If they are the same, it means the player didn't save. If the second one is higher, it means the player saved.
Not sure what you mean by " There is an Open Save Menu event command on tab 3. "
Also, lastsave will return 0 on a new game event if slot 1 is used.
Is there a way to find if a game is a newgame when being started? I'm attempting to make autosaving as well but whenever starting a new game it saves over the last used file.
IDK if there's a default method but activating a switch or something during the press of the new game button isn't hard to do..
OK I see but did you have the equivalent in script for calling the save windows?