Poll

Is this possible?

yes
12 (31.6%)
no
3 (7.9%)
GTFO
2 (5.3%)
lollollol
1 (2.6%)
hurr duhrr i'm a hoers
7 (18.4%)
duhrr i'm a troll
5 (13.2%)
idk
3 (7.9%)
like i care...
2 (5.3%)
already found out the hard way. it doesn't work.
3 (7.9%)

Total Members Voted: 38

Author Topic: Are clinking bullet casings possible?  (Read 2108 times)

Well, I was thinking during school, is it possible for a bullet casing in-game to make a clinking noise when it hits something (i.g., the ground.)? Here's how (i think) the code would generally go (it'd probably be in the part that covers the casing). Don't flame me because I am not very good at figuring out the right symbols in C+ & C++.

Code: [Select]
//Oncollision;

    playsound; "shellclink"
or something close to that.

/discuss

oh, and the shellclink is an example sound.

Make the bullet shell a projectile that bounces well and clinks on each bounce.
« Last Edit: April 10, 2011, 11:57:31 AM by Red Cube »

I never thought of this. Someone answer, this would be amazing.

I think for GCats FNSCAR it has a bullet clink sound but it's mixed with the fire.

It is possible for a projectile to make a different sound depending on which type of object it hits. And yes, Gravity has made this happen for his weapons when you shoot a vehicle

The easiest way would be mixing a clink sound to the firing sound of a weapon. A kind of stupid way would be firing a raycast to check for the distance and how long it would probably take for the shell to hit the ground, and playing a delayed sound then. But the way you suggested it, that the shell itself checks and plays the sound is impossible I think.

It is possible for a projectile to make a different sound depending on which type of object it hits. And yes, Gravity has made this happen for his weapons when you shoot a vehicle
you don't get the point. there is a clink sound when the SHELL (not the bullet) hits an object.

Pretty sure the debris object class has a built-in onCollision function, I imagine it would turn up in a dump() of a debris datablock/class.

Pretty sure the debris object class has a built-in onCollision function, I imagine it would turn up in a dump() of a debris datablock/class.
Hmm. Interesting. I think someone should try that sometime soon.

I'll do a function dump later and see if debris has an oncollide function, but if it doesn't, why not use more projectiles for the shells?

I'll do a function dump later and see if debris has an oncollide function, but if it doesn't, why not use more projectiles for the shells?
Don't projectiles have more lag than debris?

Debris is a client-side thing so I don't think there's a collision function.

The L4D2 M16.

I think it has one, but it's also built into the fire sound.

The L4D2 M16.

I think it has one, but it's also built into the fire sound.
no, it does not.
Debris is a client-side thing so I don't think there's a collision function.
forget.

There is a "explodeOnMaxBounce"/"explosion" field (Appendix A) for a debrisdata which would let you set a sound but that may cause your bullet casing to disappear on contact/only clink once. The only other thing I can think of is having more than one of these e.g. bulletCasing1 does bulletExplosion1 on contact, bulletExplosion1 spawns bulletCasing2/bulletExplosion2 ... for a couple repeats (one spawning itself would repeat infinitely) but that'd cause the casing to jump in random directions plus waste datablocks.

There is a "explodeOnMaxBounce"/"explosion" field (Appendix A) for a debrisdata which would let you set a sound but that may cause your bullet casing to disappear on contact/only clink once. The only other thing I can think of is having more than one of these e.g. bulletCasing1 does bulletExplosion1 on contact, bulletExplosion1 spawns bulletCasing2/bulletExplosion2 ... for a couple repeats (one spawning itself would repeat infinitely) but that'd cause the casing to jump in random directions plus waste datablocks.
lol could you be moar specific and speak american or britain english? (I understand it XD)

Though really, that sounds quite possible. maybe you could edit some add-on (like Strato's desert eagle) and put in those sounds and code?