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
m (Technical limitations and cleanup)
(-added class hierarchy, cleanup, intn)
 
(37 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{wrongtitle|title=scripted_sentance}}
{{LanguageBar}}
{{cleanup}}
{{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}}


scripted_sentence
Creates a scripted sentence, usually spoken by an [[NPC]].


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


KEYS
* 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.


Name targetname <target_source> The name that other entities refer to this entity by.
* 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.


spawnflags spawnflags <flags>
== Keyvalues ==
{{KV Targetname}}
{{KV|Sentence Name|intn=sentence|string|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|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|Listener Type|intn=listener|target_destination}}
{{KV|Volume 0-10|intn=volume|float|A volume value from 0-10.}}
{{KV|Sound Radius|intn=attenuation|integer choices}}
:{| class=standard-table
! Literal Value || Description
|-
| 0 || Small Radius
|-
| 1 || Medium Radius
|-
| 2 || Large  Radius
|-
| 3 || Play Everywhere
|}


Sentence Name sentence <string>
== Inputs ==
{{I|BeginSentence|Starts the scripted sentence.}}


Speaker Type entity <string>
== Outputs ==
 
{{O|OnBeginSentence|Fires when the sentence begins.}}
Additional Sentence Time delay <string>
{{O|OnEndSentence|Fires when the sentence ends.}}
 
Search Radius radius <integer>
 
Delay Before Refire refire <string>
 
Listener Type listener <string>
 
Volume 0-10 volume <string>
 
Sound Radius attenuation <choices>
 
 
INPUTS
 
Kill Removes this entity from the world.
 
KillHierarchy Removes this entity and all its children from the world.
 
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
BeginSentence Starts the scripted sentence.
 
 
OUTPUTS
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.
 
OnUser3 Fired in response to FireUser3 input.
 
OnUser4 Fired in response to FireUser4 input.
 
OnBeginSentence Fires when the sentence begins
 
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.