I think I've mentioned attempting this before in an old deleted post, but I'd like to have another attempt at getting a save menu working ala Lucasarts, ScummVM and Sierra's GUI, whereby you have:
- a separate slot for a relatively retro-style amount of (Lucasarts had about 100, Sierra had about 20) for each save game
- clicking a slot would change the slot name into an input box to change the slots name
- pressing enter or clicking a save button would save the slot name as the input text you'd written
- (optionally) Sierra games would move the most recently saved slot to the top, however lucasarts didn't
I've tried getting this working with separate save items for each slot, and with scripting, neither of which I was technically proficient enough to be successful with. Currently, the AC save menu has:
- capacity for a smaller, more modern amount of save slots (five to ten)
- clicking on any slot will provide you with a separate input box to type the name into
- Upon pressing save or enter will close that input box and pass the name onto the save slot name and save the game
The current setup is great for modern games, but I'm looking to recreate classic/retro games with the lavish amount of save game slots and their era-appropriate method of inputting and storing the name/game save.
Would it be possible to consider a tutorial or template download to use for this type of save/load menu? I believe AGS used a 90's-style menu system as well, so it would be cool to have the option to easily use this type of save/load menu, if possible!
Comments
https://gfycat.com/TenseDefensiveArcticwolf
https://gfycat.com/DeafeningMediocreBirdofparadise
Finally, is it possible to pre-populate each empty slot with a _ or some such on the save UI, to show the possible available save slots?
It's looking awesome thanks to this amazing template! I made a quick adjustment in Save_On_Click of hiding the inputbox once save has been clicked:
There's a couple things I can't quite work out:
1. Can menu button text be changed via actionlists? I don't think so, but I wanted the three buttons to be Load, Save and Close, and whilst the inputbox to type the save name in I want the text to change to cancel, and if cancel is clicked, it can return to Close.
2. It's currently configured so first click selects the slot and show the inputbox and a second click edits the input box, which is a sensible way of doing it when sharing save and load, but is it possible to select the inputbox for editing on first click (with the blinking line to show it's editable)? I'm assuming this might be with a script.
3. Can pressing the 'enter' key function the same as clicking the save button? So when you finish typing and press 'return/enter' key, it saves the slot the same as clicking save. I also think this might be require scripting.
Again, this template is a lifesaver, thanks again so much for making it!
You can use Variable tokens to set the names of your Buttons. Create a new Globl String variable named e.g. "LoadButton" and set its value to "Load". Note the Replacement token value, and set that as the Button menu element's Label text. You can then control its display using the Variable: Set Action. Alternatively, you could use a PopUp variable.
You can call the PlayerMenus script's SelectUIElement method, which accepts a Unity UI GameObject, i.e.:
AC.KickStarter.playerMenus.SelectUIElement (myInputBoxGameObject);
If the Menu's Source is Adventure Creator, and Input element allows you to define which Button element to run when the user presses Enter/Return. Otherwise, if using Unity UI, you can configure your Input Field component's On End Edit to run the same ActionList asset that the Save button runs.
Thanks! Again, this is perfect, I really love the latest save going to the top ala Sierra, so convenient! This is probably pushing it (as I tend to!) but can I fairly easily add save game screenshots to this as a little image that displays and changed depending on the selected slot? It would be probably be worth waiting until a Unity UI version of screenshot saves is made (if you plan on doing) for this, but I'd be interested in how difficult it would be to add such a feature to a menu like this?
The "Save game screenshots" template has been updated with Unity UI.
Thanks, that's awesome! So the image is just a button that's hooked up to a screenshot element, would this require scripting to communicate that the selected save slot in the menu should change the screenshot button to display the currently selected slot's screenshot (and display blank if selecting a new slot to make a fresh save)?
AC.KickStarter.playerMenus.SelectUIElement (myInputBoxGameObject);
How should this be used? I'm not sure if I should add this to RepositionSaveInputBox or add a new script somewhere, I'm also not entirely certain what I'm calling in (myInputBoxGameObject), would this be a public gameobject? I tried using an element as a string instead but it failed.
This worked really well until I clicked away from the box on a blank area of the screen to de-focus the input box, and it saves because it's still running an "on end edit". Should I use an active input to run the save script in some way, or should this be scripted as a key press if the input element is active?
It's automatic - at least so far as the needs of the template go.
It's the GameObject that contains the InputField component - nothing to do with AC or elements, it's all Unity UI.
Good point about the de-focusing, I didn't realise it triggered then as well. An Active Input could do it, because you can use a Menu: Check state Action to determine the visibility of the Input element, or state of a variable you change when editing occurs.
Active inputs are really cool! I did it this way (it seemed easiest!), I'll post it in case it's of any use to anyone else. Unfortunately, loading a slot seems to reenable the active input even if turned off before the load action, so I just force it off when the save menu is loaded. Would you recommend using an alternative (and potentially less confusing!) method with menu: check state? I'm not quite sure how to hook that into the active input.
Thanks! I did it by making a public for myInputBoxGameObject, dragging it in, and it nicely selects it now! I'm not sure if there's the option of putting the blinking cursor at the end of the input edit box instead of selecting the entire input box so that typing replaces all the words? Pressing End obviously works, but for user readability, it would be cool if there's a way of making it select the last character when the slot is clicked?
So I'll try adding a single screenshot button object set up the same as the screenshot template. I'm not sure how it'll change the screenshot button to the selected save on click by itself (since the template have six predefined screenshot image buttons for each save slot), but I'll give it a go!
The Submit input is causing issues with the save as you mentioned earlier, so I've removed that and for space I'll delegate it entirely to an ActiveInput.
Phew, sorry about that!
The state of all active inputs are recorded in save games, so I'd expect that to be the case. Since the input is only necessary while the inputbox is visible, however, you can try keeping it active and just use Menu: Check state to check the InputBox element's visibility.
Since you're relying on Unity UI, the feasibility of such behaviour is on Unity and not AC-related. You should try searching the Unity forums for more on this.
For the blinking input, It appears to be 'InputField.MoveTextEnd()' is what I need, so I'll try and hook that into AC.KickStarter.playerMenus.SelectUIElement
Just wanted to mention, I tried using a menu check for the active input instead of all the turning on/off methods (if input element visible, run the save_click action) and it gets stuck for some reason? It doesn't complete the action, it's like it's paused and it just does the first part of it. I can use the other method that works, but I'm curious what's actually causing this:
Here's a video of it getting stuck and not finishing: https://gfycat.com/WhoppingAstonishingIndianspinyloach
Okay, this seems to work! _Credit to Unity discord:
*Add this script: http://pasteall.org/1445951
*Replace the inputbox with this: http://pasteall.org/1445950
*Reconnect the text and placeholder components:
That seems to add the cavat to the end of the text rather than selecting it, and hopefully no issues should arise from it!