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 .
|
2 | World | Picked up by env_microphone .
|
4(Not in FGD) | Player | Picked up by env_microphone .
|
8 | Danger | ![]() ![]() |
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 .
|
32 | Carcass (scent) | No effect. |
64 | Meat (scent) | No effect. |
128 | Garbage (scent) | No effect. |
256 | Thumper | ![]() |
512(Not in FGD) | Bugbait | ![]() |
1024(Not in FGD) | Physics danger | ![]() |
2048(Not in FGD) | Sniper danger | ![]() |
4096 | Move Away | ![]() ![]() |
8192(Not in FGD) | Player vehicle | ![]() |
16384 | Readiness - Low | ![]() ![]() |
32768 | Readiness - Medium | ![]() ![]() |
65536 | Readiness - High | ![]() ![]() |
- 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).
|
2097152(Not in FGD) | Gunfire | ![]() ![]() |
4194304(Not in FGD) | Mortar | ![]() mortarshell . Alyx, Barney, and vortigaunts (![]() |
8388608 | Only Combine hear | ![]() |
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 .
|
67108864 | Combine cannot hear | ![]() |
134217728(Not in FGD) | Danger approach | ![]() |
268435456(Not in FGD) | Allies only | ![]() |
536870912(Not in FGD) | Player vehicle | ![]() |
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.