ID:150330
 
In my game outlaws i got evrything donw down to the bar tender but i cant seen to get my guns to fire bullets at people and make thare health go down

obj
items

Pistol
icon = 'gun1.dmi'
icon_state = "gun"
verb
PickUp()


set src in oview(1)

Move(usr)


fire()



Drop()
set category = "Inventory"

src.loc = locate(usr.x,usr.y-1,usr.z)

____________________________________________________________
whare the arrow is pointing is whare i need help hope some one can help
you need to finish the verb!



BYOND isn't a smart person...you cant just sau Fire and expect anything...NO! you need to complete the verb!
In response to SSJ4_Satanic Bardock
i know that i neeed the verb to put in i took out the one i had before becasue it didnt work
In response to Rollerc
Rollerc wrote:
i know that i neeed the verb to put in i took out the one i had before becasue it didnt work

Please don't expect us to write your code for you from scratch. If you want help, you should post what code you have tried most recently (not just some code, but relevant code, explain what you want it to do, explain what's going wrong, and post any output error DreamMaker is giving you.
In response to Skysaw
Ok i tried shadowdarkes shooting code thingy and it worked but i couldent make it to make the person it hits health go down and i dont want it just thae when it starts i want it thare when u buy the gun heres shadowdarkes code i used


mob/Gun

verb
fire()
fireprojectile(/obj/projectile/shield,src)


proc
fireprojectile(Type, mob/Who)
/*
Type = the type of projectile
Who = who fired/threw the projectile
*/
var/obj/projectile/S = new Type(Who.loc) // make a new projectile where the mob is
if(!istype(S,/obj/projectile)) // make sure they are
world.log << "Invalid projectile:[Type]"
return
S.dir = Who.dir // projectile faces same dir as the mob
S.who = Who
S.missileloop()



obj
projectile
density = 1
layer = FLY_LAYER
var
mob/who // the mob that fires the projectile

mrange = 10 // how far the projectile can go
delay = 1 // number of ticks between movements


proc
missileloop()
step(src,dir) // T = space the
if(--mrange > 0) // decriment range
spawn(delay) missileloop()
else
endmissile()

endmissile()
/* This proc is called when the missile stops moving.
Override it for missiles that have special effects
like explosions or leaving items where they land.
*/
del(src)

Bump(O)


//do your damage routine here
endmissile() // we hit something, so the missile stops


shield
icon = 'fire.dmi'


i want it so the fire verb comes up when u buy a gun and it makes the person that it hits health go down and i want its ammo go down wich i got a proc for
In response to Rollerc
Look at this part of the code:
   Bump(O)

//do your damage routine here

endmissile() // we hit something, so the missile stops


That's where you put your damage and ammo usage routines (Hence the comment). "O" is a reference to what was hit.

So far as the fire verb, it is defined in gun, so if gun is in your inventory, you'll have the verb.
In response to Skysaw
It worked sorta tho when i buy the gun the verb fire doesnt come up


obj
items

Pistol
icon = 'gun1.dmi'
icon_state = "gun"
verb
PickUp()


set src in oview(1)
new /mob/Gun/verb/fire
Move(usr)





Drop()
set category = "Inventory"

src.loc = locate(usr.x,usr.y-1,usr.z)


i think the new /mob/Gun/verv/fire is whats the proglum and whre on that code do i put Health-=40
In response to Rollerc
Your previous example had this in it:
verb
fire()
fireprojectile(/obj/projectile/shield,src)

Now that you seem to have deleted that code, you of course have no fire() verb show up with your gun.

I already answered where to put your damage code in my previous post.
In response to Rollerc
Take the fire() verb away from mob/Gun and place it under obj/Pistol.

You don't have to use obj/projectile/shield as the bullet. I made it with a shield because Sariat wanted a demo of Captain America throwing his shield. obj/projectile is set up so that you can have several types of projectiles. I would make your pistol fire obj/projectile/bullet, then you define the damaging portion in obj/projectile/bullet/Bump() so that it behaves differently from other projectiles.

obj/projectile/bullet
icon = "fire.dmi"

Bump(O) // the bullet just hit something called O
// see if O is a mob and if so, hurt it!
endmissile() // don't forget this part