What saves
Each local player of a standalone game, and the host of a listen server, saves with every save:
- its own pawn: its variables with SaveGame ticked, transform, visibility, velocity and movement mode, as Actor Defaults or a Rolly Save component on the pawn chooses, and its components that save;
- its player controller: its variables, and the direction the player looks while the pawn’s Save Transform is on;
- its player state, when that has a variable with SaveGame ticked or a Rolly Save component;
- the components of each that save.
Get Save ID names them by the player’s index in the game: Local:0 for the first player’s controller, 5|Local:0|@Pawn for its pawn, 5|Local:0|@PlayerState for its player state. Players who joined a server from another machine are not saved. Project Settings > Plugins > Rolly Save > What Saves > Local Players turns this off: the player is neither saved nor loaded, and the next save drops what an earlier save held for players.
When the pawn gets its saved state
The Game Mode spawns the player’s pawn on every map load, at a Player Start, after the map’s actors took their saved values. With Open Saved Map, the pawn, controller and player state take their saved values once that pawn is there and the Game Mode has finished placing it, so the Game Mode’s own rotation and a character’s reset of its movement mode do not overwrite them:
- as the world’s Begin Play starts, when the player has its pawn by then, as with a Game Mode Base or a match that starts at once;
- otherwise, such as with a match that starts later, a player who starts as a spectator or a pawn your game spawns later, the frame after the player first possesses a pawn. A save made before then writes the player’s state as the load read it, not the defaults its objects hold until then.
With Keep Current Map, they take their values at once. In another map than the one the save was made in, the pawn stays where it stands and the player keeps facing where it faces, since the saved place belongs to the saved map. Then their On Rolly Save Loaded and their Rolly Save components’ On Loaded run. An actor the player’s pawn owned (Set Owner) gets its owner back at the same moment.
A save made with another pawn or controller class than the game now gives the player keeps the record of each changed one, and the load’s Issues and the Message Log say so (ClassMismatch, “the pawn of local player 0 was saved as …”).
Vehicles and other pawns
A player’s own pawn is the pawn it possesses while it has no own pawn alive: the first pawn in a map, and the next one after its own pawn is destroyed. A pawn it possesses while its own pawn lives, such as a vehicle or a party member, is not its own.
- The own pawn always saves with the player, also while the player sits in a vehicle. After a load the player gets the Game Mode’s new pawn, which takes the saved state, so there is never a second character.
- The vehicle saves as an actor of its own and comes back where it was, with nobody in it.
To put the player back into the vehicle after a load:
- In your player controller Blueprint, add a variable Vehicle of type Pawn (Object Reference) and tick SaveGame. A reference to another saved actor saves as that actor’s ID.
- Set it where the player gets in, before Possess, and clear it where the player gets out.
- Add the Rolly Save Interface to the controller (Class Settings > Implemented Interfaces), and in Event On Rolly Save Loaded call Possess with Vehicle when Is Valid says it is set.
What crosses maps
The player’s saved state applies after a load only. Travel to another map never applies it, since the pawn would go to coordinates saved in another map: the Game Mode places the pawn in each map. Keep what must cross maps, such as health or gold, in the game instance, in an object registered with Register Object for Saving, or in a player state that seamless travel carries on.
In a network game
On a listen server, the host saves and loads as a local player. Clients’ players are not saved; their pawns are left out of saves as actors too, since the Game Mode spawns them again for each player.