Adding a QuickSave feature

QuickSaving is a handy feature that lets you press a single key to either save or load a special "QuickSave" save slot. In this tutorial, we'll cover how to implement a QuickSave when pressing F5, and QuickLoad when pressing F9.

To do this, we'll rely on Active Inputs - a feature that lets us run ActionList assets when a particular key is pressed under certain conditions. Before we can do this, though, we'll need to first define the inputs involved.

Open up Unity's Input settings by choosing Edit -> Project settings from the top toolbar, and then select the Input Manager. Create two new inputs by increasing the Axes property by 2, and then fill in their details according to the screenshot below:

We can now assign these inputs in AC's Active Inputs window. We can access this window by choosing Adventure Creator -> Editors -> Active Inputs Editor from the top toolbar.

Inside this window, click Create new Active Input. This Active Input will be used to save the game, so set the Label and Input button fields to match the QuickSave input we just defined. Then click Create beside the ActionList when trigger field to automatically create and assign the ActionList asset that will run when this input is pressed:

The Label field is just for our reference, but the Input button field must match the name of the input listed in the Input Manager, not the keyboard key itself.

Double-click the newly-created ActionList asset (here named "ActiveInput_QuickSave") to bring up its ActionList Editor window. Set this ActionList's single Action to Save: Save or load, its Method field to Overwrite Exiting, and Save to overwrite field to Autosave. This will cause the game to be saved in the Autosave slot:

Return to the Active Inputs window, and create one more input. This time, set the Label and Input name to QuickLoad, and create a new ActionList asset. This time, however, we'll also need to configure the Available when game is field - which determines the game-state that the input will be active during. To allow the QuickLoad button to work during Cutscenes and Conversations, enable Normal, Cutscene and Dialog Options:

Double-click this input's ActionList asset and set its Action to another Save: Save or load Action, this time setting the Method to Load Game, and the Save to load to Autosave.

While playing the game, we can now press F5 to save, and F9 to load!

If we wish to temporarily disable either of these inputs - for example, during our main menu screen, we can use the Input: Toggle active Action. Just be sure to use another such Action to re-enable it again!