I made a really basic RPG set up and I'm trying to see how to get Makinom to save my Player Object Variables such as Health and Speed.
I have 4 save slot files and when I go to Save Game Menu in the Menu tab and make sure that save object variables is checked. I press play, lose some health/speed and save to slot 1, then I go back to the Main Menu and load the saved game 1 and the variables are reset, as in the players Health is returned to full and the speed is returned to original speed as if it was a new game but spawned at the save point. I just want my player stats to be saved for each file saved because not all save points will have the option to give the player full health.

Any help would be greatly appreciated.
Thanks,
=]
Awesome Website - Portfolio
Support me on Patreon - Support site
  • If your object variable components are set up as Local Variables instead of using an Object ID, they'll not be saved in save games.
    If you're enjoying my products, free updates and support, please consider supporting me on patreon.com!
  • edited March 10
    That makes sense, but if the Player prefab is set with an object ID wouldn't it share the variables with spawned Player prefabs in a new game or loaded game?

    How would I be able to change the Player Prefab Object ID in a running game?
    Would I have to make conditional Player prefabs with separate IDs to check if Save Game(s) Exist?

    ***Edit, I fixed the issue the Player variable kept resetting because I had some Global variables that the player object variables would reference to and reset to new game stats.

    Thanks!
    =]
    Post edited by relenting_1 on
    Awesome Website - Portfolio
    Support me on Patreon - Support site
  • edited March 11
    OK I got the Object Variables to save but now I'm running into a Player Name conflict where one game will save the name of the player then when I make a new game and save it it changes both names in the save files to the last saved game player name.

    See video for what I mean.
    Video
    Post edited by relenting_1 on
    Awesome Website - Portfolio
    Support me on Patreon - Support site
  • Can you send me a test Unity project?
    If you're enjoying my products, free updates and support, please consider supporting me on patreon.com!
  • edited March 13
    I will send a test project on my lunch break in about 4 hours.

    **Edit: file has been sent
    Post edited by relenting_1 on
    Awesome Website - Portfolio
    Support me on Patreon - Support site
  • edited March 13
    I may have figured it out the cause of the problem but not a solution yet.
    The variables in the Save Game Menu File Settings are taking on the Global Variable String playerName. Since the name changes with each character made it saves the save game file name to which ever the last player name whom saved a game last.

    In Save Game Menu>File Settings>File Info the text code for Player Name is not working for me?

    Also the Set Game Time Node is causing weird issues when clicked on in the Schematic Editor Window.
    Post edited by relenting_1 on
    Awesome Website - Portfolio
    Support me on Patreon - Support site
  • Yep, text codes like the variable text code are currently saved directly into the file info of the save game, instead of saving the value they represent. Will be fixed in the next update (also the Set Game Time node displaying weirdly).
    If you're enjoying my products, free updates and support, please consider supporting me on patreon.com!
  • Awesome thank you so much GIL!!!
    Just a quick question about this update, would saving a game make it save all game variables at the time, like a snapshot of current variable data?
    If so that would be so totally cool for the save game settings!
    Awesome Website - Portfolio
    Support me on Patreon - Support site
  • All variables are already saved in the save game (unless set up otherwise in the save game settings).
    The issue currently is only that the save game info text that is saved alongside the save game is containing the text codes, not the info/value they represent - and since displaying the info text doesn't load any data from the save game, they're replaced by the wrong values.
    If you're enjoying my products, free updates and support, please consider supporting me on patreon.com!
  • Ok I got it now thank you very much GIL!!! =]
    Awesome Website - Portfolio
    Support me on Patreon - Support site
Sign In or Register to comment.