Bug: soundentry_version 2 soundscript parameter makes sounds unable to stop
Describe the bug
When you use distvariant in a sound(script) after starting the sound you won't be able to stop it using StopSound (if playing via an ambient_generic).
To Reproduce
- Open a map with a sound that uses distvar
- Play the sound
- Try to stop the sound
- Experience the bug
Issue Map
Any map that has an ambient_generic or any sound emitting entity that emits a sound with this parameter Check https://github.com/StrataSource/sample-content
Expected Behavior
You should be able to stop the sound
Operating System
No response
Is this due to the distvariant parameter or the ^ distvariant sound char, which defines how th sound should be spatialized? I don't think any of my changes to add distvariant could have caused this
Huh, it's only when I specify soundentry_version 2. It seems that this is the problem, when I comment it out the sound can be stopped now. (Ofc the distvariant also doesn't work, but I've tested it without distvariant and with soundentry version and the problem was also there).
"operator_stacks" {
"update_stack" {
"import_stack" "update_music_stereo"
"volume_lfo_time_scale"
{
"input2" "0.05"
}
"volume_lfo_scale"
{
"input2" "0.35"
}
"volume_fade_out"
{
"input_max" "4.0"
}
}
}
When I add these operator stacks the looping sound can now be properly stopped (this was copied over from Portal 2's music soundscripts. It seems maybe that the game needs these to stop the sound properly, I'm not sure since operator stacks lack documentation a lot.
But with these operator stacks the sound doesn't get influenced by distvariant now
I've done some testing again, and it seems that the sound stops properly if I specify just this:
"operator_stacks" {
"stop_stack" {
}
}
It doesn't even need to include a stack, the sound stops properly now
Sorry for the delay looking into this. I presume soundentry_version 2 hands off some management to the sound operators system, but I need to confirm. Likely a way to maintain backwards compatibility with older sound scripts