Playmaker Forum

Playmaker Help & Tips => Playmaker Help => Topic started by: mmzbr on November 20, 2012, 09:13:27 AM

Title: Playmaker and Playerpref global variables save problem
Post by: mmzbr 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

(http://www.mmztech.com/mmz/logic.jpg)



Thanks in advance.
Title: Re: Playmaker and Playerpref global variables save problem
Post by: jeanfabre 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
Title: Re: Playmaker and Playerpref global variables save problem
Post by: mmzbr 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!