ID:176865
 
how do can i make a simple animation happen so that when i click attack in a command list the character will shoot something in a straight line(in the direction he's facing)? it could even be as simple as a dot/bullet or something. if you need more information just ask.
Might want to check out Malver's War demo. I hear that a function like this is implemented.

http://www.byond.com/hub/ hub.cgi?qd=hubIndex;hub=4367;channel=620

That should do it.
Well this task is very simple, but has a few steps to it.

1)Define the bullet or projectile as an object and set a bump procedure.
obj/projectile
var/delay=2//The speed they fire, the lower the quicker
var/damage//The damage they cause (integer)

proc/shoot()//Call this when you want them to fire
walk(src,src.dir,delay)

Bump(mob/M)//Redefine their Bump()
if(ismob(M))//If they are a mobile
M.life-=damage//subtract their damage from their life
del(src)//delete the object

Bullet/*Bullet and missile are extentions of the type obj/projectile.
Example: Bullet = /obj/projectile/bullet*/

icon='bullet.dmi'
delay=1 //Set their delay and damage
damage=5
Missile
icon='missile.dmi'
delay=4
damage=20

/*Now for the player interaction*/
//Do this if you want the mob to keep it always
mob/verb/Fire_Bullet()
var/obj/projectile/O
O=new/obj/projectile/bullet
O.loc=usr.loc
O.dir=usr.dir
O.shoot()//Fire it!

//This is the verb if you want it linked to an object

obj/Missile_Launcher
verb/Fire()
set src in usr //If they are carrying it
var/obj/projectile/O
O=new/obj/projectile/missile
O.loc=usr.loc
O.dir=usr.dir
O.shoot()//Fire it!

//I hope this helps, and it is easy to change around


<big><font color=blue>~<font color=navy>-<font color=yellow>Ken<font color=navy>-<font color=blue>~</font></font></font></ font></font></big>