ID:261431
 
I made it so that my archers get the ability to shoot arrows....weird huh?...Well anywho, when they shoot an arrow at an enemy, they never miss. The arrow just automaticly flies toward the target because I'm using the Missile(). I tried to make it so that the arrow just flies strait in the direction the archer is facing, then just disappears after 4 or 5 squares, like it hit the ground or something, but I couldn't figure out how to do that. Could somone please give me a little help on how to do this?

?The Wizard of How¿
This has what you need it's not the main function but it will teach you how it works.
In response to Nadrew
Thanks a lot man, this really helps a lot. It's been a while since I've done any coding with DM, and I have to get used to it again. Lousy C++ programming with it's supid semi-colons and what not......*mumble mumble grumble*
In response to The Wizard of How
Actually, I've begun putting ; at the end of my DM code lines, too. Wierd, huh?

I don't know what Nadrew has in his link, but I think this should provide some help:
Arrow
parent_type = /obj
name = "Arrow"
icon = 'Arrow.dmi'
icon_state = "Arrow-In-Flight"
Bump(atom/A)
if(ismob(A) == 0) return
world << "[A] died!"
del A
del src
proc/Shoot(var/direction = 0,var/power = 5)
if(src.name == " ") return
src.dir = direction
while(power)
power -= 1
step(src,src.dir)
src.icon_state = "Arrow In Ground"
src.name = " "
mob/Archer
verb/Draw()
set name = "Draw Arrow"
new /Arrow (src)
src << "You draw an arrow from your quiver."
src.verbs += /mob/Archer/proc/Fire
src.verbs -= /mob/Archer/verb/Draw
proc/Fire()
var/direction = input("What direction?","Fire Arrow") in list("North","South","East","West")
switch(direction)
if("North") direction = NORTH
if("South") direction = SOUTH
if("East") direction = EAST
if("West") direction = WEST
for(var/Arrow/A in src)
A.Shoot(direction,rand(5,7))
src.verbs += /mob/Archer/verb/Draw
src.verbs -= /mob/Archer/proc/Fire


-Lord of Water
In response to Nadrew
Thanks a lot Nadrew, your Demo really helped, but now I ran into another problem.....surprised? I want the arrows to be able to hurt all mobs, not just a specific type. How would I do this? I tried this; Bump(mob/Player/A)/ Then I made all of the mobs a person can pick a mob/player, but this messes up with my login code, is there a simpler way to just change the Bump() so that when it hits any type of mob, it is affected?

Thanks,

?The Wizard of How¿
In response to The Wizard of How
You would have to add another istype() check in the Bump() proc.