scripted_sentence

From Source Entities
Jump to navigation Jump to search

Code classes:

Scripted sentence.png

scripted_sentence is a point entity present in all games except the L4d.pngL4d2-small.pngLeft 4 Dead games. It plays a single line (or "sentence") from Sentences.txt from an NPC. Can be considered obsolete compared to ambient_generic and logic_choreographed_scene.

Flags[edit | edit source]

  • 1: Fire Once - Entity removes itself once the sentence is finished.
  • 2: Followers Only - Can only be spoken by NPCs following the player.
  • 4: Interrupt Speech - Interrupts non-important speech.
  • 8: Concurrent - Allows other (Confirm: friendly?) NPCs to keep talking during this sentence.
  • 16: Speak to Activator - Confirm: NPC turns to face the !activator of the BeginSentence input.

Keyvalues[edit | edit source]

Sentence Name (sentence) <string>
Sentence to say. (e.g. !COMBINE_THROW_GRENADE4)
Speaker Type (entity) <target_name_or_class>
Targetname or classname of potential speakers.
Listener Type (listener) <target_name_or_class>
Targetname or classname of an entity for the speaker to look at.[Confirm] Use !player to use the player.
Search Radius (radius) <float>
Radius that speakers and listeners (except the player) must be within.
Delay Before Refire (refire) <float>
Delay added to how long it takes OnEndSentence to fire, and how long it re-searches for speakers. If the search failed, it adds on an extra .5 seconds. If it succeeded, Additional Sentence Time is added to the delay.
Additional Sentence Time (delay) <float>
How often in seconds the entity can be activated, if it just was (added onto Delay Before Refire).
Volume 0-10 (volume) <float>
How loud to play the sentence.
Sound Radius (attenuation) <choices>
How far away from the speaker the sound travels.
  • 0: Small Radius
  • 1: Medium Radius
  • 2: Large Radius
  • 3: Play Everywhere

Inputs[edit | edit source]

BeginSentence
Begins searching for speakers, and has the first suitable NPC it finds say the line. Note: If this entity is not given a targetname, it begins searching immediately.

Outputs[edit | edit source]

OnBeginSentence
Fires when the sentence begins.
OnEndSentence
Fires when the sentence ends. Delayed by Delay Before Refire.