mob
verb
Savenow()
set name ="Save"
if(usr.cansave)
var/savefile/F = new("TSCv3 players/[usr.key].sav")
//usr.V = usr.verbs
usr.xco = usr.x
usr.yco = usr.y
usr.zco = usr.z
Write(F)
spawn(10) usr << "<font color=red><b>Your game has been saved!"
mob
proc
LoadPlayer()
if(fexists("TSCv3 players/[src.key].sav"))
var/savefile/F = new("TSCv3 players/[src.key].sav")
Read(F)
//for(var/mob/s in src.V)
//src.verbs += stuff
world<<"<font size=2><font color=red><B>World News: <font color=red>[src.key] <font color=green>has joined the game."
src.loc = locate(xco,yco,zco)
src.cansave=1
src.Frozen = 0
src.AutoSave()
src.cregen=src.oldcregen
//src.logincrap()
spawn(50)
for(var/c in fan)
if(c==src.key&&src.gotfanreward==0)
src<<"For being a fan of the hub you recieve some exp and money."
src.exp+=src.Mexp
src.yen+=5000
src.gotfanreward=1
src.AwardMedal("I'm a fan!")
else
alert("You dont have a character to load!")
src.start()
mob//this is the code to the mob
puppet
regular
Problem description:
I keep getting this run-time, it all started after i put a mob in the player's inventory im guessing since the mob in the inventory has variables of it's own its having some sort of issue, i'm just not sure how to fix them
run-time error: cannot append to list
proc name: LoadPlayer (/mob/proc/LoadPlayer)
source file: Saving And Loading.dm,132
usr: Zed (/mob)
src: Zed (/mob)
call stack:
Zed (/mob): LoadPlayer()
Zed (/mob): start()
Zed (/mob): Login()
----
For the fan check, instead of checking by looping through all values, you can use the keyword:
Same effect, less lines/writing.