Announcement

Collapse
No announcement yet.

[PLUGIN] Savior 2

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

    "Soft" references are Structs with a String inside.
    They are "value variables". Can be saved in any way, inside Structs, in Arrays, etc.

    "Class Reference" or "Object Reference" is a pointer to an object.
    The plugin only restore those pointers if the referenced object exists by the time of loading the game from file.
    "Auto Respawn" options in Plugin Settings will auto spawn any instance of a class if the lost pointer to the instance is from a class you have white-listed there and then it will restore the reference variables pointing to that instance of your object. It can do this for variables of references within any class (variables marked Save Game), within Sets, within Arrays, within Maps, within Objects.

    However you should only white-list for auto-respawn, in plugin settings panel in Unreal Editor, classes that you create as direct children of the UObject class or children of UAutoInstanced class.
    Why? Because people previously were adding there to the auto respawn list internal engine classes and then complaining about game crashing when the plugin spawns a instance of something it shouldn't spawn.

    Maps expect to be a TMap< FName , YourObjectReference > or TMap< YourObjectReference , anything >, if the Map key type isn't either an Object Reference or a FName the plugin will complain in your logs saying it doesn't know what you're trying to do...

    Those TMaps< YourObjectReference >, TArray< YourObjectReference >, TSet< YourObjectReference > and plain YourObjectReferencevariables work just fine when the variable is stored inside your Blueprints.
    IF they are stored inside a Struct (then the Struct used in the Blueprints) however, you should see an error log telling you why the plugin won't save those references for you. Epic have set in deep engine code an intentional crash if the plugin goes there to save references that aren't inside a UClass, so the plugin will give up on references (not Soft ones) that are member of a Struct to avoid crashing your game, it can see the references, it just skips them :]

    All other normal types like Int, Float, String, etc, they are common "value types" so they are pretty much universal, the plugin can see and restore their values in Structs or Objects, anywhere.
    | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      I have a problem, When I Save a Transform Value , Savior2 can save json into it, but load failed , I debug this UnpackRecord_Object method ,
      const bool IsStruct = Property->IsA(UStructProperty::StaticClass()) is return false , But FTransform is Struct , Should be True is right . I am not understand

      Comment


        Originally posted by chuanshao View Post
        I have a problem, When I Save a Transform Value , Savior2 can save json into it, but load failed , I debug this UnpackRecord_Object method ,
        const bool IsStruct = Property->IsA(UStructProperty::StaticClass()) is return false , But FTransform is Struct , Should be True is right . I am not understand
        A FTransform is stored differently depending on the platform you're building to. EpicGames engineer explained to me why it shouldn't be used on save systems (it was preventing multi-platform packaging) due to compression issues...
        So I removed all support for FTransform struct, there's is no unpacking method for FTransform in plugin code.
        | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          Can you have a temporary save without it writing to a file? For instance I want to save the progress of a player while they are loading levels but only want to actually save the game to a file when they save at a check point

          Comment


            Originally posted by falola View Post
            Can you have a temporary save without it writing to a file? For instance I want to save the progress of a player while they are loading levels but only want to actually save the game to a file when they save at a check point
            Yes. You can create a new Slot instance in your Game Instance and use "Save Object", "Save Component", "Save Actor", and "Save Actor Hierarchy" nodes.

            All those nodes mentioned above only write data to the Slot object instance, but they do not write to files, until you call manually "Write To File" node.
            "Save Game Mode", "Save Game Instance", and "Save Game World" automatically calls the "Write To File" function.
            I particularly never use those that automatically write save files, I use Slot objects as runtime storage for a lot of things...
            | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

            Comment


              New deserializer method for you, in v2.8.3 for Unreal 4.22+.
              Load an actor from slot by its "SGUID" property instead of searching for nameID:





              Useful for actors you spawn frequently and actor's nameID keeps changing ( Character_C_1, Character_C_2, Character_C_14, etc... )

              You can find more info about the "SGUID" property here:
              https://forums.unrealengine.com/unre...94#post1467094


              Keep in mid that YOU are responsible for the validity of the SGUID property to use this.
              You will have to keep a valid Guid struct for your actor of interest and making sure that nothing in your game code ever compromise the constant value of that Guid.
              | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

              Comment

              Working...
              X