I want to learn the method of saving a game when walking up to an actor, but i cant quite wrap my head around how it should work. Any suggestions or tips i can use?
Either the player or the actor needs a collision box. One of the things you do on overlap, is save the game
heres one way you might set up your blueprint->blueprint communications to get different classes talking to eachother
What you need:
-
blueprint interface - name it “SaveGame_BPI” or something like that. In it, make one event called “RequestSaveGame” or similar
-
Make a blueprint derived from game instance class. In it, under class settings, implement the SaveGame_BPI. In MyBlueprint panel, find the RequestSaveGame event and right click to implment it. On the implementation, add a print string which says “Game save request has reached the game instance successfully.”
(also go to project settings>maps/modes and set the GameInstance you just made to be used for the project) -
On the bonfire type actor, do something like this:
Now you have successfully created the ability for your actor in the level to communicate with the game instance, which is a common class that people put save game operations.
I find it easiest to split my work into two categories - setup communications, and then unique logic.
This just seems to make work feel less complex and more productive. For setting up communications I am mainly confirming things work by using print strings. The major things I am thinking about are “am I using a consistent pattern to my communications? Who should have responsibility for what? Am I making good use of unreals provided framework?”
ANd then when it comes to implementing the unique logic that happens after communications are succesfully setup, my mind is more free to just focus only on those details. I am not trying to solve too many different problems all at once.