Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: WHAM on Fri 01/06/2012 10:14:23

Title: [SOLVED] character.say - How is the time delay calculated?
Post by: WHAM on Fri 01/06/2012 10:14:23
I am building my own functions to replace character.say, and at this time I am wondering how the default character.say -function really works?
As far as I can tell, the default .say -function first checks if there is a piece of audio strapped to the line. If there is, the engine waits until that audio finishes and then ends the .say -function. If no audio is set, AGS generates some sort of delay after which the line is skipped and the next one gets triggered.

Does anyone know how these default delays are calculated?
Title: Re: character.say - How is the time delay calculated?
Post by: Khris on Fri 01/06/2012 10:34:35
According to this wiki page (http://adventuregamestudio.co.uk/wiki/?title=Scripting_hints):

Code (ags) Select
int gameloops = ((text.Length / game.text_speed) + 1) * GetGameSpeed();
Title: Re: character.say - How is the time delay calculated?
Post by: WHAM on Fri 01/06/2012 11:21:42
Ah, the wiki, I was looking over the manual but forgot about the wiki.
Thanks for the info, Khris! I'll make some tests and code something quite similiar, as I've felt the AGS build-in system generated the delays quite nicely.