Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: ltschase
I would like to know how to start and stop an "ambient" sound. I was hoping that by using Nate Smith's ambient sounds method with the structs, that I could simply stop and start the sound by hiding and showing the structs, but that didn't work, so I am not sure how to do it. If you don't understand what am I wanting to do exactly, for example, I want to have the sound of a generator running, but the generator isn't always running, so the sound needs to turn on and off.
ModmeBot:
Reply By: ihmiskeho
I don't know how Nate's script works, but you could use PlayLoopSound(<sound>, fadetime) to start the sound and StopLoopSound(fadetime) to stop it.</sound>
There is info about these function (and basically about all BO3 functions) in the scriptapifunctions. That can be found in Black ops 3 root/deffiles/docs_modtools.
<h1> </h1>
ModmeBot:
Reply By: Abnormal202
ltschase
I would like to know how to start and stop an "ambient" sound. I was hoping that by using Nate Smith's ambient sounds method with the structs, that I could simply stop and start the sound by hiding and showing the structs, but that didn't work, so I am not sure how to do it. If you don't understand what am I wanting to do exactly, for example, I want to have the sound of a generator running, but the generator isn't always running, so the sound needs to turn on and off.
ModmeBot:
Reply By: Symbo
Abnormal you got me curious. StopLoopSound always worked for me. I just found this function in sound_shared.gsc that suggest you can specify the alias you want to stop instead of the fadetime.
So if anyone wanna use it, you need this using:
and you can call it just with the alias or also specify a tag if you want to:
and apparently stop the sound like this:
ModmeBot:
Reply By: ltschase
Got it working using StopLoopSound.