playMaker

Author Topic: Playmaker and Playerpref global variables save problem  (Read 3492 times)

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Playmaker and Playerpref global variables save problem
« on: November 20, 2012, 09:13:27 AM »
I´m new in Playmaker and working fine with it, but now when I reach the point about save my game elements the problems started.

I´m using playerprefs variables and keys to store data but its not working properly. The problem is, when I use thePPlayerpref set String on a variable all the others set the same value, not independent. I need to save multiple variables with multiple keys, I´ve creating a variable for each action and I need to save it, but for some reason when I save one, all variables are affected and change their value without request.

Could someone please send me an example of a FSM to save 2 different variables and 2 different keys? Or explain whats I´m doing wrong?

PS: Sorry my english, is not my primary language.

Here an example of logic I done for it. I have a torch, when player get it (by touching) the variable i_torch is saved. But when I restart the game all items receive the value of torch.

Project Details:
Unity 4.0
Playmaker 1.4.3
Build for Android





Thanks in advance.
« Last Edit: November 20, 2012, 09:16:46 AM by mmzbr »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Playmaker and Playerpref global variables save problem
« Reply #1 on: November 20, 2012, 11:42:34 PM »
Hi,

 Ok, I have created a small working sample, storing mouse down counts and the time of the last count in two separate playerprefs.

 Study this, this should help you understand where you are going wrong on your set.

bye,

 Jean

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Playmaker and Playerpref global variables save problem
« Reply #2 on: November 21, 2012, 05:55:42 AM »
Hi,

 Ok, I have created a small working sample, storing mouse down counts and the time of the last count in two separate playerprefs.

 Study this, this should help you understand where you are going wrong on your set.

bye,

 Jean

Thank you very much Jean!