Announcement

Collapse
No announcement yet.

Can save a blueprint class object?

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

    Can save a blueprint class object?

    SaveGame class is great,but I wonder if it can save somthing more than base class data?such as a group of instance constructed from a blueprint class created by myself.

    #2
    Originally posted by hejustbrave View Post
    SaveGame class is great,but I wonder if it can save somthing more than base class data?such as a group of instance constructed from a blueprint class created by myself.
    Sure can. When the instances are placed in the level, you need to save their transforms in the save game. When you re-start the level, read the SG and re-place the instances.
    Check out Zof ( puzzle game ) on Steam:

    https://store.steampowered.com/app/1414480/Zof/

    Comment


      #3
      Originally posted by ClockworkOcean View Post

      Sure can. When the instances are placed in the level, you need to save their transforms in the save game. When you re-start the level, read the SG and re-place the instances.
      In fact,I want to save my tree structure in blueprint with follows,but It didn't work and I found the treeview invalid when reload the game.

      Comment


        #4
        Originally posted by hejustbrave View Post

        In fact,I want to save my tree structure in blueprint with follows,but It didn't work and I found the treeview invalid when reload the game.
        Don't use async. I know there's a lot of youtube vids recommending it, but it's only for special circumstances. Just use the normal nodes.

        Here's 'save game 101':

        Click image for larger version

Name:	Using save game.JPG
Views:	41
Size:	221.0 KB
ID:	1865324
        Check out Zof ( puzzle game ) on Steam:

        https://store.steampowered.com/app/1414480/Zof/

        Comment


          #5
          Originally posted by ClockworkOcean View Post

          Don't use async. I know there's a lot of youtube vids recommending it, but it's only for special circumstances. Just use the normal nodes.

          Here's 'save game 101':

          Click image for larger version  Name:	Using save game.JPG Views:	0 Size:	221.0 KB ID:	1865324
          Thanks for ur advice,I've tried ur suggest and still get the same result:saving base class data is fine,but custom class data always failed...can u give some more idea?

          Comment


            #6
            Originally posted by hejustbrave View Post

            Thanks for ur advice,I've tried ur suggest and still get the same result:saving base class data is fine,but custom class data always failed...can u give some more idea?
            You can't save bare objects. You need to put the actual data in the save game yourself.

            So, if you have a tree object that consists of height, variety, number of apples etc. You have an array of tree objects in the save game. When you save, for each tree, you have to write all the data to the array, not the actual object references.

            If the tree was like this:

            Click image for larger version  Name:	Screenshot_3.jpg Views:	0 Size:	98.2 KB ID:	1865724
            Then you would save them like this:

            Click image for larger version  Name:	Screenshot_2.jpg Views:	0 Size:	237.1 KB ID:	1865725
            Then, we you reload the level:

            Click image for larger version

Name:	Screenshot_4.jpg
Views:	20
Size:	187.4 KB
ID:	1865726
            Last edited by ClockworkOcean; 02-24-2021, 08:14 AM.
            Check out Zof ( puzzle game ) on Steam:

            https://store.steampowered.com/app/1414480/Zof/

            Comment


              #7
              Originally posted by ClockworkOcean View Post

              You can't save bare objects. You need to put the actual data in the save game yourself.

              So, if you have a tree object that consists of height, variety, number of apples etc. You have an array of tree objects in the save game. When you save, for each tree, you have to write all the data to the array, not the actual object references.

              If the tree was like this:

              Click image for larger version Name:	Screenshot_3.jpg Views:	0 Size:	98.2 KB ID:	1865724
              Then you would save them like this:

              Click image for larger version Name:	Screenshot_2.jpg Views:	0 Size:	237.1 KB ID:	1865725
              Then, we you reload the level:

              Click image for larger version

Name:	Screenshot_4.jpg
Views:	20
Size:	187.4 KB
ID:	1865726
              Thank you sir,then I know what to do about it.

              Comment

              Working...
              X