ID:165384
 
mob/proc
save_deck(slotnum)
if(length(src.deck) <=40)
src<<"<b><font color = white>Sorry Cant Save a deck with 40 cards or less."
else
var/savefile/F=new("saves/[src.key]/Decks/slot[slotnum].sav")
src.CurrentDeck = src.deck
F["deck"]<<src.CurrentDeck
F["name"]<<name
src<<"<b><font color='white'>Cards and Deck Saved Successfully!"

load_deck(slotnum)
if(fexists("saves/[src.key]/Decks/slot[slotnum].sav"))
var/savefile/F=new("saves/[src.key]/Decks/slot[slotnum].sav")
F["deck"]>>src.CurrentDeck
src<<"<b><font color='white'>Cards and Deck Loaded Successfully!"
else
src<<"<b><font color='white'>No deck to load!"
turf/SaveDeck
icon = 'SaveDeck.png'
Click()
var/slotnum=input("Pick a slot to save your deck in.") as null|anything in list("1","2","3","4","5")
if(!slotnum)return
slotnum=text2num(slotnum)
var/name = input("Name your deck") as text|null
if(!name) return
if(fexists("saves/[usr.key]/Decks/slot[slotnum].sav"))
var/savefile/T = new("saves/[usr.key]/Decks/slot[slotnum]/[name].sav")

Con someone please show me how to make a better save and load deck then this this one reboots me every time i load a saved deck.
thanks for the help if you give it
~Grand~
switch(alert("Do you want to overwrite the deck in slot [slotnum]\nName of Deck: [T["name"]]?","Save Deck","Yes","No"))
if("Yes")
usr.save_deck(slotnum,name)
if("No")
return
else
usr.save_deck(slotnum)
turf/LoadDeck
icon = 'LoadDeck.png'
Click()
var/slotnum=input("Pick a deck to load.") as null|anything in list("1","2","3","4","5")
if(!slotnum)return
slotnum=text2num(slotnum)
switch(alert("Do you want to overwrite your current deck?","Load Deck","Yes","No"))
if("Yes")
usr.load_deck(slotnum)
if("No")
return
Why exactly do you have slotnum in the proc parenthesis? I don't really see a need for it there..
mob/proc
save_deck(slotnum)
if(length(src.deck) <=40)
src<<"<b><font color = white>Sorry Cant Save a deck with 40 cards or less."
else
var/savefile/F=new("saves/[src.key]/Decks/slot[slotnum].sav")
src.CurrentDeck = src.deck
for(var/obj/card/c in src.CurrentDeck)//this is needed to stop reboots
c.owner=null//make sure you null the cards owner otherwsie it saves them :/
F["deck"]<<src.deck
F["name"]<<name
src<<"<b><font color='white'>Cards and Deck Saved Successfully!"
load_deck(slotnum)
if(fexists("saves/[src.key]/Decks/slot[slotnum].sav"))
var/savefile/F=new("saves/[src.key]/Decks/slot[slotnum].sav")
F["deck"]>>src.CurrentDeck
for(var/obj/card/c in src.CurrentDeck)//this is for when we load the cards
c.owner=src//make the cards owner the person who loaded :/
src<<"<b><font color='white'>Cards and Deck Loaded Successfully!"
else
src<<"<b><font color='white'>No deck to load!"

Reason would probly be your saving the cards owner as well:/. Try that and check if it helps.

- Dark Emrald