-
Notifications
You must be signed in to change notification settings - Fork 9
Speech
(Formerly known as game.close_mouth_end_speech_time
, which is now
obsolete)
static int Speech.AnimationStopTimeMargin
Gets/sets the time margin at which the character talking animation should stop before before speech time ends. This property is specified in game loops and is set to 10 by default.
NOTE: This property only affects the animation if voice mode is disabled.
Example:
Speech.AnimationStopTimeMargin = 40;
will stop talking animation 40 game loops (1 second with the default game speed) before speech time ends.
See also:
Speech.DisplayPostTimeMs
static bool Speech.CustomPortraitPlacement
Enables/disables the custom speech portrait placement. When set to
true the character portraits are positioned at screen coordinates
defined by Speech.PortraitXOffset
and Speech.PortraitY
. When set to
false the portraits will be automatically aligned again.
NOTE: This property has no effect if the Lucas-Arts speech style is used.
Compatibility: Supported by AGS 3.3.0 and later versions.
See also: Speech.PortraitXOffset
,
Speech.PortraitY
static int Speech.DisplayPostTimeMs
Gets/sets the extra time the speech will stay on screen after its base time runs out. Commonly the time the speech lines and portrait stay on screen is calculated based on the text length - if the text mode is on, or voice clip length - if the voice mode is on. This property prolongs the time the speech text and/or portrait is displayed. This property does not interfere with speech skipping by key or mouse click: players will still be able to skip speech any time they want (if appropriate skip mode is enabled). This property is specified in milliseconds and is set to zero by default.
Compatibility: Supported by AGS 3.3.0 and later versions.
See also:
Speech.AnimationStopTimeMargin
(Formerly known as game.talkanim_speed
, which is now obsolete)
static int Speech.GlobalSpeechAnimationDelay
Gets/sets global speech animation delay which affects every character in game. This property is specified in game loops and is set to 5 by default.
NOTE: This property is ignored if lip sync is enabled.
NOTE: The property is only used when the Speech.UseGlobalSpeechAnimationDelay is set to true. This property cannot be used if the global speech animation delay is disabled. In that case, the individual character's animation delay is used instead.
See also:
Character.SpeechAnimationDelay
,
Speech.UseGlobalSpeechAnimationDelay
static Overlay* Speech.PortraitOverlay
Retrieves the portrait overlay of a current blocking speech. It's currently only available in eihter
a repeatedly_execute_always
or late_repeatedly_execute_always
. It will return null if no
portrait overlay is currently being shown.
Example:
#define PORTRAIT_YMIN 5
#define PORTRAIT_YMAX 30
int plast = -1;
int pmove = 1;
function repeatedly_execute_always() {
if (Speech.PortraitOverlay != null) {
if (plast >= 0) Speech.PortraitOverlay.Y = plast;
Speech.PortraitOverlay.Y += pmove;
if (Speech.PortraitOverlay.Y < PORTRAIT_YMIN) pmove = 1;
if (Speech.PortraitOverlay.Y > PORTRAIT_YMAX) pmove = -1;
plast = Speech.PortraitOverlay.Y;
}
}
Waves a speech portrait up and down
Compatibility: Supported by AGS 3.6.0 and later versions.
See also:
Speech.TextOverlay
static int Speech.PortraitXOffset
Gets/sets the character's speech portrait horizontal offset relative to screen side. The actual x coordinate of the portrait is calculated based on whether portrait is to be displayed at the left or right side of the screen. This property specifies the distance between the screen side and respected portrait's border.
NOTE: The property is only used when the Speech.CustomPortraitPlacement is set to true.
Compatibility: Supported by AGS 3.3.0 and later versions.
See also:
Speech.CustomPortraitPlacement
,
Speech.PortraitY
static int Speech.PortraitY
Gets/sets the character's speech portrait y coordinate on screen.
NOTE: The property is only used when the Speech.CustomPortraitPlacement is set to true.
Compatibility: Supported by AGS 3.3.0 and later versions.
See also:
Speech.CustomPortraitPlacement
,
Speech.PortraitXOffset
(Formerly known as game.skip_speech_specific_key
, which is now
obsolete)
static eKeyCode Speech.SkipKey
Gets/sets special key which can skip speech text. This makes all other keys ignored when speech is displayed on screen, unless eKeyNone is assigned, in which case any key can be used again.
NOTE: The specified key will only skip speech if the appropriate speech skip style is enabled.
Example:
Speech.SkipKey = eKeySpace;
will assign the "space" key to skip the speech.
See also: Speech.SkipStyle
(Formerly known as SetSkipSpeech
, which is now obsolete)
static SkipSpeechStyle Speech.SkipStyle
Gets/sets how the player can skip speech lines.
The accepted values are
eSkipKeyMouseTime player can skip text by clicking mouse or pressing key
eSkipKeyTime player can skip text by pressing key only, not by clicking mouse
eSkipTime player cannot skip text with mouse or keyboard
eSkipKeyMouse text does not time-out; player must click mouse or press key each time
eSkipMouseTime player can skip text by clicking mouse only, not by pressing key
eSkipKey text does not time-out; player can skip text by pressing key only
eSkipMouse text does not time-out; player can skip text by clicking mouse only
Example:
Speech.SkipStyle = eSkipTime;
will make the player unable to skip the text by pressing a mouse button or a key.
See also:
Game.IgnoreUserInputAfterTextTimeoutMs
,
Game.TextReadingSpeed
,
Speech.SkipKey
(Formerly known as SetSpeechStyle
, which is now obsolete)
static eSpeechStyle Speech.Style
Gets/sets the way in which speech text is displayed. This modifies the setting originally set in the editor. SpeechStyle can be:
eSpeechLucasarts
speech text over character's head
eSpeechSierra
close-up portrait of character
eSpeechSierraWithBackground
close-up portrait + background window for text
eSpeechFullScreen
QFG4-style full screen dialog pictures
Example:
Speech.Style = eSpeechSierra;
will change the speech style to a close up portrait of the character.
(Formerly known as game.speech_text_align
, which is now obsolete)
static Alignment Speech.TextAlignment
Sets how text in LucasArts-style speech is aligned.
The accepted values are
eAlignLeft
eAlignCentre
eAlignRight
The default is eAlignCentre.
Example:
Speech.TextAlignment = eAlignRight;
will align the speech text at the right side.
static Overlay* Speech.TextOverlay
Retrieves the text overlay of a current blocking speech. It's currently only available in eihter a
repeatedly_execute_always
or late_repeatedly_execute_always
. It will return null if no
text overlay is currently being shown.
It allows to detect appearance, removal, and change of the blocking speech. Additionally, calling Speech.TextOverlay.Remove() will work as a speech interrupt.
Example:
Overlay* lastSpeech;
function late_repeatedly_execute_always() {
Overlay* curSpeech = Speech.TextOverlay;
if (lastSpeech == null && curSpeech != null) {
// speech has started
} else if (lastSpeech != null && curSpeech == null) {
// speech is over
} else if (lastSpeech != null && curSpeech != lastSpeech) {
// speech changed to the next line
}
lastSpeech = curSpeech;
}
Detects when the blocking speech has begun, changed to the next line or is over.
Compatibility: Supported by AGS 3.6.0 and later versions.
See also:
Speech.PortraitOverlay
static bool Speech.UseGlobalSpeechAnimationDelay
Gets/sets whether speech animation delay should use global setting, as opposed to individual character's setting. The actual global delay value is specified with Speech.GlobalSpeechAnimationDelay.
Example:
Speech.UseGlobalSpeechAnimationDelay = true;
will make the game use global speech animation delay.
Compatibility: Supported by AGS 3.3.0 and later versions.
See also:
Character.SpeechAnimationDelay
,
Speech.GlobalSpeechAnimationDelay
(Formerly known as SetVoiceMode
, which is now obsolete)
static eVoiceMode Speech.VoiceMode
Gets/sets whether voice and/or text captions are used in the game.
Valid values for VoiceMode are:
eSpeechTextOnly no voice, text only
eSpeechVoiceAndText both voice and text
eSpeechVoiceOnly voice only, no text
The default is eSpeechVoiceAndText if in-game speech is enabled, and
eSpeechTextOnly if it is not. Changing this setting changes the
behavior of all Say
and
Display
commands which have a speech file assigned
to them.
WARNING: you should only ever use eSpeechVoiceOnly at the player's request to do so, because there is no guarantee that they even have a sound card and so may not understand what is going on.
Example:
if (IsSpeechVoxAvailable()==1)
Speech.VoiceMode = eSpeechVoiceAndText;
will set the voice mode to voice and text if the voice pack is available.
Getting Started in AGS
Editor
- New Game templates
- Editor Preferences
- General Settings
- Default Setup
- Colours Editor
- Room Editor
- Character Editor
- Cursor Editor
- Dialog Editor
- Font Preview
- GUI Editor
- Inventory Items Editor
- View Editor
- Sprite Manager
- Music and sound
- Voice speech
- Script Modules
- System limits
- Log Panel
- Plugins
- Other Features
Engine
Scripting
- Scripting Tutorial
- Scripting Language
-
Scripting API
- Script API Overview
- Standard Constants
- Standard Enumerated Types
- Standard Types
- Game variables
- Global arrays
- Global event handlers
- repeatedly_execute / repeatedly_execute_always
- Custom dialog options rendering
- Global functions: general
- Global functions: message display
- Global functions: multimedia actions
- Global functions: palette operations
- Global functions: room actions
- Global functions: screen effects
- Global functions: wait
- AudioChannel functions and properties
- AudioClip functions and properties
- Camera functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- Dictionary functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game functions and properties
- GUI functions and properties
- GUI control functions and properties
- GUI Button functions and properties
- GUI InvWindow functions and properties
- GUI Label functions and properties
- GUI List Box functions and properties
- GUI Slider properties
- GUI Text Box functions and properties
- Hotspot functions and properties
- Inventory item functions and properties
- Maths functions and properties
- Mouse functions and properties
- Object functions and properties
- Overlay functions and properties
- Parser functions
- Region functions and properties
- Room functions and properties
- Screen functions and properties
- Set functions and properties
- Speech functions and properties
- String functions
- System functions and properties
- TextWindowGUI functions and properties
- ViewFrame functions and properties
- Viewport functions and properties
- Obsolete Script API
- Event Types
- Key code table
- Audio in script
Legal Notice
Getting in touch
Misc