Jump to content
Mr. Green Gaming

Sound Emitter "Volume"


Ashley

Recommended Posts

Hi;

I fooled around a little creating all sorts of stereo systems, jukeboxes, turn tables, mixer panels and even full stages in Garry's Mod Sandbox for manipulating mp3 files; but I still haven't managed to create a contraption able to manipulate the Volume control of Sound Emitters to properly create fade effects

http://www.xfire.com/video/3b0769/

Yesterday I created this very simple system using a slider button controlled by GPS & Inclusive/Equal gates; I figured out the Volume range is "0" at 0.009999 and "1" at 0.01; so I just can't figure out the correct values to use to wire a Sound Emitters "Volume" output so it correctly fades from loud to off

Any help would be appreciated

Ashley

Link to comment

That's pretty damn nice. I don't know much about wire, at all.

But I do a lot about GLua programming. As far as I know GMod and Source can't manipulate mp3 file playback directly (only start / stop), so I figure that for the speeding up / slowing down you showed there's already some sort of module being used.

But that's just the technical talk, I really don't know how to do volume control in that sort of system or if it's possible at all :V:

Link to comment

I figured out the Volume range is "0" at 0.009999 and "1" at 0.01;

Apparently, this is the cause for the strange range @ Volume:

local volume = math.Clamp(math.floor(value*100),0,100)
self.Volume = volume

self.SND:ChangeVolume(volume)

That's in addons folder or GMod folder, depending on where you installed it -> "wire\lua\entities\gmod_wire_soundemitter\init.lua" -- Line 112;

You could easily change this line "local volume = math.Clamp(math.floor(value*100),0,100)" to "local volume = math.Clamp( value,0,1 )" so you have your "normal" range back, however I'm not sure if this affects other mechanisms. Worth a try :V

Link to comment

I figured out the Volume range is "0" at 0.009999 and "1" at 0.01;

Apparently, this is the cause for the strange range @ Volume:

local volume = math.Clamp(math.floor(value*100),0,100)
self.Volume = volume

self.SND:ChangeVolume(volume)

That's in addons folder or GMod folder, depending on where you installed it -> "wire\lua\entities\gmod_wire_soundemitter\init.lua" -- Line 112;

You could easily change this line "local volume = math.Clamp(math.floor(value*100),0,100)" to "local volume = math.Clamp( value,0,1 )" so you have your "normal" range back, however I'm not sure if this affects other mechanisms. Worth a try :V

Well one thing I'm very strict about along with hundreds of other "serious" WireMod "engineers" is that coding in expression2 or changing files is an absolute nono - everything that we want to accomplish has to be done by default wiremod options bar Expression2, to create as realistic devices possible without spoiling it

Re-coding lua or using Expression2 is just fooling yourself in my opinion; where creativity counts - so I'm looking for already available output/input value options to accomplish this; which either is possible or isn't

Link to comment

Well one thing I'm very strict about along with hundreds of other "serious" WireMod "engineers" is that coding in expression2 or changing files is an absolute nono - everything that we want to accomplish has to be done by default wiremod options bar Expression2, to create as realistic devices possible without spoiling it

Re-coding lua or using Expression2 is just fooling yourself in my opinion; where creativity counts - so I'm looking for already available output/input value options to accomplish this; which either is possible or isn't

That is seriously one of the most pointless things I've ever heard. Did the developer declare his code holy or something? If something doesn't work and you can fix it, just do it. There's this great little ctrl+z key combination if it fucks things up.

Link to comment

That's not the issue; the issue is that there are basically a few kinds of WireMod builders; one large group of builders gets a kick out of coding the most impressive things by re-coding LUA or putting everything in an expression2 chip - but an even larger group doesn't see the fun in that.

Maybe to you it sounds pointless not to - but to us it seems pointless to just code whatever we want to get out of a sandbox game; where for us the fun lies within creativity using presented options with basic wiremod and the source game itself.

It's about what we find the most fun; I personally find it more fun to try and accomplish something that seems impossible after spending countless of hours building chipboards with over 100 chips; someone else finds it more fun to just create an entity in LUA - they're two entirely different games to play; I choose the first

That's pretty damn nice. I don't know much about wire, at all.

But I do a lot about GLua programming. As far as I know GMod and Source can't manipulate mp3 file playback directly (only start / stop), so I figure that for the speeding up / slowing down you showed there's already some sort of module being used.

Also the speeding up/slowing down is just pitch control which can be manipulated using the PitchRelative (5th) output on the Sound emitters; already default with WireMod; so no other module did that for me

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...