ai_sound

From Source Entities
Jump to navigation Jump to search

Code classes:

Ai sound.png

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 the ai_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.

Hl2.png: Gets attention of advisors, Alyx, antlion guards Barney, birds, Combine soldiers, Grigori, hunters, metrocops, scanners and vortigaunts (Hl2.pngEpisodic). Interrupts idle speech and behavior. In Hl2.pngEpisodic, Alyx may flinch upon hearing this.

2 World Picked up by env_microphone.

Hl2.png: Gets attention of advisors, Alyx, antlion guards, Barney, birds, Combine soldiers, Grigori, hunters, metrocops, scanners, and vortigaunts (Hl2.pngEpisodic).

4(Not in FGD) Player Picked up by env_microphone.

Hl2.png: Gets attention of advisors, Alyx, antlion guards, Barney, birds, Combine soldiers, Grigori, hunters, metrocops, scanners, and vortigaunts (Hl2.pngEpisodic).

8 Danger Hl2.png: Gets attention of advisors, Alyx, antlions, antlion guards, Barney, birds, Combine soldiers, Grigori, headcrabs, hunters, metrocops, scanners, snipers, and vortigaunts (Hl2.pngEpisodic).
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.

Hl2.png: Gets attention of Alyx, Barney, Combine soldiers, headcrabs, hunters, metrocops, and vortigaunts (Hl2.pngEpisodic).

32 Carcass (scent) No effect.
64 Meat (scent) No effect.
128 Garbage (scent) No effect.
256 Thumper Hl2.png: Distracts and repels antlions.
512(Not in FGD) Bugbait Hl2.png: Attracts antlions.
1024(Not in FGD) Physics danger Hl2.png: Gets attention of antlions, Combine soldiers, hunters, and metrocops.
2048(Not in FGD) Sniper danger Hl2.png: Scares snipers into hiding.
4096 Move Away Hl2.png: Gets attention of Alyx, Barney, Combine soldiers, hunters, metrocops, and vortigaunts (Hl2.pngEpisodic).
8192(Not in FGD) Player vehicle Hl2.png: Gets attention of hunters and metrocops.
16384 Readiness - Low Hl2.png: Alyx, Barney, and vortigaunts (Hl2.pngEpisodic) will appear relaxed.
32768 Readiness - Medium Hl2.png: Alyx, Barney, and vortigaunts (Hl2.pngEpisodic) will appear alert.
65536 Readiness - High Hl2.png: Alyx, Barney, and vortigaunts (Hl2.pngEpisodic) 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).

Hl2.png: Alyx, Barney, and vortigaunts (Hl2.pngEpisodic) will speak any TLK_DANGER concept they have, and try to shield themselves from the source. Use with Danger setting.

2097152(Not in FGD) Gunfire Hl2.png: Gets attention of Alyx (Hl2.pngEpisodic).
4194304(Not in FGD) Mortar Hl2.png: Emitted by a mortarshell. Alyx, Barney, and vortigaunts (Hl2.pngEpisodic) will avoid this sound.
8388608 Only Combine hear Hl2.png: 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.

Hl2.png: In Hl2.pngEpisodic, Alyx may flinch upon hearing this.

67108864 Combine cannot hear Hl2.png: Combine soldiers do not hear this sound.
134217728(Not in FGD) Danger approach Hl2.png: 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 Hl2.png: Emitted by barnacles, but nothing reacts to this context.
536870912(Not in FGD) Player vehicle Hl2.png: Sound comes from a vehicle. Hunters will prepare to dodge.
1073741824(Not in FGD) From fireAsw.png Unused.
2147483648(Not in FGD) Follow ownerAsw.png 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.