mob/var/saved = 0
mob/var/description
mob/var/person
mob/verb/save()
var/savefile/F = new()
F["saved2"] << saved
F["gold"] << gold
F["Stat"] << Stat
usr.client.Export(F)
client/New()
..()
var/savefile/client_file = new(Import())
if(client_file)
// client_file["usr"] >> mob //use this if you want to save ALL of the users vars
client_file["saved2"] >> mob.saved
client_file["gold"] >> mob.gold
client_file["Stat"] >> mob.Stat
return ..()
How do i make it to work so i can save Level, hp, attack, defence, exp, gold, deaths, fight.??</<></<></<>
ID:262000
May 17 2004, 10:47 am
|
|
In response to XzDoG
|
|
where?
|
<-DM->
What ever code <-DM-> Without the -, it makes it easier to read then a bunch of text. its best to use this whenever posting code in the forum. |
In response to XzDoG
|
|
Anyways back on topic..
client/verb/Save() You can do something like that, you dont need to save each var individualy. |
In response to XzDoG
|
|
but.. when i try to log back in most of it works but then when you log in i can't see my icon
|
In response to Revenge-X
|
|
are you sure you have it setting an icon for when you login?
|
In response to XzDoG
|
|
world Yea its alot but i really don;t know what you mean maby this will help u andswer me :] |
In response to Revenge-X
|
|
Try something like this
if("Green Link") Then when they continue their char set it up like usr.icon=iconloaded usr.iconstateloaded=icon_state anyways you get the idea. |
In response to XzDoG
|
|
i'm not following where do i put what ure talkin about? :P sorry i suck at coding this is my game in a while
|
In response to Revenge-X
|
|
This goes when you choose your character just replace color of the link with what ever your character color is for each one.
usr.icon='Character.dmi Then go to the part of your code where you continue your old character and it loads everything thats where you put usr.icon=iconloaded So that way.. they have their icon when they login, theres other ways to do this but this is easier to explain i think. |
In response to XzDoG
|
|
when i put it in
switch(input("Choose Your Tunic","[world.name]")in list("Green Link","Blue Link","Red Link","Pink/Purple Link")) Login Code.dm:28:error: usr: expected end of statement comes up then it gets all messed o.o oh yea it highlights usr.icon='Character.dmi' usr.icon_state="Green Link" also if("Continue with old character") I think that is right correct me if i am wronge :] |
In response to Revenge-X
|
|
usr.icon='Character.dmi' usr.icon_state="Green Link"
make sure you hit enter because there on the same line.. |
In response to XzDoG
|
|
oh i c
what about if("Continue with old character") Did i put eveything right?? Maby just edit it a little and send it ;] and i think this is all but if anotehr error comes i think ill need some more help. |
In response to Revenge-X
|
|
Well what is the error
|
In response to XzDoG
|
|
Login Code.dm:53:error:char_ckey:undefined var
Login Code.dm:53:error:client/proc/LoadMob:undefined var Login Code.dm:56:error:ckey:undefined var Login Code.dm:56:error:char_ckey:undefined var Login Code.dm:57:error:iconloaded:undefined var Login Code.dm:58:error:usr.iconstateloaded:undefined var Login Code.dm:54:error:src.ckey:undefined var Login Code.dm:55:error:src.ckey:undefined var Login Code.dm:56:error:src.mob:undefined var that i don't get it |
Please Post your code in DM Tags, Thanks.