Announcement

Collapse
No announcement yet.

Character clothing configuration save

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

    Character clothing configuration save

    What would be the best way to save what meshes are displayed on the character rig when the game starts up?

    For example, the player might want to the avatar wearing a tank top and shorts when the game starts. The player might change the avatar clothing during the game to a jacket and pants; which will load up the next time the game starts up.

    I'm hoping there is a way to save what geometry is visible on the rig and save it out to a file that will load up the next time the game starts.

    #2
    Found this video to use a Structure for the player info. https://www.youtube.com/watch?v=RKx0K98pxl8&t=61s

    Comment


      #3
      I'm having trouble understanding, how to actually set up the variables in a "Structure" so the visible character mesh gets stored at run time.
      If the Set Visibility widget defines what mesh is visible, do I convert the Set Visible On/Off to a bool? Or, Do I find a way to output the Set Visible widget to a String? Then, pass that info into a variable?

      Any suggestions are welcome.
      Last edited by MMI_Sean; 03-22-2019, 06:11 PM.

      Comment


        #4
        Originally posted by MMI_Sean View Post
        I'm having trouble understanding, how to actually set up the variables in a "Structure" so the visible character mesh gets stored at run time.
        If the Set Visibility widget defines what mesh is visible, do I convert the Set Visible On/Off to a bool? Or, Do I find a way to output the Set Visible widget to a String? Then, pass that info into a variable?

        Any suggestions are welcome.
        I don't know exactly but you can setup the variables you want to store inside the savegame bp. So if you want to store a structure inside a savegame i guess you create that variable in the savegame, then on save set this structure.
        [LEGENDS of EPICATwitter / FB / YT / Vimeo discord.gg/saG3x4Y]

        Comment


          #5
          I apologize if any of this seems patronizing, I don't know how your game is set up so let me procedurally create a scenario for you.

          So let's say for example you have a STRUCT with members like "Clothing Name", "Clothing Type", "Male/Female" "Soft Reference" and "Enabled."
          Clothing Name is the name displayed to the player.
          Clothing Type is an ENUM value like Shirt, Pants, etc.
          Male/Female is an ENUM value for which gender model the clothing is intended.
          Soft Reference is a string path to the model.
          Enabled is a boolean value. If it's true, the character is wearing it (visible) and if false, the character is not wearing it (not visible).

          Your character then has an array of this struct as one of its variables. Each member of the array is a struct of this type and you either manually set up these values or load them from a spreadsheet at runtime.

          The game then checks when the player changes clothing if the reference is valid, then loads the model. Set Enabled to true and also set the model's visibility to true. Set the previous piece of clothing's "Enabled" and visibility to false if the clothing type is the same to avoid a conflict.

          When saving, save out the whole array, either to a built-in UE4 save type or by writing out each member as a string.
          When loading, iterate over all members of the array and check to see if "Enabled" is true for each member and if so, check the validity of the soft reference and if it's valid load the model and set its visibility to true.

          You can convert the visibility enum to bool by using a select node. Plug the result of the get enum into the left side of the select node, then have the right side results of the select node correspond to the left side e.g. left side says 'visible' so the right side should be TRUE or checked and left side 'invisible' should have a right side that's FALSE or unchecked.
          iTween For UE4
          Procedural pathed animation for actors, components & UMG - $0
          Runtime DataTable
          DataTables dynamically loaded from text or Google Sheets while your game is running!
          easyCSV
          Fast, cheap, and accurate CSV parsing at runtime!

          Comment


            #6
            Hello Jared, I am new to blueprints and UE4. I'm trying to set up a player customization UI. I have attached a screen grab of the blueprint with descriptions of the flow. Is there a way to output this flow to a "String" or a "BOOL that would get updated in a STRUCT?
            Attached Files

            Comment


              #7
              Hello Jared, using the graph described above, would this be a sound method for outputting the "Set Visible" Name to an Array index?
              Attached Files
              Last edited by MMI_Sean; 03-25-2019, 04:51 PM.

              Comment


                #8
                Hello Jared, adding to the graph described above, would this be a good way to output the "Set Visible" Bool visibility to an Array index?
                I broke up the attachments so it would be easier to see how the "Name" variable was set up in the previous post and the way the "Bool" (visibility) variable is set up below.
                Could I use this to update the STRUCT?
                Attached Files
                Last edited by MMI_Sean; 03-25-2019, 05:04 PM.

                Comment


                  #9
                  Hello Jared, then I converted the 2 variables into Arrays, is this correct?
                  Attached Files

                  Comment


                    #10
                    any update?

                    Comment

                    Working...
                    X