How do I Save a name

Get help using Construct 2

Post » Tue Aug 25, 2015 4:54 pm

Hi, what I want to do is, at the main menu a person can enter his/her name. That name would be saved and then when he/she restarts the game they can select there name from a list of names. This game would be for more than one person using the same iPad etc.
For instance: James starts a game and enters his name, he plays the game then exits the game.
Sally starts the game and enters her name, she plays the game the exits the game.
When James starts the game again he can pick his name from the list of names before he starts playing again.
I seen another member with a the same or similar problem but I still can't get this to work.
Thanks!
B
4
Posts: 15
Reputation: 230

Post » Tue Aug 25, 2015 5:07 pm

Hello,

that's not difficult. Just save the name in a global variable and then the global variable in the LocalStorage.
Then you just need to load the name from the storage 'On the Start of Layout'.

You can download an example here: https://www.dropbox.com/s/27pmilbxab1fkhs/save_name.capx?dl=0

Regards
Andreas
Image Image iTunes: Match3 | Google Play: Match3
B
95
S
33
G
30
Posts: 1,099
Reputation: 27,670

Post » Wed Aug 26, 2015 1:34 pm

Not really what I am looking for.
I want the player to be able to enter his/her name and it would be saved so the next time the player starts the game he/she can just select there name from the list of names. I know it really isn't that much more effort to enter the players name but I just thought it would be a cool feature for the player to always have there name be there when they start the game and then just select it from a list.
No big deal.
Thanks for your help!!
B
4
Posts: 15
Reputation: 230

Post » Wed Aug 26, 2015 2:18 pm

SaveNames.capx
something like this?
Image
B
64
S
23
G
7
Posts: 1,481
Reputation: 10,823


Return to How do I....?

Who is online

Users browsing this forum: Ryan Kocourek and 10 guests