playMaker

Author Topic: How can I save current progress with Easy Save 2?  (Read 2985 times)

ludens

  • Playmaker Newbie
  • *
  • Posts: 7
How can I save current progress with Easy Save 2?
« on: November 29, 2017, 01:13:43 PM »
Hello.
Now I make Megaman like 2d platform game. I want to make save system which save whole current progress at the SavePoint. (When player reach at save point, player can save whole current progress containing not only variables but also game objects and prefabs. Then player can load and resume game at saved point.) 

I've bought Easy Save to make that system. But I still haven't done it. Because I don't know how to do it though I've searched tips and tutorials on here and other sites. They said about saving High Score it was nice and easy to understand. Sadly however, that knowledge about saving score is not enough for me.
I tried to save current progress by using 'Save All' action. But save file which was made by that action contained only datas about variables of the action's fsm. It does not contain datas what I need (objects in Hierarchy, prefabs etc.)     

Please tell me how to make it with Easy Save 2.  I hope that you can help me make wonderful game. Thanks for reading it. Have a nice day :)
« Last Edit: November 29, 2017, 01:28:17 PM by ludens »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How can I save current progress with Easy Save 2?
« Reply #1 on: November 29, 2017, 02:23:20 PM »
When you build and play your game, it basically acts like you're in play mode - once you exit, everything is reverted back to original settings and values. So, you need to save all you need when you hit that save point: player location, health, score, number of coins picked up, whatever. Depending on your setup, there are few more things to consider. Let's say you're spawning coins and enemies using a spawner, when you load your game, all the killed enemies and coins will appear again. So, you need to disable the spawner when it does its job (one way of doing it) and save its state when you save the game so it doesn't spawn stuff again when you reload the game etc.

Also check this out if you haven't already, you'll find it useful: http://docs.moodkie.com/easy-save-2/guides/auto-save/
Available for Playmaker work

ludens

  • Playmaker Newbie
  • *
  • Posts: 7
Re: How can I save current progress with Easy Save 2?
« Reply #2 on: November 30, 2017, 04:21:41 AM »
Thanks for you reply. Then how can I save state of objects like spawner (whether they are enable or disable)?

When you build and play your game, it basically acts like you're in play mode - once you exit, everything is reverted back to original settings and values. So, you need to save all you need when you hit that save point: player location, health, score, number of coins picked up, whatever. Depending on your setup, there are few more things to consider. Let's say you're spawning coins and enemies using a spawner, when you load your game, all the killed enemies and coins will appear again. So, you need to disable the spawner when it does its job (one way of doing it) and save its state when you save the game so it doesn't spawn stuff again when you reload the game etc.

Also check this out if you haven't already, you'll find it useful: http://docs.moodkie.com/easy-save-2/guides/auto-save/


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How can I save current progress with Easy Save 2?
« Reply #3 on: November 30, 2017, 04:15:16 PM »
Hi,
You could have some bool variables that you could set to true or false when these spawners are enabled or disabled.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How can I save current progress with Easy Save 2?
« Reply #4 on: November 30, 2017, 05:45:39 PM »
You can do it in a few ways actually, again, all depending on your setup. If you have spawners that are not enabled at the start of the level, but activated as you progress, you can get property/enabled and store it as a bool which you can compare on load and do what you need (enable it/disable it).

If all the enemies are spawned at atart, you can simply make a sort of a local counter variable in each spawner. Spawner checks the "counter" int variable, if it's zero, it spawns an enemy and adds 1 to counter variable. When you savw the game, you save the counter variable too. On load, fsm checks the counter variable, sees that it is 1, and spawns nothing amymore.
« Last Edit: November 30, 2017, 05:48:35 PM by krmko »
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How can I save current progress with Easy Save 2?
« Reply #5 on: November 30, 2017, 08:25:53 PM »
Hi,
Always try to avoid using get/set properties they are mend to use on 3rd party components when there are no actions available.

When you disable the spawner also set a bool variable (or in an array if you have many) this is 'cheap' to do

get/set properties tend to break if you don't use linker wizard in a build
Also they are slower than setting a bool variable.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How can I save current progress with Easy Save 2?
« Reply #6 on: December 01, 2017, 03:39:48 AM »
Well he shouldn't refer directly to them but use an object reference, that way they won't break i guess. But yeah, bool variable is faster.
« Last Edit: December 01, 2017, 03:45:43 AM by krmko »
Available for Playmaker work