Still learning, and making leaps and bounds of progress (in my own mind). I am making a top-down RPG very similar to the way the old Pool of Radiance: Ruins of Myth Drannor worked, and am trying to accomplish everything via blueprints if possible. The goal is to have a party of 4 characters the player controls to crawl multiple dungeons. The player will be able to create their main character and add other members to their party as the story progresses. Combat will be handled in a turn-based manner, much akin to the D20 Initiative system.
I have a blueprint character (BP_SampleCharacter) which stores all sorts of character-based statistics, a player pawn (BP_PlayerCamera) to handle the camera and mouse events, a basic level with an AI that runs around and a BP_SampleCharacter that is spawned via that level’s blueprint, and a basic start menu which loads a UMG character creation screen where the player can choose race/class/etc.
Since I want the player to be able to save and load the game, with possibilities of multiple saved games, where would be the best place to store the party members (including the main character)? I am thinking, and correct me if I’m completely wrong, that I should use the character creation screen to create an instance of the BP_SampleCharacter with all of the specified stats based on selections and put that character into an array (called something like PartyMembers). I just don’t know if I should then take that and immediately put it into a SaveGame object and load/spawn it with the first level, or have it controlled by the GameMode/GameState/etc. Any help or advice would be very much appreciated!
The current save system does not allow for saving entire BP, as far as I know at least. You will need to save *just *the variables (stats) in a save game object - you can store them in an array of structs.
When you load your struct from a save game object, spawn the character and assign the variables (which can be exposed on spawn, of course).
When it comes to storing data, Game State is a valid choice.
By doing this, would I have to spawn and assign the variables on a per level (map) basis, or can I define it within the Game State and spawn that object in a level?
Game state as far as I know is only useful to hold data just for one specific level; it resets each time a new level is opened. If you want data that persists beyond opening and closing of a level, then you will want to use the game instance which only resets once the application has been closed.
For saving data, as mentioned you’ll want to use structs to store data variables: ints, strings, bools, etc… Keep in mind that you cannot save references to an actor object ever, but instead you can save the data from that object and load it back into the game once it is spawned again.
Interesting, and thank you for the reply. The way it sounds, I may need to make some modifications to the way my characters are created if this is the case. Are there any good tutorials (with graphical representations) on how to specifically accomplish this?
In terms of tutorials for saving data with blueprints, the best one I have found is from here: https://www.youtube.com/watch?v=6l7uynUwm5M. If you are more comfortable working with C++, then I think Rama’s tutorial on saving data in binary format is probably the best thing to use.
Awesome, thanks for the link. I’ll check his tutorial out when I get some time (at work right now, shh don’t tell! LOL). Unfortunately, I have absolutely 0 experience in C++. However, I am familiar with C# and Java, so picking up C++ probably wouldn’t be a bad idea. I’m not the only one working on this though, and they have even less programming experience than I do, so am wanting to keep as much in BP as possible.