playMaker

Author Topic: How to Save  (Read 1020 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
How to Save
« on: July 27, 2021, 11:14:52 PM »
Hello,

I have the free asset, smooth save. I would need to remember player location and number of collectibles I have received. I think I tried reaching out to him by email, but I don't think he takes emails (only from people who bought the asset when it was previously paid he responds to, I think). If anyone is familiar with how to use this asset some guidance would be great. Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: How to Save
« Reply #1 on: July 27, 2021, 11:28:04 PM »
One thing I want to specify is that I would need to be able to save these values while switching scenes (go to one scene and then back to the position where I switched scenes or gain a collectible then go back to the first scene with the game remembering) for example. Hope this makes sense. Thanks again!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to Save
« Reply #2 on: July 30, 2021, 08:28:08 AM »
Hi.
If you want to save during the game session (so not saving when player quits game)

Then you should make a object which you can store in a global variable to access it.
Make a fsm (call it Data for example)
on start use 'Singleton' (Ecosystem) and give it some name.
This will make sure that there will be only 1 object of this and if you load a certain scene again it will automatically remove the one on the scene.

Also use a Don't Destroy On Load to make sure it does not get destroyed when loading other scenes

Now add variable you need and you can access them with the get/set fsm actions

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: How to Save
« Reply #3 on: July 30, 2021, 08:16:07 PM »
I think I figured it out. Thanks for your help!