Announcement

Collapse
No announcement yet.

Enum variables and Game Save

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

    Enum variables and Game Save

    I'm trying to make a character customization UI. Since different buttons can be pushed before the player decides what torso he likes, I need to save the last button selection into Game Save.

    Below are the blueprints that I have working. Currently if I press a button, the torso swaps out correctly at runtime:
    Image 1. I created an Enum from the content browser, created an entry for each torso I have as a child of the Third Person Controller.
    Image 2. At runtime, when the player selects a torso button, I "Switch on Enum" and set the torso type they selected.

    I'm hoping, I can save the "ENUM variable" of the last button selection into Game Save.
    How can I tell "Game Save" or "Game Instance" what torso is selected at runtime?
    Attached Files

    #2
    I'm hoping, I can save the "ENUM variable" of the last button selection into Game Save.
    You can. What's the actual problem with doing it?

    Comment


      #3
      Hello Everyone, I'm learning Blueprints and I'm stuck. Since the player can change his mind and press many buttons trying to choose a torso he likes in the Third Person Character, how can I tell the "Game Save" or "Game Instance" what final torso is selected at runtime? Racking my brain trying to figure out a way to store the torso selection variable so it will get loaded next time the game starts up. (So the player does not have to choose the torso again)

      Comment


        #4
        You create a Save Game object with variables representing player's choices and set them the same way you set them in your widget. Save game object can be then saved to a slot.

        Have you had a chance to look here?
        https://docs.unrealengine.com/en-US/...ame/Blueprints

        You will most likely need to save many more variables besides the aforementioned enumerator; packing multiple variables into structs helps with this.

        Comment


          #5
          Since I'm new to Blueprints, getting the clothes to display correctly is different from the info in the Blueprint docs. My score works in Game Save, but how does the GameSave/Game Instance come into play? Here are some screen grabs.

          Like you suggested, I created a Game Save object with my torso variables representing player's choices. Please tell me if I did the "SET" incorrectly?

          I'm feeling like there should also be something in the "Load Game" function that reads from the "Game Save." Then when the new game starts (or going into another level), something goes through the Third Person Character and turns on the visibility of the selected clothing.
          Attached Files

          Comment


            #6
            Hello Everyone, how do I check if the Save Game function saved the clothing selection from the ENUM? Is there a way to verify the contents of the 0.sav file from Save Game? Is there a way to do a Print String from the Load function to see what is actually in Game Save 0.sav file?

            These are my Blueprints:
            Attached Files

            Comment

            Working...
            X