Announcement

Collapse
No announcement yet.

How screwed am I? (Saving your game)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How screwed am I? (Saving your game)

    Heya good folks from the UE4 forums! I think I've made a big mistake. Currently working on a quick side RPG project as somewhat of a newbie to the engine. I decided to store all my variables from the project such as Currency, Health, Time of day, Strength, and even some random booleans into the ThirdPersonCharacter blueprint.

    Now that I'm looking into how to save these variables and load them it looks like they don't belong there. What should I do about it? Or is there a way I can set these variables inside a save state?

    #2
    You should be fine with storing player-specific variables in the player character (or controller), but things that are not player specific (Time of day, etc.) should probably be stored in the Game State. If it is a single player game, you don't need to worry so much about where things are located, since as the authority, the single player has access to all game framework classes (Be careful, you'd have a lot of busy-work if you wanted to let additional players play).

    As far as actually saving the variables, it doesn't make a difference where they are located, so long as you have access to them.

    Here are some good reads:

    https://docs.unrealengine.com/en-US/...ework/GameMode
    https://docs.unrealengine.com/en-US/...ame/Blueprints
    Marketplace Assets

    Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
    Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
    Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

    Comment


      #3
      Originally posted by Jamendxman3 View Post
      You should be fine with storing player-specific variables in the player character (or controller), but things that are not player specific (Time of day, etc.) should probably be stored in the Game State. If it is a single player game, you don't need to worry so much about where things are located, since as the authority, the single player has access to all game framework classes (Be careful, you'd have a lot of busy-work if you wanted to let additional players play).

      As far as actually saving the variables, it doesn't make a difference where they are located, so long as you have access to them.

      Here are some good reads:

      https://docs.unrealengine.com/en-US/...ework/GameMode
      https://docs.unrealengine.com/en-US/...ame/Blueprints
      Thanks for your help this gives me some relief. Now I'm still having problems figuring out how to save the actual variables.

      Comment


        #4
        Saving your game is pretty easy. https://docs.unrealengine.com/en-us/...ame/Blueprints

        I've been doing all my saving/loading in my GameMode, which I'm pretty sure is correct.
        https://www.patreon.com/MMaxwell
        https://twitter.com/Michael25991355

        Comment

        Working...
        X