This article's documentation is for anything that uses the Source engine. Click here for more information.

Scripted sentence: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(-added class hierarchy, cleanup, intn)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{lang|title=scripted_sentence}}{{toc-right}}
{{LanguageBar}}
{{entity|sprite=1|scripted_sentence|type=e0|series=Half-Life 2}}
{{TabsBar|main=gs|base=scripted_sentence}}
{{Ent not in fgd}}
{{CD|CAI_ScriptedSentence|file1=1}}
{{This is a|point entity|sprite=1|name=scripted_sentence|except=Left 4 Dead series}}


==Entity description==
Creates a scripted sentence, usually spoken by an [[NPC]].
Creates a scripted sentence, usually spoken by an [[NPC]].


Line 10: Line 12:


* For dialog spoken by a non-visible NPC, like over a radio or by combine forces, you can use a simple [[ambient_generic]] entity either pointing to a raw sample, a soundscript or a scripted sentence (consisting of a combination of several samples) in the [[sentences.txt]] file.
* For dialog spoken by a non-visible NPC, like over a radio or by combine forces, you can use a simple [[ambient_generic]] entity either pointing to a raw sample, a soundscript or a scripted sentence (consisting of a combination of several samples) in the [[sentences.txt]] file.
{{clr}}


==Keyvalues==
== Keyvalues ==
{{KV Targetname}}
{{KV Targetname}}
 
{{KV|Sentence Name|intn=sentence|string|The sentence group name, as found in [[sentences.txt]].}}
{{KV|Sentence Name|float|The sentence group name, as found in [[sentences.txt]].}}
{{KV|Speaker Type|intn=entity|target_name_or_class}}
 
{{KV|Additional Sentence Time|intn=delay|float}}
{{KV|Speaker Type|target_name_or_class|}}
{{KV|Search Radius|intn=radius|float|Radius to search within for an NPC to use. A value of "0" searches everywhere in the map.}}
 
{{KV|Delay before refire|intn=refire|float|Timed delay (in seconds) before refiring.}}
{{KV|Additional Sentence Time|float|}}
{{KV|Listener Type|intn=listener|target_destination}}
 
{{KV|Volume 0-10|intn=volume|float|A volume value from 0-10.}}
{{KV|Search Radius|float|Radius to search within for an NPC to use. A value of "0" searches everywhere in the map.}}
{{KV|Sound Radius|intn=attenuation|integer choices}}
 
{{KV|Delay before refire|float|Timed delay (in seconds) before refiring.}}
 
{{KV|Listener Type|target_destination|}}
 
{{KV|Volume 0-10|float|A volume value from 0-10.}}
 
{{KV|Sound Radius|choices|}}
:{| class=standard-table
:{| class=standard-table
! Literal Value || Description
! Literal Value || Description
Line 42: Line 35:
|}
|}


==Inputs==
== Inputs ==
{{I Targetname}}
{{I|BeginSentence|Starts the scripted sentence.}}
 
{{I Parentname}}
 
{{IO|BeginSentence|Starts the scripted sentence.|}}
 
==Outputs==
{{O Targetname}}
 
{{IO|OnBeginSentence|Fires when the sentence begins.|}}


{{IO|OnEndSentence|Fires when the sentence ends.|}}
== Outputs ==
{{O|OnBeginSentence|Fires when the sentence begins.}}
{{O|OnEndSentence|Fires when the sentence ends.}}

Latest revision as of 13:49, 16 April 2025

English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the Counter-Strike: SourceDay of Defeat: SourceTeam Fortress 2Counter-Strike: Global Offensive FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CAI_ScriptedSentence
CPointEntity
CBaseEntity
C++ scripted.cpp
Scripted sentence.png

scripted_sentence is a point entity available in all Source Source games except Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series.

Creates a scripted sentence, usually spoken by an NPC.

Can be considered somewhat obsolete, as there are more advanced alternatives:

  • For sentences spoken by a visible NPC, you can add lip synch and gestures to the sentence by using a logic_choreographed_scene entity pointing to a VCD file made in the Faceposer editor.
  • For dialog spoken by a non-visible NPC, like over a radio or by combine forces, you can use a simple ambient_generic entity either pointing to a raw sample, a soundscript or a scripted sentence (consisting of a combination of several samples) in the sentences.txt file.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Sentence Name (sentence) <string>
The sentence group name, as found in sentences.txt.
Speaker Type (entity) <target_name_or_class>
Additional Sentence Time (delay) <float>
Search Radius (radius) <float>
Radius to search within for an NPC to use. A value of "0" searches everywhere in the map.
Delay before refire (refire) <float>
Timed delay (in seconds) before refiring.
Listener Type (listener) <targetname>
Volume 0-10 (volume) <float>
A volume value from 0-10.
Sound Radius (attenuation) <integer choices>
Literal Value Description
0 Small Radius
1 Medium Radius
2 Large Radius
3 Play Everywhere

Inputs

BeginSentence
Starts the scripted sentence.

Outputs

OnBeginSentence
Fires when the sentence begins.
OnEndSentence
Fires when the sentence ends.