With AGS you can link a line of dialog to a speech file, to enable "talkie"-
style games. Suppose you have a dialog script with the following:
ego: "Hi! How are you?"
david: "I'm fine."
Normally this would display the words in the speech text above the characters
heads. However, you can add the special character '&' to symbolise that a
voice file should also be played. The file name is made up of the first four
letters of the character's script name, then an ID number. For example,
ego: &10 "Hi! How are you?"
david: &7 "I'm fine."
This would play EGO10.WAV with the first line, and DAVI7.WAV with the second.
When a line of text has a voice linked to it, the text on the screen will not
be removed until the voice file has finished playing. If the player interrupts
it by clicking the mouse or pressing a key, the text and voice will be stopped.
Voice files must be placed in the "Speech" sub-directory of the game folder.
You can also use speech with Say script function.
cEgo.Say("&10 Hi! How are you?");
cDavid.Say("&7 I'm fine.");
NOTE: WAV, OGG and MP3 format files can be used for speech.
NOTE: You cannot use speech file numbers above 9999. That is, you can
have EGO1.OGG all the way up to EGO9999.OGG, but not EGO10000.OGG or higher.
Speech is compiled into a file called SPEECH.VOX and is separate
from the rest of your game data so that you can offer it as an optional extra
download to the player. The game will function correctly if the file is not
present.
SeeAlso: SetVoiceMode script function.
|