Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: JD on Fri 22/09/2006 20:30:29

Title: Disabling keypress removing text windows?
Post by: JD on Fri 22/09/2006 20:30:29
My character is moved around using the keyboard, and you use spacebar to look at things/use things/talk to people. It works nicely, but when I use Display to display some text about an object the character looks at (for example), the text is removed immediatly if you keep the spacebar pressed just a bit too long. Is it somehow possible to disable keypresses removing text windows?

Thanks in advance...
Title: Re: Disabling keypress removing text windows?
Post by: Khris on Fri 22/09/2006 20:47:12
Don't know if that's possible without having to use a custom display-GUI, but you could do the following:
function MyDisplay(String message) {
Ã,  while(IsKeyPressed(32)) {
Ã,  Ã,  Wait(1);Ã,  Ã,  Ã, // wait until spacebar is released
Ã,  }
Ã,  Display("%s", message);
}
Title: Re: Disabling keypress removing text windows?
Post by: Ashen on Fri 22/09/2006 20:50:32
It should be possible. From the manual (http://www.adventuregamestudio.co.uk/manual/Globalvariables.htm):
Quote
game.skip_display
Setting for how Display() messages are skipped; valid values are same as for SetSkipSpeech (default 3).

And those values are:
Quote
0  player can skip text by clicking mouse or pressing key
1  player can skip text by pressing key only, not by clicking mouse
2  player cannot skip text with mouse or keyboard
3  text does not time-out; player must click mouse or press key each time
4  player can skip text by clicking mouse only, not by pressing key

So setting it to 2 or 4 sould solve your problem.
Title: Re: Disabling keypress removing text windows?
Post by: JD on Fri 22/09/2006 20:57:17
Thanks alot, exactly what I needed!