Deadlyforce Posted February 10, 2016 Share Posted February 10, 2016 When walking, it sounds like I have 20 LB boots on. I don't see a way to lower the footsteps sound like on other sounds. Anyone know how I make the sound softer? Thanks Quote Link to comment Share on other sites More sharing options...
Nexerade Posted February 10, 2016 Share Posted February 10, 2016 I am also interested in. Quote I am not silly. My english is just not really great. T_T But I'm learning! Link to comment Share on other sites More sharing options...
Brutile Posted February 10, 2016 Share Posted February 10, 2016 You can lower the volume using this http://www.leadwerks.com/werkspace/page/api-reference/_/source/sourcesetvolume-r318 Quote Link to comment Share on other sites More sharing options...
Deadlyforce Posted February 11, 2016 Author Share Posted February 11, 2016 I could not get it to work. Kept getting a nil value error using it in the FPSPlayer.lua Quote Link to comment Share on other sites More sharing options...
macklebee Posted February 11, 2016 Share Posted February 11, 2016 I could not get it to work. Kept getting a nil value error using it in the FPSPlayer.lua Well you can only lower the volume of a source. The footsteps are just being played as a sound and not a source. But you can make some minor additions to the script to use a source to play the footstep sounds. In the Script:Start function: ... ... self.sound.footsteps.concrete.step[4] = Sound:Load("Sound/Footsteps/Concrete/step4.wav") self.sound.footsteps.concrete.jump = Sound:Load("Sound/Footsteps/Concrete/jump.wav") self.source = Source:Create() --add this and in the Script:UpdateFootsteps() function, change the end of the code to look like this: ... ... if t-self.lastfootsteptime>repeatdelay then self.lastfootsteptime = t local index = math.random(1,4) --self.sound.footsteps.concrete.step[index]:Play() --commented out self.source:SetSound(self.sound.footsteps.concrete.step[index]) --added self.source:SetVolume(0.05) --added self.source:Play() -- added end Keep in mind you will need to create sources for the other sounds being played for Jump, damage, etc... if you want to control their volume. 2 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Deadlyforce Posted February 11, 2016 Author Share Posted February 11, 2016 That worked great, you are a life safer!! Question for you, how did you learn this? What's a "good" book should I read to learn LUA? I don't mind asking questions but don't want to be a pain in the ***. Thanks again for the help. Quote Link to comment Share on other sites More sharing options...
Brutile Posted February 11, 2016 Share Posted February 11, 2016 All this is in the API. It's rather well documented, although some of the names of things are a little confusing. I can't say for Macklebee, but I just read the API to find an example, then use the example in my own code. It's also partly experience. I learnt everything by experimenting and looking at examples. Quote Link to comment Share on other sites More sharing options...
Brutile Posted February 11, 2016 Share Posted February 11, 2016 Keep in mind you will need to create sources for the other sounds being played for Jump, damage, etc... if you want to control their volume. You don't necessarily need to have multiple sources. You could just use the SetSound function and change which sound to play. Not sure if this would cut off the sound if there was already one playing though. Quote Link to comment Share on other sites More sharing options...
macklebee Posted February 11, 2016 Share Posted February 11, 2016 You don't necessarily need to have multiple sources. You could just use the SetSound function and change which sound to play. Not sure if this would cut off the sound if there was already one playing though. True, but that is exactly why I suggested to make multiple sources. If its ambient music and only one should play in any given area or time then yes you can use the same source. But one source for all of your sounds will result in cutoff and only one sound playing at a time. window = Window:Create() context = Context:Create(window) sound = {} sound[1] = Sound:Load("Sound/Ambient/submarineroom03.wav") sound[2] = Sound:Load("Sound/Doors/fdn_door_automatic_servo_driven_close_short_05.wav") sound[3] = Sound:Load("Sound/Machinery/fdn_lift_apartments_lift_travelling.wav") choice = 1 source = Source:Create() source:SetSound(sound[choice]) source:Play() while window:KeyDown(Key.Escape)==false do if window:Closed() then return false end if window:KeyHit(Key.Space) then choice = choice + 1 if choice>3 then choice = 1 end source:SetSound(sound[choice]) source:Play() end Time:Update() context:Sync(true) end Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
ocean Posted May 24, 2016 Share Posted May 24, 2016 Coding isn't exactly my forte, but I really want to learn. I'm confused. So, self.source = Source:Create() Must be added to every sound loaded, or just once, because it's one player controller that emits the sound? Does anyone have a modified FPSPlayer.lua I can look over and perhaps learn from? Quote Ubuntu 14.04 / 64bit. Dell XPS430, Intel Core 2 Quad Q8300 @ 2.50GHz, 4Gb Ram, Radeon HD 6670, Leadwerks Pro edition (Steam). Link to comment Share on other sites More sharing options...
ocean Posted May 24, 2016 Share Posted May 24, 2016 Hey! I actually managed to make it work all by my lonesome. Posting the script here for reference. Had to remove the [index] from the jump sound, but I assume that's because there's only a single sound for that event(?) FPSPlayer.lua Quote Ubuntu 14.04 / 64bit. Dell XPS430, Intel Core 2 Quad Q8300 @ 2.50GHz, 4Gb Ram, Radeon HD 6670, Leadwerks Pro edition (Steam). Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.