I'm using this tutorial (https://adventurecreator.org/tutorials/custom-save-game-labels) to create custom save game names that the player can then edit, that's working very well.
I would like, on the Load menu, in the saveslist, for each button to display not only the name but the content of a variable from that save file (in this case, the hours played.) Currently I'm saving that information into the save name itself, but that information would become out of date the next time the player used the same save file. Ideally I'd love to display the info as a second, smaller label under the save file name. Is there a way to access that information, or run an actionlist when the button is being created that can do that? Thanks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
It requires scripting, but it's possible.
Is this a Global Variable? Essentially, you'd need to extract the variable data for each save file as the Load menu is populated, and then display that in a Text box associated with that save slot.
The SaveSystem script's ExtractSaveFileVariables function can be used to extract variables from a save file.
You'll need to use Unity UI so that you can attach such a script to each Text box.
Something along these lines ought to do it:
I'm having some issues with this script, it's throwing a few errors -
Assets\DisplaySaveVariable.cs(19,31): error CS1061: 'MenuSavesList' does not contain a definition for 'GetSlotIndex' and no accessible extension method 'GetSlotIndex' accepting a first argument of type 'MenuSavesList' could be found (are you missing a using directive or an assembly reference?)
Assets\DisplaySaveVariable.cs(20,39): error CS1061: 'MenuSavesList' does not contain a definition for 'GetSaveFile' and no accessible extension method 'GetSaveFile' accepting a first argument of type 'MenuSavesList' could be found (are you missing a using directive or an assembly reference?)
Assets\DisplaySaveVariable.cs(21,20): error CS1501: No overload for method 'ExtractSaveFileVariables' takes 2 arguments
What's your AC version? It should compile with the latest release.