playMaker

Author Topic: Playmaker and Easy Save query  (Read 1926 times)

zerolimitau

  • Playmaker Newbie
  • *
  • Posts: 3
Playmaker and Easy Save query
« on: May 05, 2017, 11:27:38 PM »
Hey guys!

I've been playing around with Playmaker for some months now and I am absolutely loving every bit. I've purchased Easy Save but I am having some incontinent results and I've tried everything I can think of.

For now I have 3 scenes
Main menu, player hub and the first level.

I have only a few variables for now and I have been attempted saving with Save All and also have tried saving each variable individually but both end up with the same issue.

playerName - String
coinCount - Int
levelOneStage - Int  (I was playing around with a way so the level can be tracked. 0 = locked, 1 = unlocked and 2 = complete.)

My 2 issues.
1) When loading the main menu is does an Exist check, if data exist the 'continue game' button appears in the menu (this seems to work great). Upon Loading Level Num, it loads the correct scene but none of the data seems to carry across.
(When I start a new game, this info carries over fine initially.)

I've got the next scene to check for data and load the variables but this doesn't seem to happen after I have started a new game.

2) After playing the first level and completing it, you return to the player hub and again, none of the information appears to have been updated (still the previously loaded info).


I'm starting to think maybe its my lack of understanding for changing scenes.

If I was in Scene1 and changed to Scene2 with Load Level Num, would Scene1 still be loaded or cached in some way?

It kinda feels like it is, and say if I was to go back to Scene1, it's not running through the 'start'  transitions, therefore not running through the load states and not updating the info.  Could this be it?


Also regarding Easy Save. Which is the best method of saving. As a file, resource, memory or playerpref.
« Last Edit: May 05, 2017, 11:35:28 PM by zerolimitau »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Playmaker and Easy Save query
« Reply #1 on: May 06, 2017, 01:15:47 AM »
Hi,
After 'Exist' check, if they do not exist are you saving them?
Are you saving, before loading the next level?

On load level num you might have checked additive, this should be unchecked if you are using complete scenes per level.

You can test if things are loading/saving by adding breakpoint (right click on state and select 'Toggle Breakpoint' to states that are saving/loading.
This will pause the game when it hits a breakpoint and show the state with a breakpoint (very useful for debugging) then you know for sure that the state is used.

Also in the state window at the bottom you can check debug so you can see the action values.

If you can't get it to work can you make a video or some images showing the states/actions/data.

zerolimitau

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Playmaker and Easy Save query
« Reply #2 on: May 07, 2017, 01:30:49 AM »
Hey Djaydino!

thanks for the advice on Breakpoints! This has actually helped me solve a few issues I had with saving/ loading. Everything seems to be working fine now apart from one single bug that seems to be persistent through everything I've tried.

Basically the string variable 'playerName' which is used in a ugui text field. But if I was to change to another scene, then back again, then playerName is empty.

To add.. if I was to close the game down completely and re run the exact same steps, the playerName loads fine on first run, but again, if I change to another scene and then back to this scene, everything loads but the playerName variable is empty.

I'll record a short video tonight when I get off work.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Playmaker and Easy Save query
« Reply #3 on: May 07, 2017, 03:10:48 PM »
Hi.
No problem.
I will wait for the video.

jaspersnow1

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Playmaker and Easy Save query
« Reply #4 on: May 07, 2017, 10:08:37 PM »
i used same type of variables and they works fine. just use load all if exists in every scene so that data would be loaded in the scene.After completion of level use save all to save all variables. this has to be done every time for local variables

zerolimitau

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Playmaker and Easy Save query
« Reply #5 on: May 08, 2017, 11:49:19 AM »
I've tried saving/ loading both each individual variable and all variables, both times running into this. I've even tried without saving the name after the initial save when starting a new game and it still happens.

I've uploaded a video of the issue. Any help would be greatly appreciated.

https://youtu.be/hX1yeDtbkXw

I'm getting to the point where I might just have a static game object that is persistent through all scenes with the variables attached.