2008.08.08, 06:12 PM
Hey, I need some help coding a flashbang.
(it's like a grenade but instead of exploding it emits a bright flash of light, temporarily blinding anyone looking at it, and makes a loud banging sound.)
It seems easy, you could just spawn a small melee and check to see which projectile hit you (and add some line of sight stuff), but almost none of dim3's obj.hit commands seem to work for me. I tried obj.hit.projectileName, but as the projectile spawns a melee it doesn't work. Weapon name won't work as the grenade is a secondary weapon and can be thrown from any weapon, so if I'm holding a crowbar when I throw it, it thinks I was hit with a crowbar. I also tried setting the flashbang to do 1 damage, and check how much the player was damaged but even if you die obj.hit.damage returns 0.
Any ideas?
(it's like a grenade but instead of exploding it emits a bright flash of light, temporarily blinding anyone looking at it, and makes a loud banging sound.)
It seems easy, you could just spawn a small melee and check to see which projectile hit you (and add some line of sight stuff), but almost none of dim3's obj.hit commands seem to work for me. I tried obj.hit.projectileName, but as the projectile spawns a melee it doesn't work. Weapon name won't work as the grenade is a secondary weapon and can be thrown from any weapon, so if I'm holding a crowbar when I throw it, it thinks I was hit with a crowbar. I also tried setting the flashbang to do 1 damage, and check how much the player was damaged but even if you die obj.hit.damage returns 0.
Any ideas?