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)
 
(32 intermediate revisions by 19 users not shown)
Line 1: Line 1:
{{wrongtitle|title=scripted_sentence}}
{{LanguageBar}}
{{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]].
A scripted sentence, usually spoken by an NPC. Can be considered somewhat obsolete, as it is preferable to use a combination of [[FacePoser_Overview|Faceposer]] and a [[Logic_choreographed_scene]] entity for spoken dialog.


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


*{{kv targetname}}
* 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_Overview|Faceposer]] editor.


* '''sentence'''
* 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.
: <string> The sentence group name, as found in [[sentences.txt]].


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


==Inputs==
== Inputs ==
 
{{I|BeginSentence|Starts the scripted sentence.}}
* {{i targetname}}
 
* {{i parentname}}
 
* '''BeginSentence'''
: Starts the scripted sentence.
 
==Outputs==
 
* {{o targetname}}
 
* '''OnBeginSentence'''
: Fires when the sentence begins
 
* '''OnEndSentence'''
: Fires when the sentence ends


[[Category:Entities]]
== 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.