saving stats/inventory in Multiplayer Game

bds1313
10 Jan 2006, 18:50
Does anyone have an example or a clear explanation of how to save players stats and inventory using Questnet? I've looked through the forums and can't really find a good explanation of how to accomplish this.

If I can't get this to work, my multiplayer game is pretty useless. Any help would be greatly appreciated it.

Thanks
BDS1313

paul_one
10 Jan 2006, 19:30
In questnet, goto file->save

bds1313
10 Jan 2006, 20:04
I know how to save settings on the server. What I need to know is how to save an individual players stats and inventory. So if someone logs off and then back on, they'll have exactly what they left with (both items and stats)

bds1313
10 Jan 2006, 21:30
OK, I solved half of my problem. I am now able to save items per user name and have them come back at login.

The problem I'm having now is that when I log back on and my items are returned to me, the associated stat properties are not showing up.

(e.g. I have a sword that gives me +2 STR and +2 CON. Works fine when I recieve the item, I log off, log back on, still have the sword in my inventory, but my stats for STR and CON are back to 0)

Hopefully someone has an answer for this. Again, any help is appreciated.

paul_one
11 Jan 2006, 00:38
Depends how you have the variables set up.

If you have the variables reset whenever the player logs in - you'll have to save them externally somehow and then re-load them.

You should try using array'd stats variables that uses a number against a username or something.
Or making the variables in some other way.


bds1313
11 Jan 2006, 14:19
OK ... I'm a complete noob. Can anyone give me an example of using an array for stats (e.g. hit points, strength)? Or the "proper" way of using a variable for stats. I can stop the stats from resetting for each user when they log off and log back in.

Oh .. and thanks for the link to the other topic. I actually found that mid day yesterday and that's how I corrected my script.

paul_one
12 Jan 2006, 14:47
An array in Quest is where you start making variables with this type of name:
variable[0]
variable[1]
variable[2]

Note each variable has the same name, but inside the []'s it has an index.

So, for a certani player you can use strength[index].
Although you'll need to find a way to use the same index over and over again for that certain player.