Welcome, Guest. Please login or register. Did you miss your activation email?

* TUTORIAL SECTION RULES

This section is for SMOD TUTORIALS & GUIDES ONLY.
You may create a new topic in the appropriate area to share your tutorial. If you post anything off-topic here you will be temp-banned. This is so we don't hassle the moderators too much, they are volunteers.

If you need help with a tutorial, post a reply in its thread . Do not start a new topic for help here!

Author Topic: [TUTORIAL] Distant gunfire for NPCs  (Read 4703 times)

0 Members and 1 Guest are viewing this topic.

Offline alvaol62

  • *
  • +2% chance to make useful post
  • alvaol62 has no influence.
[TUTORIAL] Distant gunfire for NPCs
« on: September 29, 2012, 09:42:46 AM »
In vanilla HL2 and default SMOD the sound of most firearms will vary once the NPC that is shooting it goes further away. I thought it would be awesome to have this for our custom weapons, so today I bring you this little tutorial!  :D

Things you will need:

Audacity
A text editor

LET'S DO THIS!

First load your sound in Audacity. It should look like this:



Click on the little arrow on top of the sound file, then click Split Stereo Track:



Now you should have something like this:



Now click on the "Right" sound track to select it.



Then go to "Effect" and then click on "Low Pass Filter"



And you are done! Click on "File" then "Export as WAV" and save the file in your weapon sound folder!

EXPLANATION OF WHAT WE HAVE JUST DONE

By editing the script of this sound, we can tell the game to load a different sound when the weapon is being fired from afar. The left track will be used when the NPC is close or when the player shoots the weapon himself, and the right track will be loaded when the NPC is shooting from the distance. When we applied the Low Pass Filter, it made the right channel sound as if the weapon was being fired from far away.

So let's proceed to editing the soundscript!

Copy this and paste it in your game_sounds_weapons.txt located in the scripts folder of your SMod.

Code: [Select]
"Weapon_Myweapon.npc"
{
"channel" "CHAN_WEAPON"
"volume" "1"
"soundlevel" "SNDLVL_150dB"
"pitch" "PITCH_NORM"

"wave" "^weapons/Myweapon/Mysound-npc.wav"

}

First of all change "Weapon_Myweapon.npc" to an appropiate name. It should be relevant to the weapon you are making.
We will not change anything else from here, except the "wave" part.

Now here's the most important part of all the process.

Between the " and the "weapons" you can see this symbol: ^

This is the symbol that will tell the game to load the Right channel when the NPC is far away.

Make sure to change the names of the folders and the file as well.

And that's it! If you did this right, your sound will be different when the NPC is shooting from afar!

Have fun!!!  ;D

DEMONSTRATION:






« Last Edit: January 20, 2015, 08:57:03 AM by Pepsifan04 »

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #1 on: September 29, 2012, 09:46:14 AM »
Very nice job!

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #2 on: September 23, 2013, 12:33:27 PM »
Doesn't work.
When I place the modified sound files in their directories, set them up etc., I get... silence. When I'm close up, I can hear the firing sound, but from far away all I hear is silence.
When I open up the modified file in Audacity, I see that the two channels are merged again... is that supposed to happen?

Offline Pepsifan04

  • *
  • *
  • +12% chance to make useful post
  • Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...
    • Smod: CryLife
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #3 on: September 24, 2013, 01:54:16 PM »
Doesn't work.
When I place the modified sound files in their directories, set them up etc., I get... silence. When I'm close up, I can hear the firing sound, but from far away all I hear is silence.
When I open up the modified file in Audacity, I see that the two channels are merged again... is that supposed to happen?
No, it's not supposed to happen...
You need to split the "track" to a two separate channels, edit the lower one and export the whole project (both channels, nothing highlighted) as .wav
DROP DATABASE bsnooch

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #4 on: September 24, 2013, 02:01:34 PM »
No, it's not supposed to happen...
You need to split the "track" to a two separate channels, edit the lower one and export the whole project (both channels, nothing highlighted) as .wav

Lol, I did all that, I'm not that dumb. It's just when I'm finished editing I save the file, and when I open again, the channels are merged again.
I checked out other files, seems like they experience the same thing, so that shouldn't be the problem.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #5 on: October 03, 2013, 07:39:00 AM »
I actually used this tutorial the other day and it works fine. You are missing a step or something.

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #6 on: October 03, 2013, 03:01:41 PM »
I actually messed up the sound events. Works now.

Offline Chyvachok

  • *
  • +3% chance to make useful post
  • Chyvachok has no influence.
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #7 on: March 19, 2016, 02:02:08 PM »
How to make distant fire sounds is interesting for me, but sadly here screenshots here are deleted, can someone tell what effects and their setting in audacity use for best result?

Offline HentaiSpirit

  • *
  • +1% chance to make useful post
  • HentaiSpirit has no influence.
Re: [TUTORIAL] Distant gunfire for NPCs
« Reply #8 on: September 22, 2016, 07:22:44 PM »
How to make distant fire sounds is interesting for me, but sadly here screenshots here are deleted, can someone tell what effects and their setting in audacity use for best result?

i use reverb 

room size: 100
pre delay: 5
reverbance: 40
damping: 0
tone low: 12
tone high: 90
wet gain: 10
dry gain: -3
stereo width: 100

when you split stereo to mono, remember to set one to the left channel and one to the right ( if it stay in mono when you export it will not work )
No sorcery lies beyond my grasp !