obj/bullets
var/damage
bullet1
icon='bag.dmi'
damage=5
bullet2
icon='bag.dmi'
damage=10
Bump(mob/Target)
if(istype(Target, /obj/bullets))
if(src.damage>Target.damage) //This is where the error occurs. Apparently, 'Target.damage' is not definined.
src.damage+=Target.damage //And here. (obviously)
del Target
if(Target.damage>src.damage) //And here.
Target.damage+=src.damage // Here....
del src
if(Target.damage==src.damage) //.....and here.
del Target
del src
This code may not be perfect, as it is just a quick example, similar to what my game's actual code is, but the error would be the same.
Can somebody tell me why Target.damage is not defined, even though Target(which should be recognized as /obj/bullets/), should have a variable named 'damage'.
src.Damage is being perfectly fine, and not causing errors.
I also tried defining damage under all /obj, not /obj/bullets.
I also used Bump(obj/Target) and not (mob/Target)
The same error occurs.
Here is the exact error:
"Objects.dm: 3244:error: Target.damage: undefined var"
Help would be appreciated,
--JaiZo