Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Bug: soundentry_version 2 soundscript parameter makes sounds unable to stop

Open TheEnderek0 opened this issue 1 year ago • 6 comments

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

  1. Open a map with a sound that uses distvar
  2. Play the sound
  3. Try to stop the sound
  4. 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

TheEnderek0 avatar Feb 16 '24 19:02 TheEnderek0

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

JJL772 avatar Feb 24 '24 05:02 JJL772

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).

TheEnderek0 avatar Feb 24 '24 15:02 TheEnderek0

"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.

TheEnderek0 avatar Feb 24 '24 15:02 TheEnderek0

But with these operator stacks the sound doesn't get influenced by distvariant now

TheEnderek0 avatar Feb 24 '24 15:02 TheEnderek0

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

TheEnderek0 avatar Mar 04 '24 17:03 TheEnderek0

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

JJL772 avatar Mar 04 '24 17:03 JJL772