ID:261539
 
runtime error: type mismatch
proc name: chekc (/mob/proc/chekc)
source file: War.dm,428
usr: Tro (/mob/pc/Diablo)
src: Tro (/mob/pc/Diablo)
call stack:
Tro (/mob/pc/Diablo): chekc("Fire Salamander Archers", 0)
the attack (/obj/hud/screens/attack): Click(the ash (6,13,1) (/turf/ash))

attack is a screen obj, and I have...

Click()
var/p=blah
var/b=blah
usr.chekc(p,b)

which outputs
chekc("Fire Salamander Archers", 0)
like it says above
which is correct...

so what's the prob?


Jon Snow wrote:
so what's the prob?

The problem is, you showed us the wrong proc. The crash is happening in chekc(), so obviously that's the proc you should have included in your post.

Lummox JR
In response to Lummox JR
mob
proc
chekc(o,p)
if(p>=0)
if(o=="Fire Drakes")



then if(o=="Fire Salamander Wizards") etc...
there's about 40 of these
and then it adds things based off of o and p, but if(p>=0( is where it messes up I think.

sorry about that Lummox
In response to Jon Snow
Jon Snow wrote:
mob
proc
chekc(o,p)
if(p>=0)
if(o=="Fire Drakes")



then if(o=="Fire Salamander Wizards") etc...
there's about 40 of these
and then it adds things based off of o and p, but if(p>=0( is where it messes up I think.

Well, you need to give us a specific line where this is happening. Show the whole code, plus the arguments it's being called with (don't assume the arguments are correct, either).

Lummox JR
In response to Lummox JR
obj/hud/screens/attack
Click()
var/db=input("Front wave is going to attack where?") in list ("Front","Back","Left","Right")
var/d=input("First choice.(front wave) What do you want to attack with?") in list("lots of different things")
var/e=input("How many of that monster for the front?") as (num)
usr.chekc(d,e)
usr.front=usr.selection2
usr.front2=usr.selection
usr.frontwave=db


mob
proc
chekc(o,p)
if(p>=0)
if(o=="Fire Drakes")
if(src.FireDrake>=p)
src.FireDrake-=p
src.KKFireDrake+=p
src.selection2+=src.KKFireDrake
src.selection=o
if(src.wave=="Front")
src.frontfire+=2
src.fronthp+=15000
src.frontd+=25
src.frontat+=1500
src.frontfireball+=1
if(src.wave=="second")
src.secondfire+=2
src.secondhp+=15000
src.secondd+=25
src.secondat+=1500
src.secondfireball+=1
if(src.wave=="Middle")
src.middlefire+=2
src.middlehp+=15000
src.middled+=25
src.middleat+=1500
src.middlefireball+=1
if(src.wave=="forth")
src.forthfire+=2
src.forthhp+=15000
src.forthd+=25
src.forthat+=1500
src.forthfireball+=1
if(src.wave=="back")
src.backfire+=2
src.backhp+=15000
src.backd+=25
src.backat+=1500
src.backfireball+=1
return



IT gives me this error
runtime error: type mismatch
proc name: chekc (/mob/proc/chekc)
source file: War.dm,428
usr: Tro (/mob/pc/Diablo)
src: Tro (/mob/pc/Diablo)
call stack:
Tro (/mob/pc/Diablo): chekc("Fire Salamander Archers", 0)
the attack (/obj/hud/screens/attack): Click(the ash (6,13,1) (/turf/ash))



there we go...
also attack is a screen obj in my hud system...

note that I didn't post ALL of the code because it's realllly BIG but it's all exactly the same as the above it's just like changing some of the names around that's all...

also I have these different things show up in the statpanel, and usr.wave shows up but the others don't do anything...
In response to Jon Snow
Jon Snow wrote:
source file: War.dm,428

See, the idea behind getting the line number is so you can find out which line it is, and show where that is in your code. I have no clue what line 428 is.

Lummox JR
In response to Lummox JR
this is line 428
src.selection2+=src.KKFireDrake

In response to Jon Snow
Jon Snow wrote:
this is line 428
src.selection2+=src.KKFireDrake

Okay, that gives us a starting point, then. Where are the selection2 and KKFireDrake vars defined? Are they being set or altered by any other code before this call?

Since you've got a type mismatch, my guess is you're trying to add one number to another, but either selection2 or KKFireDrake probably isn't a number.

Lummox JR
In response to Lummox JR
thanks a ton!! Ya that's all I needed to know I didn't know what it ment by mismatch but now that you've explained it I know what the problem is and I'm going to go fix it!!