This article relates to the game "Counter-Strike: Global Offensive". Click here for more information.
This article relates to the game "Counter-Strike: Source". Click here for more information.

Point surroundtest: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (removed {{DISPLAYTITLE}}, covered by the base point multi template)
No edit summary
 
(21 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{base point multi|point_surroundtest|game1=Counter-Strike: Source|game2=Counter-Strike: Global Offensive}}
{{LanguageBar}} {{CSS topicon}} {{CSGO topicon}}
{{Ent not in fgd}}
{{CD|CSurroundTest|file1=point_surroundtest.cpp|nolink=1}}
{{this is a|logical entity|name=point_surroundtest|game=Counter-Strike series|game1=Left 4 Dead series}} It identifies the server host's currently used speaker configuration setting by checking the {{Ent|snd_surround_speakers}} command's value. When given the<code>FireCorrectOutput</code>input, an unique output is returned depending only on the following speaker configurations:
* 2 Speakers (and Headphones Only)
* 4 Speakers
* 5.1 Sound System


==Entity description==
{{note|Also available in {{l4d}} [[Left 4 Dead]] and {{l4d2}} [[Left 4 Dead 2]], but {{Not in FGD}}. See [[#FGD Code|FGD Code]] for these games.}}
This entity reads the audio settings in the properties menu. It identifies the number of selected speakers (2 Speakers, 4 Speakers, 5.1 Sound System) and can fire an output.


==Keyvalues==
== Keyvalues ==
{{KV Targetname}}
{{KV Targetname}}


==Inputs==
== Inputs ==
{{I Targetname}}
{{I|FireCorrectOutput|Fires an output based on the current speaker configuration.}}
{{IO|FireCorrectOutput|Fires an output to the correct number of speakers.|}}


==Outputs==
== Outputs ==
{{O Targetname}}
{{O|On2Speakers|ac-is-self=1|Fires an output if either '2 Speakers 'or 'Headphones only' are selected.}}
{{IO|On2Speakers|Fires an output if 2 Speakers are selected.|}}
{{O|On4Speakers|ac-is-self=1|Fires an output if '4 Speakers' is selected.}}
{{IO|On4Speakers|Fires an output if 4 Speakers are selected.|}}
{{O|On51Speakers|ac-is-self=1|Fires an output if '5.1 Sound System' is selected.}}
{{IO|On51Speakers|Fires an output if a 5.1 Sound System is selected.|}}
 
== FGD Code ==
This is a copy of the [[FGD]] code found in {{css}} and {{csgo}}, and is only here for {{l4d}} and {{l4d2}}.
<pre>
@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."
]
</pre>

Latest revision as of 07:48, 29 April 2025

English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the Left 4 DeadLeft 4 Dead 2 FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CSurroundTest
CPointEntity
CBaseEntity
C++ point_surroundtest.cpp

point_surroundtest is a logical entity available in Counter-Strike seriesCounter-Strike series Counter-Strike series and Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series. It identifies the server host's currently used speaker configuration setting by checking the snd_surround_speakers command's value. When given theFireCorrectOutputinput, an unique output is returned depending only on the following speaker configurations:

  • 2 Speakers (and Headphones Only)
  • 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

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

FireCorrectOutput
Fires an output based on the current speaker configuration.

Outputs

On2Speakers
!activator = !caller = this entity
Fires an output if either '2 Speakers 'or 'Headphones only' are selected.
On4Speakers
!activator = !caller = this entity
Fires an output if '4 Speakers' is selected.
On51Speakers
!activator = !caller = this entity
Fires an output if '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."
]