Hello, I searched on the forum but didn't found any answer.
Can you help me to know how to add informations on the display slot informations ? (like default is :
"Slot X
Time : date/hour"
that's it
How can I add (for example) the player displayName (I store it in an other script) or the player level to this information?
PS : I use Menu FrameWork
[Solved] Save Slot information
[Solved] Save Slot information
Last edited by Pixchel on Thu Aug 08, 2024 5:48 pm, edited 1 time in total.
Re: Save Slot information
Hi,
For the Menu Framework in specific, see step 12 on page 4 of the Menu Framework manual:
For the Menu Framework in specific, see step 12 on page 4 of the Menu Framework manual:
In general (not Menu Framework), please see: How To: Include Summary Info In Saved GamesDuring gameplay, you can set a Dialogue System text variable named "CurrentStage". The
contents of this variable will added to the saved game summary information, which is shown in
the details section of the load game panel when the player selects a saved game. For example,
you can use a DialogueSystemTrigger set to OnStart that sets Variable[“CurrentStage”] to the
name of the scene, or use a dialogue entry’s Script field to set “CurrentStage” after major story
events.
If you want to add more information to the saved game summary, assign your own delegate
methods to SaveHelper.RecordExtraSlotDetailsHandler.
To show saved game details differently in the load game panel, you can assign an event handler
to LoadGamePanel's On Set Details event.
Re: Save Slot information
I already seen manual speak about CurrentStage, but I don't really get it... Can we have an example for this ? please. It would be helpfull
Re: Save Slot information
Try adding a script like this to your MenuSystem GameObject/prefab:
AddMoreSaveInfo.cs
AddMoreSaveInfo.cs
Code: Select all
using System;
using UnityEngine;
using PixelCrushers.DialogueSystem.MenuSystem;
public class AddMoreSaveInfo : MonoBehaviour
{
private void Start()
{
GetComponent<SaveHelper>().RecordExtraSlotDetailsHandler = RecordExtraSlotDetails;
}
private void RecordExtraSlotDetails(int slotNum, ref string summaryInfo)
{
summaryInfo += $"\nSlot {slotNum}\nTime: {DateTime.Now}";
}
}
Re: Save Slot information
Okay, it add more detail on the summary when we press the slot button to load, but it not displayed in the button itself (in save and load menu)
Re: Save Slot information
Hi,
Each save slot has two areas of information: slot summary, and slot details.
The script above adds information to the slot details.
To add information to the slot summary, you must make a subclass of SaveHelper, replace the SaveHelper component on your MenuSystem prefab with the subclass, and override the GetCurrentSummary() summary in your subclass. Something like:
Each save slot has two areas of information: slot summary, and slot details.
The script above adds information to the slot details.
To add information to the slot summary, you must make a subclass of SaveHelper, replace the SaveHelper component on your MenuSystem prefab with the subclass, and override the GetCurrentSummary() summary in your subclass. Something like:
Code: Select all
public class CustomSaveHelper : SaveHelper
{
public override string GetCurrentSummary(int slotNum)
{
return base.GetCurrentSummary(slotNum) + "\n" + EXTRA INFO HERE;
}
}
Re: Save Slot information
Okay, got it, but if we add thing to summary, it will be added to detail too. So I have found the reference in the savehelper itself to modify it, Thanks for your answer and your time, you are the best