Open ghost opened 9 years ago
Once again, are we talking about soundSCRIPTS or soundSCAPES? You should rename all your open threads to clarify this.
soundSCAPE. Always confuse the two.
nonononon, let me clarify, what sound.Add does is soundSCRIPTS. What you seem to want is soundSCAPES which is not sound.Add is.
You can open scripts/ folder of any source engine game and see soundscripts which only have what sound.Add allows and then there are soundscapes which has all the playrandom & playlooping stuff.
This is a confusing mess, isn't it now?
Tell you what, try putting your soundscape file into the .bsp and try loading it with http://wiki.garrysmod.com/page/sound/AddSoundOverrides
Added scripts/soundscapes_degenerate.txt (and soundscapes_degenerate.txt to be safe) to the bsp, and loaded it with sound.AddSoundOverrides in my file autorun/client/soundscapes.lua
sound.AddSoundOverrides( "scripts/soundscapes_degenerate.txt" )
Soundscape txt:
"degenerate_outdoors_storm"
{
"playlooping"
{
"volume" "1"
"pitch" "100"
"wave" "ambient/weather/rumble_rain_nowind.wav"
}
"playrandom"
{
// time, volume, pitch, attenuation are all random intervals ( i.e. minval, maxval )
// every 4 to 7 seconds
"time" "8, 14"
// at a volume of 1 (%100)
"volume" "1"
// at a pitch of 100
"pitch" "120"
// play one of these .wav files randomly each time
"rndwave"
{
"wave" "ambient/atmosphere/thunder1.wav"
"wave" "ambient/atmosphere/thunder2.wav"
"wave" "ambient/atmosphere/thunder3.wav"
"wave" "ambient/atmosphere/thunder4.wav"
}
}
}
When calling up degenerate_outdoors_storm using an env_soundscape, it did not play.
Ok, I looked into the soundscape file loading, try PakRat'ing scripts/soundscapes_gm_degenerate.txt
into your map. The important bit is the gm_
part.
According to the code, it loads scripts/soundscapes_<exact_map_name>.txt
from the filesystem. If that doesn't work, try putting scripts/soundscapes_gm_degenerate.txt
into garrysmod folder where you'd put the manifest file.
Let me know the results.
Packing it into the map with the new name didn't work. What do you mean by "manifest" format? I did have it in scripts.
In your .bsp:
scripts/soundscapes_gm_degenerate.txt
"degenerate_outdoors_storm"
{
"playlooping"
{
"volume" "1"
"pitch" "100"
"wave" "ambient/weather/rumble_rain_nowind.wav"
}
"playrandom"
{
// time, volume, pitch, attenuation are all random intervals ( i.e. minval, maxval )
// every 4 to 7 seconds
"time" "8, 14"
// at a volume of 1 (%100)
"volume" "1"
// at a pitch of 100
"pitch" "120"
// play one of these .wav files randomly each time
"rndwave"
{
"wave" "ambient/atmosphere/thunder1.wav"
"wave" "ambient/atmosphere/thunder2.wav"
"wave" "ambient/atmosphere/thunder3.wav"
"wave" "ambient/atmosphere/thunder4.wav"
}
}
}
Alright, that worked flawlessly. Thanks for putting up with me this long >.>
Read the latest command if you get troubles with custom soundscapes or custom particles https://github.com/Facepunch/garrysmod-issues/issues/3314
Without packing to BSP or whitelist soundscape files🫤
There's no way to package a .txt soundscape file with an addon, and so I think there should be some other way to create a custom soundscape, perhaps with lua.