Delay between two player.Say() commands.

Started by Windenwart, Tue 20/03/2007 10:58:56

Previous topic - Next topic

Windenwart

The delay between two Say() commands, like:

player.Say("Hello.");
player.Say("My name is Guybrush Threepwood.");

is too short. It feels like a flicker or a graphical dissonance, it's not aesthetic.
Can I set the global delay after a Say() command?

I must use the Wait() command otherwise, for example with an new function:

function SayW(Character *player, String text)
{
  player.Say(text);
  Wait(12):
}

Ashen

No, I don't think there's a way to set a delay between Say commands, except to use Wait as you have.
I wouldn't use player in your function - if it only effects the player character, you don't need the Character parameter. Otherwise - player is an internally defined value, having another pointer with the same name will cause an error.

To clarify, though, is the problem just with short lines of speech, like the first? If so, there's this variable:
Quote
game.text_speed
How long speech text stays on the screen. Default 15, higher number means shorter time.

Setting it to a lower value in game_start (so speech stays on display longer) might reduce the 'flicker' effect a little. Of course, longer lines will also stay on longer, but depending on your 'Skip speech' setting that shouldn't be a problem.
I know what you're thinking ... Don't think that.

monkey0506

Does that function actually compile that way? I'd expect a compiler error to the effect that "player" is already defined. But something like:

Code: ags
// script header

import function SayW(Character *chara, String text, int wait_time=15);

// global script

function SayW(Character *chara, String text, int wait_time) {
  chara.Say(text);
  Wait(wait_time);
  }


I've also shown how to include an optional parameter (a parameter that does not have to be supplied for the function to run) to define the length of the wait in case you want to use a shorter or longer wait at another point in your game. The parameter defaults to 15, so if you just use something like:

Code: ags
SayW(player, "blah");


It will wait 15 game loops after the player says "blah". But if you want him to way 25 game loops instead you could use:

Code: ags
SayW(player, "blah", 25);


Also (as Ashen suggested), looking at the game.text_speed variable may prove beneficial.

SMF spam blocked by CleanTalk