Struct Will Only Set One Type of Variable from SaveGame, Based on Replication Setting

DjangoDurango
Wed, 08 Nov 2017 00:54:39 +0000
Editor Scripting

So I have my GameMode’s post login event calling an event in my Player Controller, InitialSetup.

This event, which is set to replicate to owning client, calls a function, LoadSettings, that takes settings (the user’s Steam name and integer values representing which character they’d prefer to spawn in as) that were saved to a SaveGame in the Main/Options menus and then sets the according variables in the PlayerInfo structure on the PlayerController.

Problem is, the PlayerInfo structure will only update the PlayerName OR the Preferred Character ID’s, not both. As it’s currently set up, with InitialSetup replicating to owning client, the Player Name variable will be set correctly, but the Preferred Character IDs will be ignored. Conversely, if I set the InitialSetup event to Not Replicated, the Preferred Character ID’s are set correctly, but the PlayerName is not.

I’ve done Print String tests and can confirm that all the values are being saved and then loaded from the SaveGame, but when I try to read the same values off the structure where they should have been set, they return defaults.

What do I need to do to make ALL the values stick when setting them in the PlayerInfo structure?

1 post - 1 participant