is there a way to make "A" face "B"? or to find out whether or not "A" is facing "B"?
This would come in handy for combat and simulated dialogue.
ID:174304
![]() Aug 31 2003, 9:16 pm
|
|
![]() Aug 31 2003, 10:16 pm
|
|
<code>if (A in get_step(B, B.dir)) A << "[B] is looking at you. Be afraid. Be very, very, afraid."</code>
|
Xallius wrote:
is there a way to make "A" face "B"? or to find out whether or not "A" is facing "B"? To make A face B you would do A.dir = get_dir(A,B) //Note: the order of A and B is important, if you switch them A will face away from B. To see is A is facing B. if(A.dir = get_dir(A,B)) //Note: the order has the same effect as in the first example. // Do something [Edit] Whoops I made a mistake on the second example there should be teo equal signs since it's a comparision. It should read: if(A.dir == get_dir(A,B)) //Note: the order has the same effect as in the first example. // Do something |
//ok, now it says that it cant read null direction
//here is the coding for the battle system test mob proc attacking(mob/M as mob in oview(1)) var/mob attacker defender attacker = src defender = M if(attacker in get_step(defender, defender.dir)) attacker << "attacking!" |
Well, you're trying to read defender.dir when you get that error. Therefore "defender" must be null. It's being assigned the value of "M", which means that "M" must also be null. "M" is an argument to the attacking() proc. Therefore, you forgot to pass in the argument to the proc. Log-gick! =)
|
//erm.. unfortunately Im not sure how to pass it in the proc
//heres my coding for the verb and proc mob verb/attack(mob/M as mob in oview(1)) attacking() proc/attacking(mob/M) var/mob attacker defender attacker = src defender = M if(attacker in get_step(defender, defender.dir)) attacker << "attacking!" |