Uhm, this is gonna sound -really- stupid, but Im not gonna learn unless I ask.. buuuut
Well.. now that I think about it, its more like 2 questions..
Sorry for being such a n00b ^^;;
How do you set up byond to know which direction a mob is facing?
And how do you set that into the combat system, so you can attack whats in front of you, instead of anything within one tile
thanks for the help, again, I hate being such a n00b, but I gotta learn this somehow
Elorien
aramarth@home.com
There's a built in var that mobs have, called "dir", that stands for what direction a mob, obj, or whatever is facing. The value is actually stored as a number, but BYOND has built in macros, whereby if you type a direction like NORTH (all caps, no quotes... as opposed to north or "NORTH"), the compiler will read it as the appropriate number... so no need to bother learning what direction is what number, unless you're doing something really complicated.
The best way to make your attacks "directional" is to eliminate the argument... that is, don't make it
attack(mob/victim as mob in oview(1))
Just make it:
attack()
with a var called victim or target or opponent or enemy or something, defined in the verb itself.
attack()
mob/enemy
For the actual attack code, I think this might work:
if (enemy in get_step(src,src.dir))
attack code goes here