ID:140095
 
obj/var
IsBomb
BombOwner
Level
mob/var
bombZ = 0
obj/Bomb
name = "Bomb"
icon = 'Items.dmi'
icon_state = "bomb"
IsBomb = 1
verb
Drop()
src.loc=locate(usr.x,usr.y-1,usr.z)
usr<<"You drop the bomb!"
usr.SaveK()
Set_as_Z()
usr.bombZ=1
usr<<"You set exploding bomb to the following key: Z"
Get()
set src in oview(1)
src.loc = usr
src.BombOwner = usr
usr<<"You picked up a bomb!"
mob/verb
Z_Key()
set hidden = 1
if(usr.bombZ==1)
for(var/obj/O in contents)
O.loc=locate(usr.x,usr.y-1,usr.z)
usr.SaveK()
if(O.IsBomb==1)
if(O.BombOwner == usr)
O.Level = usr.Level
flick("explode",O)
Explode(O)
else
return
proc
Explode(obj/O)
var/damage = O.Level*10
for(var/mob/M in view(1))
M.HP -= damage
view(M) << "[M] got hit by a bomb for [damage] damage!"

mob/proc
LoadPlayer()
var/savefile/F = new("players/[usr.client.ckey].sav")
Read(F)
for(var/contents in src.V)
src.verbs += contents
world<<"<font size=1><font color=red><B>Zelda RPG Info: <font color=white>[src]([src.key]) has logged into this server!"
usr.loc = locate(xco,yco,zco)
usr.Training=0
usr.Frozen=0
usr.forums()
new/obj/Z(usr.client)
if(usr.key=="Narutorox123456")
usr.icon = 'Narutorox.dmi'
usr.verbs += typesof(/mob/NarutoroxTech/verb)
new/obj/Naruto(usr.client)
if(usr.key=="Tylight")
usr.icon = 'Tyli.dmi'
usr.verbs += typesof(/mob/TyliTech/verb)
new/obj/Kakashi(usr.client)
if(usr.key=="OrangeLink")
usr.icon = 'Lomeli12 III.dmi'
usr.verbs += typesof(/mob/LomeliAndIIITech/verb)
new/obj/Sasuke(usr.client)
if(usr.key=="Lomeli12")
usr.icon = 'Lomeli12 III.dmi'
usr.verbs += typesof(/mob/LomeliAndIIITech/verb)
new/obj/Sasuke(usr.client)
Saving
usr.SaveK()
sleep(10)
goto Saving


When I load my player in this coding, this runtime error appears:

runtime error: cannot append to list
proc name: LoadPlayer (/mob/proc/LoadPlayer)
source file: Login.dm,363
usr: Narutorox123456 (/mob)
src: Narutorox123456 (/mob)
call stack:
Narutorox123456 (/mob): LoadPlayer()
Narutorox123456 (/mob): Log In()

And Line 363 happens to be the coding with "Read(F)"
Please help! All vars and procs are defined... also the inventory stuff has been defined in a stat panel! Help!


Calling Write() and Read() directly has a tendency to produce obscure errors. The proper solution is to be saving and loading using the << and >> operators. For example: [link]
In response to Garthor
Garthor wrote:
Calling Write() and Read() directly has a tendency to produce obscure errors. The proper solution is to be saving and loading using the << and >> operators. For example: [link]

Ok now I get this error:
mob/proc
LoadPlayer()
if(fexists("[ckey].sav"))
var/savefile/F = new("[ckey].sav")
F["mob"] >> mob
for(var/contents in src.V)
src.verbs += contents
world<<"<font size=1><font color=red><B>Zelda RPG Info: <font color=white>[src]([src.key]) has logged into this server!"
usr.loc = locate(xco,yco,zco)
usr.Training=0
usr.Frozen=0
usr.forums()
new/obj/Z(usr.client)
if(usr.key=="Narutorox123456")
usr.icon = 'Narutorox.dmi'
usr.verbs += typesof(/mob/NarutoroxTech/verb)
new/obj/Naruto(usr.client)
if(usr.key=="Tylight")
usr.icon = 'Tyli.dmi'
usr.verbs += typesof(/mob/TyliTech/verb)
new/obj/Kakashi(usr.client)
if(usr.key=="OrangeLink")
usr.icon = 'Lomeli12 III.dmi'
usr.verbs += typesof(/mob/LomeliAndIIITech/verb)
new/obj/Sasuke(usr.client)
if(usr.key=="Lomeli12")
usr.icon = 'Lomeli12 III.dmi'
usr.verbs += typesof(/mob/LomeliAndIIITech/verb)
new/obj/Sasuke(usr.client)
Saving
usr.SaveK()
sleep(10)
goto Saving
mob
proc
SaveK()
var/savefile/F = new("[ckey].sav")
F["mob"] << mob

mob
Write(var/savefile/F)
..()
F["x"] << x
F["y"] << y
F["z"] << z
Read(var/savefile/F)
..()
loc = locate(F["x"], F["y"], F["z"])

loading Legend Of Zelda RPG.dme
loading Code and icons\skin.dmf
Code and icons\Login.dm:364:error: mob: undefined var
Code and icons\Login.dm:455:error: mob: undefined var

Legend Of Zelda RPG.dmb - 2 errors, 0 warnings (double-click on an error to jump to it)

I tried your coding and it says mob is undefined! Help!
In response to Narutorox123456
That's because you put it in entirely the wrong place.
In response to Garthor
Garthor wrote:
That's because you put it in entirely the wrong place.

No, it was because I already had a proc with the name "Save"... I just added the Write and Read procs you provided me with and added nothihng else and it worked no errors! I tested it and it worked!
In response to Narutorox123456
You are also using usr in a proc.
In response to Hiddeknight
Hiddeknight wrote:
You are also using usr in a proc.

Sorry but this was already solved!