Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MrMitch on July 02, 2012, 05:13:45 PM

Title: [SOLVED] Entering a name for saves
Post by: MrMitch on July 02, 2012, 05:13:45 PM
I can't seem to find anything that allows me to enter some text to save along side a time.

I've searched through the actions and couldn't figure out how to do it.

Any advice?
Title: Re: Entering a name for saves
Post by: artician on July 03, 2012, 09:28:36 AM
Not sure what you mean, but if you're saving the game then you're most likely using PlayerPrefs, right?

If so, then you can call up a GUILayout TextField and have the player enter a string in that, then use the string to preface whatever playerPref keys you end up storing for the savegame.
Title: Re: Entering a name for saves
Post by: MrMitch on July 03, 2012, 02:04:15 PM
Thanks, i've no idea how i missed that :S

Feels almost pointless starting this thread, if someone with the power feels it shouldn't exist feel free to remove it :P
Title: Re: Entering a name for saves
Post by: artician on July 03, 2012, 04:55:22 PM
Just edit the subject to include the [SOLVED] declaration.

Good luck!
Title: Re: [SOLVED] Entering a name for saves
Post by: MrMitch on July 05, 2012, 06:16:01 PM
Rather than create a whole new thread i thought i would just put this question here.

Using Text Field how do i store the text entered by the player in a string variable?
Title: Re: [SOLVED] Entering a name for saves
Post by: jeanfabre on July 06, 2012, 03:05:03 AM
Hi,

 you will need to use the playerPrefsSetString. you choose a "key" to reference that string when you will want to get it back using PLayerPrefsGEtInt.

 There is a working example ( storing ints, but this is the same principle), in the M2H game sample ported to playmaker.

https://hutonggames.fogbugz.com/default.asp?W880 (https://hutonggames.fogbugz.com/default.asp?W880)

in particular the jump game. It stores the high score using the player prefs:
https://hutonggames.fogbugz.com/default.asp?W895 (https://hutonggames.fogbugz.com/default.asp?W895)

So download and study this game and that particular features.

 There is also playerprefs implement using string in the Photon beta demo, where the user can save his username, and I store and retrieve it in between sessions. So you can check that out as well if you want to go further.

Bye,

 Jean
Title: Re: [SOLVED] Entering a name for saves
Post by: MrMitch on July 15, 2012, 11:52:09 AM
Thanks Jean managed to get it working :)