Save and loading save game, can someone tell me what did i wrong in this logic ?

I have one “Gate” actor in my level, it’s using as trigger like this :


If charracter touching to this actor, gameplay open my level :



My problem right here :

My DatacenterGameRef get reference from my DatacenterGame actor ( where i stock user name and user index, and other variables for save game )
But when gameplay start, nothing already created in DatacenterGame. So it’s none inside.
After gameplay running, as in my logic, i checking Does save game exit, i wanna get slot name and slot index in DatacenterGame to check, but has nithing in there so this’s first bug.
Then next after i check does save game exits or not, i have 2 choice :

  1. True : LoadGame function running
  2. False : Creating save game object then save game to slot
    All after that execution flow keep going and save game by SaveGame function :

    Then if player character touch to “Gate” actor as trigger, my game play open level as new level.
    Here’s second problem with me, level open always is basic level, variables i saved before didn’t showing up or it’s not got save and new level open always is basic ( mean DatacenterGameRef always none when new level open ).
    What should i changing here to save my variables to save game and load it after new level open ( by let character touch to trigger ) ?

Hey @Tamquocchi2021

where does your variable DatacenterGameRef come from? Because this looks like you just created a variable of type DataCenterGame and have no reference?

2 Likes

OMG, i was created 2 post by mistake ??
Thanks for help @L1z4rD89
i’m wondering what’s wrong in my logic here too.
At the first time gameplay running, i need check save game exist, and then logic going as a loop to open this blueprint again.
So the first time gameplay running, DatacenterGame has nothing inside. But the next time the loop happen and gameplay running this blueprint again DatacenterGame would have variable ( got saved in logic at first time running ).
That’s my idea, but i’m stucking and have no idea how should i change this blueprint.