I am trying to make a missle attack where when one clicks on a turf a missle is sent to the turf. I use get_dir for this but however because Possible results are NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, and SOUTHWEST. Sometimes when you click on a turf the attack goes in the right direction but misses the target. For example when you click Northwest the missle goes northwest but sometimes its a little lower or higher than the target. Heres the code I use.
turf/Click()
dir = get_dir(usr,src)
usr.projectile(new /obj/Arrow(usr.loc),dir,10)
mob
proc
projectile(obj/projectile,var/dir,var/delay)
sleep(1)
walk(projectile,dir)
sleep(delay)
del(projectile)
ID:174638
![]() Jul 29 2003, 5:40 pm
|
|
![]() Jul 29 2003, 5:46 pm
|
|
I would suggest useing walk_towards. Say when you click on a turf you create an invisible something (mob?) then make the missle walk towards the "something". Hope that helps ^_^
|
I believe Spuzzums missile lib has what your looking for.
http://developer.byond.com/hub/Spuzzum/s_missile |