Announcement

Collapse
No announcement yet.

Saving/reading data, preferable not .sav

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

    Saving/reading data, preferable not .sav

    Hello everyone!

    I'd like to manually create some tile based maps in the editor. But when I'm done I'd like to save these as arrays and with some other data. So I can generate the maps later using only 1 level and a BP.
    My question is now how I would I do this?
    I already tried to create a data only BP for every map I would save. But I can't change their default values so they aren't persistant. Unless I'm missing something?
    I also tried with a data table, but I can't change the data table. Only read from it.
    If I can't find anything I can always you .sav files but I'd rather just use these for actual progression save files and not game data that won't change after release.

    Anyone got an effective way to do this?

    Thanks!
    Project Shinrin | Portfolio

    #2
    Could you not have on persistent main level and have the others as streaming levels, that you load when needed?
    A blueprint actor could work either, what do you mean you couldn't save their default values, it was a blueprint actor? Do you mean that you were placing blueprints in your map, changing its variables and then had no way to save those as the defaults?

    Comment


      #3
      Yes, I created a BP actor called BattleMap_Test1, a child of BattleMap_Parent. The BP has some arrays and variables. But I don't know how I can change those values of the class, not an instance of the class. Is it possible to change those default values ?
      I'll go a bit more specific: I created a BP called MapSaver. It has an event which I exposed to the editor in the details panel. So I can select from a dropdown menu in the details panel which map I like to modify and then run the event so that it is supposed to save those arrays and data in the chosen BP.

      I could use streaming levels I guess but I think I can do it simpler.
      Thanks for your reply.
      Project Shinrin | Portfolio

      Comment


        #4
        Well, if you made them as seperate blueprints you should be able to set different defaults for each one. In your child blueprint, in the My BLueprint tab, click the eye icon beside the search box and check "Show inherited variables".

        Depending on the type of data you want to save, you could use config files ( .ini) in theory, Rama has a blueprint node for saving/loading to config files, though that probably isn't ideal. He also had a tutorial for saving any generic data to binary files, but that requires C++.

        Comment


          #5
          Thanks again for replying. Yes I can change them manually. But not through a BP right? Because I'm not going to copy/paste the coordinates of every tile
          And yes I checked the binary tutorial but that is beyond my skill level.
          Project Shinrin | Portfolio

          Comment


            #6
            Ok, maybe other question: If I somehow manage to save this data to say, a text file. Will packaging the game include this file in de .pak files so that people can't access it?
            Project Shinrin | Portfolio

            Comment


              #7
              Ah, I see. So what are you saving, large arrays of vectors? If you have set up your level in the level editor, you could make a blueprint that will print out their locations in the correct format for you to copy and paste as a variable in your blueprint.

              For example, if you made an empty Vector array blueprint and copied this below:

              ((X=2.000000,Y=1.000000,Z=6.000000),(X=3.000000,Y=2.000000,Z=754.000000))

              Then right-clicked the default value and pasted it, it would have those two points in the array, so you could do that the same by generating the text and pasting it.

              So say I have a map file, and I make a layout by positing these 135 individual cube blueprint actors.

              Click image for larger version

Name:	QGiPCKy.png
Views:	1
Size:	371.6 KB
ID:	1102717


              I want to regenerate them without saving a seperate map, so I make a blueprint that will record their positions something like below:
              Click image for larger version

Name:	w4kYXX1.png
Views:	1
Size:	338.7 KB
ID:	1102716

              Place this blueprint in your level with the cubes, run it, close it, go to the output log and carefully copy the print string from the output.
              Then in your BattleMap blueprint, you can make a new array of vectors, right click it, paste, and you will find that you have 135 points in the array.

              Click image for larger version

Name:	jxeIKOV.png
Views:	1
Size:	63.2 KB
ID:	1102718


              it's a weird way of doing it, but maybe something like that could work for you? Again, it depends on what you are trying to save really.

              Comment


                #8
                Awesome! Thanks for the in-depth reply. Someone also suggested doing something similar.
                But that is exactly what I need!
                It is indeed a strange way of working though But I guess it's ok if it gives me the results I desire.
                Project Shinrin | Portfolio

                Comment

                Working...
                X