ID:148810
 
I need help on three different problems. Errors are pointed out by line name.

Error 1 + 2:

mob
proc
DeathCheck()
if(usr.HP == 0)
world << "[usr] dies!"
usr.loc = locate(1,2,4)
usr.HP = 100
if(global.defender == "[usr]")
global.challenger.upgrade += 1 // Line 9
else if(global.challenger == "[usr]")
global.defender.upgrade += 1 // Line 11



Error 3:

mob/verb/Challenge(M as mob in world)
if(!challenger)
if(!global.defender)
usr << "Challenging [M]."
M << "[usr] challenges you."
switch(alert(M,"Will you fight or flee?","Fight or flee... Fight or flee...","Flee","Fight"))
if("Flee")
return 0
if("Fight")
global.challenger = "[usr]"
global.defender = "[M]"
usr.loc = locate(/turf/arena/challenger)
M.loc = locate(/turf/arena/defender) // Line 13
world << "Fight started: [usr] vs. [M]! READY, FIGHT!"


All variables are defined, but the errors are:

loading RoboWars.dme
loading Macro.dms
challenge.dm:13:error:M.loc:undefined var
Death.dm:9:error:global.challenger.upgrade:undefined var
Death.dm:11:error:global.defender.upgrade:undefined var

RoboWars.dmb - 3 errors, 0 warnings (double-click on an error to jump to it)

All vars SHOULD be defined.

Are you sure "global.defender" is set to the atom with the vars defined? Also, you don't even need "global.var" it will work the same with just "var".
In response to Nadrew
Tried changing, no effect.
The M.loc problem I can fix, anyway: The reason this isn't working is that the game thinks M is a generic var. "M as mob" tells the verb to choose just mobs, but it doesn't tell the compiler that M is expected to be a mob; for that, you need mob/M. So your verb's argument should be "mob/M as mob in world".

Lummox JR
In response to Lummox JR
ty, but that leaves the challenger.upgrade and defender.upgrade vars.
In response to Drafonis
The global var should be defined:

var/mob/WHATEVER

No indentation.