View Full Version: Savesetting Question

DimensioneX Forum > Developers' Pub > Savesetting Question



Title: Savesetting Question


cotteux - January 18, 2008 04:17 PM (GMT)
I'm working user creation module, everything goiing fine except one thing.



that's working great for one setting like password or image

dim nome = $AGENT.name+"_pass"

SaveSetting nome,input("txtBox")

but for Username.Properties, is little more complicated. you have many variable and separate with /.

I have a some user properties, I just want to find a good way to save it.

ATTRLIST Health=10,Skill=1,type=0,Exidollars=60,time=0


If they have a variable for all properties or i need to manage manually.


Thanks



Cris - January 19, 2008 07:48 AM (GMT)
You are working on user creation! Two things about working on the .sav file (profiles db):

- The username must be "cooked" first that is, the letters need to be transformed into lowercase and spaces replaced with "_". Hence your code will work fine for user "cris" but will not work for user "Cris" or "cris lyons" because of capitals and spaces.

Be sure to use the cookname() function I posted here (see also source code of Underworld)


- You can save all the properties by doing

SaveSetting cookname(username) + "_properties", proprstring

where propstring is a string that you build by putting together all relevant properties of the user,comma separated.

To perfectly understand what you need to save exactly, here is the best way: delete the .sav file of one game (say, The beach) start a new game with it, save and inspect the .sav file that will contain only the settings fo the newly created user.

Now you need to re-create exactly all that settings for your player by using savesetting (player_name, player_location, player_panel, player_properties, ...)
Some trial and error wil lead you to making it.


I am planning to implement a more standard user creation system but the procedure you're using is perfectly OK and will work.

If you get stuck, just let me know and I will help you.




Hosted for free by InvisionFree