Thread: Save Tool
View Single Post
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 02-11-2012, 04:23 PM

Quote:
Originally Posted by Dj Tech42 View Post
Can you use the author string to make profiles? (separate variables for every user playing the game)
I would prefer you didn't.

The author variable is your (the creators) name/nickname, the game title is the title of the game.
Any other way and saves could get mixed up.

If you want to create game profiles for different users then you can. When you use the save_var method you get a name parameter. This can have any value, it doesn't have to relate to the var parameter at all, but for the sake of keeping it simple I suggest you do make it relate somehow.

Because it can have any value, you can request a username from the user or work out some other way of identifying each user and getting a unique string out of it for their profile. You can then simply join the username and the string you would have set the name parameter to. I suggest joining them with a "." in the middle.

eg. If I entered my username as "Arty-fishL" and the name being used to identify the variable being saved was "score" then the value to use as the name parameter for the save_var method would be:
"Arty-fishL.score"
Or if my username was "Dj Tech" it would be:
"Dj Tech.score"

Does that make sense?
Take a look at my attached example that uses the eg
Enter a username
Press green to increase your score
Red to reset it
Restart the world and enter the same name, your score will load
Try it with different names
Attached Files
File Type: a2w SaveTool User Profiles Example.a2w (481.3 KB, 7 views)


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]

Last edited by arty-fishL; 02-11-2012 at 04:29 PM.
   
Reply With Quote