//==First code snips are addon codes that may/may not relate to the code in question but are placed here to be sure.
Code: Code Addons
//Code Snip Addon 1
//The load proc.
client/proc/Load(var/slot)
alert("Call 1 - [slot]") // launched
var/savefile/F = new("Player Saves/[copytext(ckey,1,2)]/[ckey].sav")
alert("Call 2 - [slot]") //launched
F["Slot[slot]"] >> mob
alert("Call 3 - [slot]") //failed
//Code Snip Addon 2
//the Save code. Not sure if its needed but if it can be modded or is an ineffective failed system please advise me so i may fix the errors.
mob/logincharacter
proc
CreationPro(var/sluck)
var/mob/newchar
newchar = new/mob/human/player(locate(3,3,2))
newchar.slot = sluck
newchar.stamina = 50
newchar.created = 0
usr.client.CreationChangeProc()
usr.client.mob = newchar
verb
NewCharacter() //execute for new char
switch(alert("Please choose slot to play in","Character Creation","Slot One","Cancel","Slot Two"))
if("Slot One")
if(fexists("Player Saves/[copytext(ckey,1,2)]/[ckey].sav"))
var/savefile/F = new("Player Saves/[copytext(ckey,1,2)]/[ckey].sav")
if(F.dir.Find("Slot1"))
switch(alert("Would you like to Overwrite Slot One","Character Creation","Yes","No"))
if("Yes")
CreationPro(1)
else
return
else
alert("save but no slot one")
CreationPro(1)
else
alert("bing no save")
CreationPro(1)
if("Slot Two")
var/savefile/F = new("Player Saves/[copytext(ckey,1,2)]/[ckey].sav")
if(fexists("Player Saves/[copytext(ckey,1,2)]/[ckey].sav"))
if(F.dir.Find("Slot2"))
switch(alert("Would you like to Overwrite Slot Two","Character Creation","Yes","No"))
if("Yes")
CreationPro(2)
else
return
else
CreationPro(2)
else
CreationPro(2)
if("Cancel")
return
Code: Code in question
LoadSlotOne() //execute to load slot one
// usr.client.LoadedChangeProc(usr.client) //executes the proc that changes all the windows to the map.
// usr.client.Load(1) //executes the load proc (see "Code Snip Addon 1") these 2 noted out commands worked perfectly before the introduction of the if/else statements.
if(fexists("Player Saves/[copytext(ckey,1,2)]/[ckey].sav"))
var/savefile/F = new("Player Saves/[copytext(ckey,1,2)]/[ckey].sav")
if(F.dir.Find("Slot1"))
alert("Ding")
usr.client.LoadedChangeProc(usr.client)
usr.client.Load(1)
else
alert("Bam")
return
Problem description: as noted above, when i added the if and else statements to the loading proc to check for the save it doesn't work (well it does half way) it launches the proc that changes the screens but does not launch the actual loading procs.
Furthermore once i figure out this problem i will prolly modify it again to do checks for slot one saves and then make it launch the commands for creating a new char so that it auto makes something in slot one if the load has none there
EDIT: Added the updated alert commands to the Code snip addon 1. as you can see it launches the first 2 but fails to run the mob launcher. it use to work fine before the introduction of the if and else in the verb =\
Now, is your Load() proc being called at all? If not, LoadedChangeProc() may be holding it up.