ID:146746
 
I'm wanting to make a save Proc and Load proc on Login() where it auto saves on Logout() and then when the player saves it only saves cirtain things. not the src.

like this Lets say i'm not wanting it to save cirtain things like overlays and that cirtain things.

like
client
proc
Load()
var/savefile/load
load = new ("saves/[src.mob.ckey].sav")
load["Icon"] >> src.icon
load["Name"] >> src.name
load["Status"] >> src.status
load["Contents"] >> src.contents
load["Magic"] >> src.Magic
//etc...
Save()
var/savefile/save
save = new ("saves/[src.mob.ckey].sav")
save["Icon"] << src.icon
save["Name"] << src.name
save["Status"] << src.status
save["Contents"] << src.contents
save["Magic"] << src.Magic
//etc...

but every time i try something like that, it never saves. i would have to do a " load["mob"] >> src.mob " In it or something like that. but when i do that, it saves the overlays. please can some1 help.

Are you trying to empty the overlays before they save?

If you are you can do something like:

src.overlays = list()
In response to N1ghtW1ng
N1ghtW1ng wrote:
Are you trying to empty the overlays before they save?

If you are you can do something like:

src.overlays = list()


no. i have allways had the problem of the overlays saving with them when they exit the game or their icon state not changing back to normal when they relogin.

like lets say the person is doing a magic spell and there is a overlay animation over the main character like lets say they are doign a heal and there is a like glitter animation that shows the spell was sucessfull. If they logged out with the overlay, the animation would still be on them when they relogged in.

thats what i'm wanting to try like prevent. so i'm wanting to limit the saved options so it wouldn't save everything.
In response to ElderKain
I actually just had a problem like that, what you need to do is make a second list that adds the overlays that you want the character to have when they log in, and then when they login do the overlays = list() and then for(var/o in otheroverlaylist) src.overlays += o. That should help.
In response to N1ghtW1ng
N1ghtW1ng wrote:
I actually just had a problem like that, what you need to do is make a second list that adds the overlays that you want the character to have when they log in, and then when they login do the overlays = list() and then for(var/o in otheroverlaylist) src.overlays += o. That should help.

I don't know how to code a list like that
In response to ElderKain
Something that I found might help is using a proc. Make a proc that removes all of your overlays at logout so you arent bugged. That has happened to me a few days back as well. Something like this should work:
world
New()
..()
Del()
No_Overlay()
proc
No_Overlay()
for(var/mob/player/M in world)
game=0
M.overlays -= /obj/overlay
//Making a list like this to delete all of their overlays.


However, you must change your overlays to obj if they aren't already. You can also add to your overlays something that looks like
obj/overlay
name
icon='icon.dmi'
icon_state="your momma"
heyall
icon='icon.dmi'
icon_state="your momma"


and add the attributes. This will take it off all ot once. This is very sloppy and there is a better more efficient way, but I am unaware. Besides, this works fine for me, I only have one overlay and do not plan to get more.
In response to CaptDarkDragon
CaptDarkDragon wrote:
Something that I found might help is using a proc. Make a proc that removes all of your overlays at logout so you arent bugged. That has happened to me a few days back as well. Something like this should work:
> world
> New()
> ..()
> Del()
> No_Overlay()
> proc
> No_Overlay()
> for(var/mob/player/M in world)
> game=0
> M.overlays -= /obj/overlay
> //Making a list like this to delete all of their overlays.
>

However, you must change your overlays to obj if they aren't already. You can also add to your overlays something that looks like
> obj/overlay
> name
> icon='icon.dmi'
> icon_state="your momma"
> heyall
> icon='icon.dmi'
> icon_state="your momma"
>
>

and add the attributes. This will take it off all ot once. This is very sloppy and there is a better more efficient way, but I am unaware. Besides, this works fine for me, I only have one overlay and do not plan to get more.



Lol, thx for the help. It is very helpfull
In response to ElderKain
Actually as I said, to delete all overlays you could simply do : src.overlays = list()
In response to N1ghtW1ng
N1ghtW1ng wrote:
Actually as I said, to delete all overlays you could simply do : src.overlays = list()

yea but CaptDarkDragon actualy explained a way that helped and it works. HE explained it in a code form which was easier to understand whime u just said a lil thing and never said a way how to implement that in a code.
In response to ElderKain
Oh, I thought it was easy to follow =P, sorry.