Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: EnterTheStory (aka tolworthy) on Thu 22/05/2008 22:43:16

Title: exactly how is text speed calculated? (SOLVED)
Post by: EnterTheStory (aka tolworthy) on Thu 22/05/2008 22:43:16
Does anyone know the exact formula for how long 'Say' will keep text on the screen? I have some characters that need to disappear at the exact same time as text disappears.

Thanks in advance.
Title: Re: exactly how is text speed calculated?
Post by: GarageGothic on Fri 23/05/2008 00:32:04
From the AGS Tidbits & Snippest doc (http://americangirlscouts.org/agswiki/index.php?title=AGS_tidbits_%26_snippets):

The number of gameloops a speech string is displayed:

int gameloops = ((StrLen(text) / game.text_speed) + 1) * GetGameSpeed();

StrLen() is obsolete though, so formatted to new style code, it would be (assuming a String named "text"):

int gameloops = ((text.Length / game.text_speed) + 1) * GetGameSpeed();
Title: Re: exactly how is text speed calculated?
Post by: Radiant on Fri 23/05/2008 08:23:07
Note that the above implies that you can cause a text to be displayed longer, by padding it with spaces.
Title: Re: exactly how is text speed calculated? (SOLVED)
Post by: EnterTheStory (aka tolworthy) on Fri 23/05/2008 08:23:53
Thanks. That was exactly what I was looking for.