Point surroundtest

From Valve Developer Community
Revision as of 13:41, 31 May 2021 by Orinuse (talk | contribs) (removed invalid parameter from O_BaseEntity; Removed some newlines)
Jump to navigation Jump to search

Template:Base point multi. It identifies the server host's currently used speaker configuration setting by checking thesnd_surround_speakerscommand's value. When given theFireCorrectOutputinput, an unique output is returned depending only on the following speaker configurations:

  • 2 Speakers
  • 4 Speakers
  • 5.1 Sound System
Note.pngNote:Also available in Left 4 Dead Left 4 Dead and Left 4 Dead 2 Left 4 Dead 2, but !FGD. See FGD Code for these games.

Keyvalues

Inputs

FireCorrectOutput
Fires an output based on the current speaker configuration.

Outputs

On2Speakers
Fires an output if 2 Speakers are selected.
On4Speakers
Fires an output if 4 Speakers are selected.
On51Speakers
Fires an output if a 5.1 Sound System is selected.

FGD Code

This is a copy of the FGD code found in Counter-Strike: Source and Counter-Strike: Global Offensive, and is only here for Left 4 Dead and Left 4 Dead 2.

@PointClass base(Targetname) size(-8 -8 -8, 8 8 8) = point_surroundtest
	: "Surround Sound Test"
[
	input FireCorrectOutput(void)	: "Fire output based on snd_surround_speaker cvar value"
	output On2Speakers(void)	: "Fired if player is using 2 speakers."
	output On4Speakers(void)	: "Fired if player is using 4 speakers."
	output On51Speakers(void)	: "Fired if player is using 5.1 speakers."
]