Sound Problem

I have a gun, that when mouse is clicked, it constantly shoots with pulse mode, and I want it to play a sound of a gun shooting, but it plays slowly. For example, The gun shoots 20 times, the sound only plays 10 times. Is there a way to possible have the sound overlap? I have tried all the settings (loop end, play, ect…), but still not what I wanted… Here is the blend:

Experiment with a fresh blend. For one thing it will be a small file if you want to upload it directly here and for people to download.

Sometimes you’ve just got to find or edit the right length sound. A file might run for 1 second yet only have 50 ms of sound so needs to be trimmed. But I understand that you might want the sound of a gunshot to persist while more shots are occurring, and so on. So this is what you mean by overlap. Like you’ve got a nice gunshot sound that runs for 200 ms but you want to be able to fire every 50 ms and have all sounds play out fully.

There’s probably a way, maybe with a bit of python and 3 or 4 actuators. I’ve been meaning to experiment with this so I might come up with something later today. Can you upload a little blend with the sound you want that and that shows how frequently you want it to run?

Sure, Here is a small blend with just the gun and the animation empty that plays the sound:

Got it working. I chose Shotgun3 because it’s about a 2 second wav file. But with a script I can fire it 8 times as quickly as I can click the mouse and each sound plays all the way through. So it’s a python controller hooked up to 8 actuators. Each mouse click counts up a counter 0 through 7 and back again. That way I can direct to one of 8 actuators. I don’t know automatic shotguns but I figure 8 shots is reasonable between reloading.

Sounds fantastic. I suspected it was doable but had never tried.

This script is written for 2.5, hopefully that’s what you are running. I can’t be fagged learning 2.49 syntax so if you need it converted post it on the board.

Edited to add: What I said about reloading. What I meant was was that after firing 8 shots the first actuator might still be firing so there could be a slight delay if you got 8 shots off in 1.5 seconds. If you added a few more actuators and added a few more lines to the script you’d never run out of auto shotgun ammo just by clicking the mouse.


EqTest.blend (418 KB)

To make it more realistic (I own many guns) the initial blast should be played from the gun. All other sounds that carry like the sonic crack should be a 3d sound coming from the projectile. also the closer you are to objects (like a wall) the pitch and volume should go up.

Then people like me who play a FPS won’t say “this is nothing like shooting!” The best example i’ve seen is “Insurgency” on steam.

Yo alas. You’re right. You could get into sounds in a big way in gaming. But it’s tricky. It’s a different thought process, different skill to graphics and programming. And there is virtually no discussion about sound on this forum.

Jason had a valid problem. I’d considered it before but been to lazy, because I find working with sounds a bit tedious. And I suspect most others that post here do as well. But I’m a bit more interested now. In this example, like it’s not hi fi or anything but it nice was to be able to demonstrate that 8 sounds could be played at once. More likely to tackle something now like an accelerating car and gear changes and stuff. You probably need to have about 8 or 10 files and be able to blend and time them. As things are most of us settle for sounds that play longer than we need them or chop them off and it sounds ugly.

If a few of us got interested sound could become more of a thing on the forum.

In my experience, the Audaspace module’s pretty easy to use. If you know Python, it’s better to use that than use several sound logic bricks, but if you don’t, then this is a valid method of making the sounds play all the way through. Equip’s also right that it’s a really good idea to trim the unnecessary parts out of the sound (the blank beginning and end, for example).