ai_sound
Code classes:
CAISound
CPointEntity
CBaseEntity
(all ents)
ai_sound
is a point entity present in all Source games. This entity makes sounds or smells that can be sensed by NPCs, but not by the player. This can be used to cause reactions in nearby NPCs. An entity called soundent
appears to help with managing AI sounds when the game runs.
Keyvalues[edit | edit source]
- Volume
(volume)
<integer>
- How far away this sound can be heard. Visualized in Hammer by the yellow sphere/circle.
- Duration
(duration)
<float>
- How long the sound persists each time it plays.
- Location Proxy
(locationproxy)
<target_destination>
- If you specify an entity here, the sound will be made at that entity's location. (
!player
is an option.) By default, the sound will play from the origin of theai_sound
. - Sound Type
(soundtype)
<choices>
- The type of sound or smell will determine the reaction of NPCs that sense it. Some of these are not in the FGD, so their associated number must be typed manually. If the associated numbers are added together, both effects will apply to the sound.
- Note: All FGDs that have this entity (Half-Life 2, Alien Swarm, Portal 2) and public code repositories (Half-Life 2, Alien Swarm) were checked in the making of this list.
Literal Value | Name | Effects |
---|---|---|
0 | Select one | Don't use this. It's nothing. |
1 | Combat | NPCs turn to face the sound. Might bring NPCs out of actbusies or other AI routines if the origin is not something they like. Picked up by env_microphone .
: Gets attention of advisors, Alyx, antlion guards Barney, birds, Combine soldiers, Grigori, hunters, metrocops, scanners and vortigaunts (Episodic). Interrupts idle speech and behavior. In Episodic, Alyx may flinch upon hearing this. |
2 | World | Picked up by env_microphone .
: Gets attention of advisors, Alyx, antlion guards, Barney, birds, Combine soldiers, Grigori, hunters, metrocops, scanners, and vortigaunts (Episodic). |
4(Not in FGD) | Player | Picked up by env_microphone .
: Gets attention of advisors, Alyx, antlion guards, Barney, birds, Combine soldiers, Grigori, hunters, metrocops, scanners, and vortigaunts (Episodic). |
8 | Danger | : Gets attention of advisors, Alyx, antlions, antlion guards, Barney, birds, Combine soldiers, Grigori, headcrabs, hunters, metrocops, scanners, snipers, and vortigaunts (Episodic). |
16 | Bullet Impact | Might bring NPCs out of actbusies or other AI routines if the origin is not something they like. Picked up by env_microphone .
: Gets attention of Alyx, Barney, Combine soldiers, headcrabs, hunters, metrocops, and vortigaunts (Episodic). |
32 | Carcass (scent) | No effect. |
64 | Meat (scent) | No effect. |
128 | Garbage (scent) | No effect. |
256 | Thumper | : Distracts and repels antlions. |
512(Not in FGD) | Bugbait | : Attracts antlions. |
1024(Not in FGD) | Physics danger | : Gets attention of antlions, Combine soldiers, hunters, and metrocops. |
2048(Not in FGD) | Sniper danger | : Scares snipers into hiding. |
4096 | Move Away | : Gets attention of Alyx, Barney, Combine soldiers, hunters, metrocops, and vortigaunts (Episodic). |
8192(Not in FGD) | Player vehicle | : Gets attention of hunters and metrocops. |
16384 | Readiness - Low | : Alyx, Barney, and vortigaunts (Episodic) will appear relaxed. |
32768 | Readiness - Medium | : Alyx, Barney, and vortigaunts (Episodic) will appear alert. |
65536 | Readiness - High | : Alyx, Barney, and vortigaunts (Episodic) will appear agitated and ready to fight immediately. |
- Additional sound context (optional)
(soundcontext)
<choices>
- Optional settings specifying such things as who can or cannot hear the sound. As with Sound Type, if the associated numbers are added together, both effects will apply to the sound. Many of these are not in the FGD and some of them have not been fully tested. To do: It's unknown if the Alien Swarm ones are available in any other games before or after it. Currently, this is believed to be all
ai_sound
properties across all games.
Literal Value | Name | Effects |
---|---|---|
0 | Select one | Don't use this. It's nothing. |
1048576(Not in FGD) | From sniper | NPCs react to the cause of the sound (ai_sound ) instead of the location where it happened (Location Proxy).
: Alyx, Barney, and vortigaunts (Episodic) will speak any |
2097152(Not in FGD) | Gunfire | : Gets attention of Alyx (Episodic). |
4194304(Not in FGD) | Mortar | : Emitted by a mortarshell . Alyx, Barney, and vortigaunts (Episodic) will avoid this sound.
|
8388608 | Only Combine hear | : Does not necessarily get the attention of Combine soldiers, but can only be heard by them. |
16777216(Not in FGD) | React to source | NPCs react to the cause of the sound (ai_sound ) instead of the location where it happened (Location Proxy). This context is given by NPCs like hunters which are capable of shooting long distances.
|
33554432(Not in FGD) | Explosion | Picked up by env_microphone .
: In Episodic, Alyx may flinch upon hearing this. |
67108864 | Combine cannot hear | : Combine soldiers do not hear this sound. |
134217728(Not in FGD) | Danger approach | : This sound is a danger sound that is progressively getting closer. Combine soldiers turn to face it if nothing else is distracting them. |
268435456(Not in FGD) | Allies only | : Emitted by barnacles, but nothing reacts to this context. |
536870912(Not in FGD) | Player vehicle | : Sound comes from a vehicle. Hunters will prepare to dodge. |
1073741824(Not in FGD) | From fire | Unused. |
2147483648(Not in FGD) | Follow owner | NPCs react to the cause of the sound (ai_sound ) instead of the location where it happened (Location Proxy).
|
Inputs[edit | edit source]
- EmitAISound
- Make the sound.
InsertSound<integer>
- Do not use. This input does not transfer sound contexts.