Speech semaphore: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(Added see Also)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''speech semaphore''' restricts talkers' ability to talk.
The '''speech semaphore''' restricts talkers' ability to talk.


By default, there are two semaphores: friendlies & foes (based on <code>IsPlayerAlly</code>).  See <code>GetSpeechSemaphore</code> in <code>ai_speech.h</code>
By default, there are two semaphores for [[NPC]]: friendlies & foes (based on <code>IsPlayerAlly</code>).  See <code>GetSpeechSemaphore</code> in <code>ai_speech.h</code>


If <code>UseSemaphore</code> returns true, only one friendly and one foe is allowed to talk at a time.
If <code>UseSemaphore</code> returns true, only one friendly and one foe is allowed to talk at a time.
Line 8: Line 8:
{{note|Any interrupted talkers will continue to talk.}}
{{note|Any interrupted talkers will continue to talk.}}


[[Category:AI]][[Category:Glossary]]
==See Also==
* [[Player Ally]]
* {{ent|ai_ally_speech_manager}}
* {{ent|ai_speechfilter}}
* [[Sentences]]
 
[[Category:AI Programming]]
[[Category:AI]]
[[Category:Choreography]]
[[Category:Level Design]]
[[Category:Glossary]]

Latest revision as of 18:26, 30 November 2025

The speech semaphore restricts talkers' ability to talk.

By default, there are two semaphores for NPC: friendlies & foes (based on IsPlayerAlly). See GetSpeechSemaphore in ai_speech.h

If UseSemaphore returns true, only one friendly and one foe is allowed to talk at a time.

If UseSemaphore returns false (whether based entirely on code or on spawnflags), the talker can interrupt other talkers.

Note.pngNote:Any interrupted talkers will continue to talk.

See Also