Continue last save/preview saves
Continue last save/preview saves
Hey all.
1. How can i create a button that appears only wen a save exist. if more then 1 save exist i will load the last save. like a continue butto.
2. how can i preview my saves. a want to create a list with a max of 4 saves and show a picture, savedate and complete status from this save. how can i get infos from a save from slot without loading the save from slot.
greetings!!!
1. How can i create a button that appears only wen a save exist. if more then 1 save exist i will load the last save. like a continue butto.
2. how can i preview my saves. a want to create a list with a max of 4 saves and show a picture, savedate and complete status from this save. how can i get infos from a save from slot without loading the save from slot.
greetings!!!
Re: Continue last save/preview saves
Hi,
You can add a script with a Start() or OnEnable() method to the button that checks the PlayerPrefs value:
When you save a game, also set a PlayerPrefs key to the slot # of the save. Example:
Code: Select all
SaveSystem.SaveToSlot(slotNumber);
PlayerPrefs.SetInt("Last Slot", slotNumber);
Code: Select all
bool hasLastSave = PlayerPrefs.HasKey("Last Slot") && SaveSystem.HasSavedGameInSlot(PlayerPrefs.GetInt("Last Slot"));
gameObject.SetActive(hasLastSave);
Please see: How To: Include Summary Info In Saved Games
Re: Continue last save/preview saves
thanks for the great reply!
one more question. can i change the destroy saver status from a or all objects?
i try to setup a enemy handling like in souls like or hollow knight. enemys still dead between scene but when saving. all enemys except bosses respawn.
greetings
one more question. can i change the destroy saver status from a or all objects?
i try to setup a enemy handling like in souls like or hollow knight. enemys still dead between scene but when saving. all enemys except bosses respawn.
greetings
Re: Continue last save/preview saves
Yes. UNtick the DestructibleSaver's "Save Across Scene Changes" checkbox. It will only save the enemy's destruction status if the player saves and loads in the same scene. If the player moves to another scene and then returns, it will not use the DestructibleSaver's destruction status.
Re: Continue last save/preview saves
Okay thank you but that not what i mean.
What i try to implement is:
Enemy destruction Status should saved between scenes. Also wen i save and load.
I whant reset This Status in a specyfic case. In my case every time wen i save. Wen i save / on a specific trigger all enemys destroction status should be reseted. After This reset wen I loading a scene the emenys in This scene should spawn again
Greetings
What i try to implement is:
Enemy destruction Status should saved between scenes. Also wen i save and load.
I whant reset This Status in a specyfic case. In my case every time wen i save. Wen i save / on a specific trigger all enemys destroction status should be reseted. After This reset wen I loading a scene the emenys in This scene should spawn again
Greetings
Re: Continue last save/preview saves
Hi,
If you want a trigger to reset saver data, you can delete the saver's data. For example:
If you want a trigger to reset saver data, you can delete the saver's data. For example:
Code: Select all
public List<Saver> saversToReset; // <- SET IN INSPECTOR
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
saversToReset.ForEach(saver => SaveSystem.currentSavedGameData.DeleteData(saver.key));
}
}
Re: Continue last save/preview saves
Okay thanks. In This way i need to assign every Single enemy in the Inspektor right ? Can i Do a easy way to collect All "destructable saver" in the hole game?
Greetings
Greetings
Re: Continue last save/preview saves
Yes, you could do this:
[EDIT: Don't use this. See below for working solution.]
Code: Select all
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
foreach (DestructibleSaver saver in FindObjectsOfType<DestructibleSaver>())
{
SaveSystem.currentSavedGameData.DeleteData(saver.key));
}
}
}
Re: Continue last save/preview saves
thanks!
great tool, great support!
greetings
great tool, great support!
greetings
Re: Continue last save/preview saves
Thanks! Happy to help.