Jump to content

Chainsaw sound


Zorgman

Recommended Posts

Posted

Hi guys,

I need to disable the chainsaw sound on my server (long story short, I use it as an invisible weapon for a zombie special attack and I cannot have them buzz around :) ). I did just so using setWorldSoundEnabled, but to my surprise the vehicle engine sounds are composite and use the chainsaw sound file themselves. So I also (partially) lost the engine sound for Sanchez, Picador, Seasparrow and probably many more vehicles that I did not test yet.

Is there any way to disable the sound selectively so it does not affect the vehicles?

Thanks!

BHgi29I.png
  Dystopia alpha 0.75
DOWNLOAD

  • Moderators
Posted

Did you disable the entire group or just a sound of the group?

bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable )

If the exact same sound is disabled(not a group of sounds) then you can not. (except if you create an overwrite of all the vehicles)

 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted (edited)

I disabled three individual sounds from one group, to be precise.

setWorldSoundEnabled(40,1,false)
setWorldSoundEnabled(40,0,false)
setWorldSoundEnabled(40,2,false)

In the vehicles case, these sounds are used after the initial acceleration stage. I cannot see a way to properly add them back (with getElementVelocity on a loop maybe, but sounds messy and the trigger point would probably have to be different for each vehicle), unless I just make a 3D sound play for as long as the engine is on.

Thanks for your reply!

Edited by Zorgman

BHgi29I.png
  Dystopia alpha 0.75
DOWNLOAD

  • Moderators
Posted

Maybe you can base it on the current gear: https://wiki.multitheftauto.com/wiki/GetVehicleCurrentGear


To be honest it will be a lot of work, I personally do not recommend it unless it is a very important detail.

  • Thanks 2

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

The zombie attack detail is more important, and I wouldn't invest too much time in the vehicle sounds, I ain't running a racing gamemode afterall :) I'll just attach the 3D sound and I'll tie the volume to the vehicle gear using the function you showed above, for a bit of variation.

Thanks a lot!

BHgi29I.png
  Dystopia alpha 0.75
DOWNLOAD

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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