Sound Emitter STool

I’ve decided to make and release my own Sound Emitter STool for you guys to use. I always like to have a lot of control over the things I make and I was disappointed with the other sound emitter tools.
Heres my version:

**** NOW AT VERSION 3.1 ****

Changes:
**** Version 3.1:**

  • Fixed “attempt to call method ‘SetVar’ (a nil value)” error.
  • Added a few more default models.

**** Version 3:**

  • Fixed custom sound not working properly
  • Using the SEnt works properly
  • The mv_soundemitter entity is now more server/client friendly
  • Sorry, still no Wire version…

**** Version 2.1:**

  • Fixed duplicator bug.

**** Version 2:**

  • Pitch now works for ANY sound.
  • Improved how sound effects are handled.
  • Improved how Using the entity works.
  • Tweaked the control panel a bit
  • Reload will copy settings from another Sound Emitter, or if it’s a prop, just copy the model.
  • Known Bug: Volume does not appear to work, I left it in anyways.

Features:

  • Uses 1 Numpad key
  • Changeable model
  • 44 Preset Sounds
  • You can specify your own sound effect (will override preset sound)
  • Options for Length, Loop, Delay, Toggle, Activate on Damage, Toggle on Damage (if Activate on Damage is on)
  • Pitch and Volume controls for sounds with a direct filepath (not using the sound.name format)

Usage:
Left Click: Weld and Create
Right Click: Create
Reload: Copy any props’ model
Use Key: Start sound

Pics!
[img_thumb]http://s3.garrysmod.org/img/dl/99297_1.jpg[/img_thumb]

Download:
http://www.garrysmod.org/img/?t=dll&id=99297

Extra Sounds Addon (by Vindale)
http://www.garrysmod.org/img/?t=dll&id=30385

Installation

  1. Place in your addons folder.
  2. Extract (Right-Click -> Extract to Here)
  3. Play GMod!

Quick FAQ

Why don’t some of the sounds work?:
Some of the sounds provided require Episode 1 or Episode 2 for you to hear them.

To add custom sounds to the Preset Sounds list:

***** CLIENTSIDE *****
You can make a file with a .lua extension and place it in your “lua/autorun/client” folder located in your GMod base folder.
The full Location should be something like: “C:/Program Files/Valve/Steam/steamapps/<YourSteamName>/garrys mod/garrysmod/lua/autorun/client”.

***** SERVERSIDE *****
If you want others to have your list while on your server place the file in the “lua/autorun/server” folder instead.
To make joining players download your custom sounds use resource.AddFile()
Otherwise only you can hear your custom sounds.

***** FOR BOTH *****
Use this code in your new Lua file to add your own sounds to the Preset Sounds list:[lua]list.Set( “MVSoundEmitterSound”, “Name of Sound”, { mv_soundemitter_sound = “PathToSound”, mv_soundemitter_length = 10})[/lua]


People will not be able to hear your sounds unless they have them too!

Here are some examples on how to use it:[lua]list.Set( “MVSoundEmitterSound”, “[SFX - Doors] Big Mechanical”, { mv_soundemitter_sound = “doors/doormove1.wav”, mv_soundemitter_length = 5.53} )
list.Set( “MVSoundEmitterSound”, “[SFX - Doors] Airlock Open”, { mv_soundemitter_sound = “doors/doormove2.wav”, mv_soundemitter_length = 1.38} )
list.Set( “MVSoundEmitterSound”, “[SFX - Doors] Airlock Close”, { mv_soundemitter_sound = “doors/doormove3.wav”, mv_soundemitter_length = 1.57} )
list.Set( “MVSoundEmitterSound”, “[VOX] ‘Ammunition Depleted’”, { mv_soundemitter_sound = “HL1/fvox/ammo_depleted.wav”, mv_soundemitter_length = 2.05} )
list.Set( “MVSoundEmitterSound”, “[VOX] ‘Evacuate Area’”, { mv_soundemitter_sound = “HL1/fvox/evacuate_area.wav”, mv_soundemitter_length = 2.11} )
list.Set( “MVSoundEmitterSound”, “[VOX] ‘Immediately’”, { mv_soundemitter_sound = “HL1/fvox/immediately.wav”, mv_soundemitter_length = 1.25} )
list.Set( “MVSoundEmitterSound”, “[SFX - Atmosphere] Plaza”, { mv_soundemitter_sound = “ambient/atmosphere/plaza_amb.wav”, mv_soundemitter_length = 9.84} )
list.Set( “MVSoundEmitterSound”, “[SFX - Atmosphere] Thunder 1”, { mv_soundemitter_sound = “ambient/atmosphere/thunder3.wav”, mv_soundemitter_length = 8.4} )
list.Set( “MVSoundEmitterSound”, “[SFX - Atmosphere] Thunder 2”, { mv_soundemitter_sound = “ambient/atmosphere/thunder4.wav”, mv_soundemitter_length = 8.12} )
/* Please note that all the sounds listed above come with Half-Life 2 */[/lua]

mv_soundemitter_sound
This should be set to the pathname and filename of the sound you want RELATIVE to the sound directory.
Your sound directory is located here:
“…/steamapps/<username>/garrysmod/garrysmod/sound”

mv_soundemitter_length
This is how long the sound is in seconds. This is used to enable looping for sounds that don’t loop by default.

Enjoy, and please leave comments.

-Major

testing it right now.

If it works…everyone will have sounds on their machines :frowning:

I forgot to mention that pressing your Use key on it will do the same as pressing the assigned Numpad key.

Ok well not bad. But pitch didn’t seem to work. I don’t know what you mean with “not using the sound.name format” , but i tried most and it didn’t do anything. When i turned it on it just had a random pitch it seemed.

No wire support. Not that i am a wire only person, but without wire you can’t use it for sounds on for example tanks.

I placed one, the sound directory was some how named WWWWWWWWWW even though I had nothing in the text box, and I jumped up and down on it and it crashed my gmod. :frowning:

I have no idea what happened to you. let me know is this happens again and tell me exactly what happened and what you were trying to do.

Hey, how do I add my own music to this? By the way, I have been looking for something like this, you rock.

Using lua you can do this:
[lua]list.Set( “MVSoundEmitterSound”, “Name of Sound”, { mv_soundemitter_sound = “PathToSound”, mv_soundemitter_length = 10})[/lua]

mv_soundemitter_sound should be the path to your music
mv_soundemitter_length is how long the sound is in seconds.

Using the lua method it will add your sounds/songs to the PresetSounds listbox

The other way is to just type the path to the song/music in the Custom Sound box. The downside to this method is that your sound is not saved anywhere.

All of the default sounds in the presets list use the sound.name format. To use pitch and volume you need to use the Custom Sound box and type in something like “items/battery_pickup.wav” or “weapons/rpg/rocket1.wav”. However using “ItemBattery.Touch” or “Missile.Accelerate” will not allow you to use the Pitch and Volume settings. This is something that cannot be changed with lua.

Meh, I am confused, do i add that to the preset list?

Where do i install it its not working for me…

Awesome, but where would one put that code?
I still don’t know anything about Lua.

This is just what I need, thanks!

sawbuc: It’s zipped in standard addon format. Just place the .zip file in your addons folder, right click and tell it to “Extract to Here”

Apostrophe: You can make a file with a .lua extension and place it in your “lua\autorun\client” folder located in your GMod base folder.
The full Location should be something like: “C:\Program Files\Valve\Steam\steamapps&lt;YourSteamName>\garrysmod\garrysmod\lua\autorun\client”.
If the autorun or client folders don’t exist you can make them yourself.

Awesome. Thanks.
Going to test it out now. :slight_smile:
Edit: If I put the song(s) in the “Sounds” folder, in Garrysmod, what would I type to point it to that folder? Just “garrysmod\sounds” or would I have to do the whole "C:\Program Files\Valve\Steam…"etc. nonsense?
Forgive my ignorance.

GMod searches for sounds relative to the Sounds folder.
If your sound is right inside the sounds directory then just use the name of the sound file.
If it’s in a folder then you need to include the folder’s name. (ex: mycustomsounds/bestfartever.wav)

Also make a forced download on custom sounds if you want people to hear them.
Otherwise it’s just yourself.

Nice work!

Probably in the Addons folders :slight_smile:

Don’t work for me at all. can’t hear the sounds

I can’t even see it in the spawn menu, despite installing to addons. :frowning: