I get this runtime error.
runtime error: type mismatch
proc name: Learn (/mob/archeryteacher/verb/Learn)
usr: DBZFreak (/mob/man)
src: the archeryteacher (/mob/archeryteacher)
call stack:
the archeryteacher (/mob/archeryteacher): Learn()
And here is the code.
mob/archeryteacher
icon='charas.dmi'
icon_state="arc"
verb/Learn()
var/list/visit=list()
set src in oview(1)
if(visit.Find(usr.name))
usr<<"You Have already learned how to use your bow and arrow"
else
src.dir=WEST
flick("arcshoot",src)
sleep(10)
var/A=new/obj/arrow(loc=locate(src.x-1,src.y,src.z))
sleep(1)
del(A)
var/B=new/obj/arrow(loc=locate(src.x-2,src.y,src.z))
sleep(1)
del(B)
var/C=new/obj/arrow(loc=locate(src.x-3,src.y,src.z))
sleep(1)
del(C)
var/D=new/obj/arrow(loc=locate(src.x-4,src.y,src.z))
sleep(1)
del(D)
var/E=new/obj/darrow(loc=locate(src.x-5,src.y,src.z))
sleep(20)
usr<<"Now You Try"
usr.dir=WEST
Lock(usr)
usr.overlays+=/obj/barrow
sleep(10)
usr.overlays-=/obj/barrow
var/F=new/obj/arrow(loc=locate(usr.x-1,usr.y,usr.z))
sleep(1)
del(F)
var/G=new/obj/darrow(loc=locate(usr.x-2,usr.y,usr.z))
sleep(10)
usr<<"Good Job keep practicing. I will give you this bow and 5 arrows use them wisely"
new/obj/arrow(usr)
new/obj/arrow(usr)
new/obj/arrow(usr)
new/obj/arrow(usr)
new/obj/arrow(usr)
usr.arrows+=5
usr.name+=visit
Unlock(usr)
I think it has to do with the list var "visit" but im not sure.
ID:261516
Jun 5 2002, 10:09 am
|
|
Strange Kidd wrote:
I get this runtime error. Ok it is the line that is bold underlined and in italics |
In response to Strange Kidd
|
|
usr.name+=visit Since visit is the list, and you're checking to see if the user's name is in it, this should be the other way around. Lummox JR |
In response to Lummox JR
|
|
no more runtime error but you can still learn again
|
In response to Strange Kidd
|
|
nevermind I just needed to move the var up thanks
|
In response to Strange Kidd
|
|
Strange Kidd wrote:
no more runtime error but you can still learn again That's because you're making visit a new list each time. It should be a var belonging to the mob, initialized during New(). Lummox JR |
Conspicuously missing from that is a line number. You need to go into your preferences for the project, and turn on debug info. That way, you'll get a line number, which will tell you which line has the problem. Then you can show us which line that is.
Lummox JR