playMaker

Author Topic: [SOLVED] Entering a name for saves  (Read 3260 times)

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
[SOLVED] Entering a name for saves
« 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?
« Last Edit: July 03, 2012, 10:30:20 PM by Alex Chouls »

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Entering a name for saves
« Reply #1 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.

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: Entering a name for saves
« Reply #2 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

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Entering a name for saves
« Reply #3 on: July 03, 2012, 04:55:22 PM »
Just edit the subject to include the [SOLVED] declaration.

Good luck!

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: [SOLVED] Entering a name for saves
« Reply #4 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] Entering a name for saves
« Reply #5 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

in particular the jump game. It stores the high score using the player prefs:
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

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: [SOLVED] Entering a name for saves
« Reply #6 on: July 15, 2012, 11:52:09 AM »
Thanks Jean managed to get it working :)