How do I display some of their specific global variables on each archive in the load screen? I want the top of each grid to show the screenshot and the bottom to list some global variables for that archive.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The ExtractSaveFileVariables function can be used to return a List of Global variables associated with a given save file. This can then be iterated through to find the intended variables, and either used to update the Save File's display label or a separate Label element.
What variables are you looking to read, and where would they be displayed? Screenshots or a mockup that explains the intent would be best, if possible.
Is this picture clear?
https://streamable.com/m4a3wk
The box in the middle has a screen shot at the top, a line of playtime in the middle, a list of values for the main character's attributes at the bottom, and a delete button at the bottom right.
A couple of prerequisites:
Open up AC's MenuSavesList script and add the following function. I'll make the same addition to the next release:
public SaveFile GetSaveInSlot (int slot)
{
int saveID = GetOptionID (slot);
return KickStarter.saveSystem.GetSaveFile (saveID);
}
Then, open your Unity UI prefab for the menu and create a new Text object to show the variables in. Attach this script to it and fill in the details in its Inspector:
This script will populate the Text component with variable data from the save, given the "Save Slot" index variable in the SavesList element.
If you encounter issues, share screenshots of your UI prefab and Menu/SavesList element's properties. Images can be hosted on imgur.com.
Thanks!I will try!
Nice!It works!