Hello all!
I could really use some help conceptualizing how to do this...
Essentially, I currently have doors and other objects saving their state as soon as the 'open' so that when re-entering the room they remain open.
However, if the player dies before reaching a save station, I would like these things to revert back..
How would i do this with Easy Save?
Thank you so much for your help
How to revert a save state if the player dies before saving?
Re: How to revert a save state if the player dies before saving?
Hi there,
To revert back you would usually use SceneManager.LoadScene to reload the scene. However, if you wanted to do this without reloading the scene, you would need to save everything at the very beginning before the player does anything to a separate save file and load this when you want everything to reset.
All the best,
Joel
To revert back you would usually use SceneManager.LoadScene to reload the scene. However, if you wanted to do this without reloading the scene, you would need to save everything at the very beginning before the player does anything to a separate save file and load this when you want everything to reset.
All the best,
Joel
Re: How to revert a save state if the player dies before saving?
Thank you so much for the response Joel!Joel wrote: ↑Fri Jul 01, 2022 7:57 am Hi there,
To revert back you would usually use SceneManager.LoadScene to reload the scene. However, if you wanted to do this without reloading the scene, you would need to save everything at the very beginning before the player does anything to a separate save file and load this when you want everything to reset.
All the best,
Joel
I may have not been accurate enough with my description apologies!
Currently, I have it that there are certain doors and items that are locked in a room, and once opened/obtained, IMMEDIATELY SAVEs a bool to the save file. This is so that during the same play session, if the player moves to another scene and comes back the doors remain open. HOWEVER!
I am struggling with how to make it so that these doors stay open during the game, but if the player dies before reaching a SAVE STATION to lock in their progress, all the new save data reverts back to before (the last time they saved).
Thank you again for your quick response, it is incredibly appreciated!
Cheers my friend!
Re: How to revert a save state if the player dies before saving?
Hi there,
Thanks for the clarification. Is there any reason you’re not saving the state of all of the doors when they hit the save station, rather than save the state of each individual door when it’s interacted with?
All the best,
Joel
Thanks for the clarification. Is there any reason you’re not saving the state of all of the doors when they hit the save station, rather than save the state of each individual door when it’s interacted with?
All the best,
Joel
Re: How to revert a save state if the player dies before saving?
Hey Joel!
Yea, so I save the state of the door at the moment of 'Unlock' because when the player exits the room and then returns, I need the locked door to remain open.
Problem being, that if the player 'dies' before saving this progress, I would like the state to revert...
My idea as of now is to like... figure out a way to write a script to logs all data that can be reverted... and only lock it in at a save station?? I really don't know what the best practice for this scenario would be
Thanks again for your help! Looking forward to hearing from you so I can continue progress
Cheers!
Yea, so I save the state of the door at the moment of 'Unlock' because when the player exits the room and then returns, I need the locked door to remain open.
Problem being, that if the player 'dies' before saving this progress, I would like the state to revert...
My idea as of now is to like... figure out a way to write a script to logs all data that can be reverted... and only lock it in at a save station?? I really don't know what the best practice for this scenario would be
Thanks again for your help! Looking forward to hearing from you so I can continue progress
Cheers!
Re: How to revert a save state if the player dies before saving?
Hey Joel!
Yea, so I save the state of the door at the moment of 'Unlock' because when the player exits the room and then returns, I need the locked door to remain open.
Problem being, that if the player 'dies' before saving this progress, I would like the state to revert...
My idea as of now is to like... figure out a way to write a script to logs all data that can be reverted... and only lock it in at a save station?? I really don't know what the best practice for this scenario would be
Thanks again for your help! Looking forward to hearing from you so I can continue progress
Cheers!
Re: How to revert a save state if the player dies before saving?
Hi there,
In this case you would need a save file for each room, and keep a List of all rooms which have not yet been saved.
When the player dies, delete the save file for each room which has not been saved using ES3.DeleteFile.
When the player enters the save station, clear the List of all rooms which have not yet been saved.
All the best,
Joel
In this case you would need a save file for each room, and keep a List of all rooms which have not yet been saved.
When the player dies, delete the save file for each room which has not been saved using ES3.DeleteFile.
When the player enters the save station, clear the List of all rooms which have not yet been saved.
All the best,
Joel