From the manual:
DisplaySpeechAt (int x, int y, int width, CHARID, string message)
Similar to DisplaySpeech, except that the text is displayed with its top left corner at (X,Y), in an area WIDTH wide.
You can use this function to write the character's speech text anywhere you like, and AGS will still play the character's talking animation and so on if appropriate.
NOTE: This function does not support QFG4-style speech.
DisplaySpeechAt (220, 20, 100, EGO , "My name is ego");
will display the message in the top right corner of the screen, and play the character's talking animation.
See Also: DisplaySpeech, DisplaySpeechBackground