ID:177147
 
Hey. Im having a few problems with a verb. Here is a short version of it.
mob
host/verb
Setvar1(T as text)
var1 = T
usr << "Var1 is now [var1]"
Addvar1(mob/M in world)
M.tmpvars += var1

There are no errors.. I just get runtime error on the game when I try to used the Addvar1..what can I do to fix this?

runtime error: type mismatch
proc name: Addvar1 (/mob/host/verb/Addvar1)
source file: TEST.dm,19
usr: the jjj (/mob)
src: the jjj (/mob)
call stack:
the jjj (/mob): Addvar1(the jjj (/mob))

thats the runtime error...
Jacob wrote:
Hey. Im having a few problems with a verb. Here is a short version of it.
mob
host/verb
Setvar1(T as text)
var1 = T
usr << "Var1 is now [var1]"
Addvar1(mob/M in world)
M.tmpvars += var1

There are no errors.. I just get runtime error on the game when I try to used the Addvar1..what can I do to fix this?

The type mismatch is probably because M.tmpvars (which I'm assuming is a list) was never initialized, and so you're trying to add something to null. You should initialize it in mob/New() to list().

Lummox JR
In response to Lummox JR
Yeap. M.tmpvars is a list. Im working on a verb for TMP to where a person can click quickvar and type the var in. Then..he would just have to hit addquickvar to quickly add the var to the Mobs statpanel list. I figured it wouldn't be that hard to do. Im just not in my best prespective today =-\
In response to Lummox JR
Im still not quite getting it though =-\. Maybe I need to restudy a few things.
mob/var/list/tmpvars[] = list()
That is the var list im currently using.
In response to Jacob
Jacob wrote:
Im still not quite getting it though =-\. Maybe I need to restudy a few things.
mob/var/list/tmpvars[] = list()
That is the var list im currently using.

The [] here is extraneous; you don't need it, and it's probably messing something up.

Lummox JR
In response to Lummox JR
How did that get there... *shrug* Do you know anything I can read on in lists that might help me with this..?

*bah blasted thing still wont work*