Speech semaphore: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎top: Unicodifying, added deadend tag)
(Added see Also)
 
Line 1: Line 1:
{{Dead end|date=January 2024}}
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 9: Line 7:
If <code>UseSemaphore</code> returns false (whether based entirely on code or on spawnflags), the talker can interrupt other talkers.
If <code>UseSemaphore</code> returns false (whether based entirely on code or on spawnflags), the talker can interrupt other talkers.
{{note|Any interrupted talkers will continue to talk.}}
{{note|Any interrupted talkers will continue to talk.}}
==See Also==
* [[Player Ally]]
* {{ent|ai_ally_speech_manager}}
* {{ent|ai_speechfilter}}
* [[Sentences]]


[[Category:AI Programming]]
[[Category:AI Programming]]
[[Category:AI]]
[[Category:Choreography]]
[[Category:Level Design]]
[[Category:Level Design]]
[[Category:Glossary]]
[[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