Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: left on Sat 19/03/2005 21:24:29

Title: problems with hotspots when in certain modes (SOLVED)
Post by: left on Sat 19/03/2005 21:24:29
Hello
I am using the code bellow (in global script - repeatedly execute) to change the cursor mode when a certain key is down, which works. However when in say look mode, if the character looks at a hot spot, the message it is supposed to display only appears for a mili secound.

The code and message works whe the last line of code is removed but then once say, look mode is activated, it obviously stays in look mode and wont revert back.

Is repeatedly execute the right place or is there a better way of writing this?



if (IsKeyPressed(76) == 1)  {
SetCursorMode(1);//set to mode look
}
else if (IsKeyPressed(84) == 1)  {
SetCursorMode(3); // set to mode TALK
}
else if (IsKeyPressed(85) == 1)  {
SetCursorMode(2); //set to mode USE
}
else SetCursorMode(0);  //set to mode walk


thanks
Title: Re: problems with hotspots when in certain modes
Post by: Ashen on Sat 19/03/2005 21:52:33
I think the problem is that, by default, pressing a key (or, in this case, a key already being pressed) skips Display/DisplaySpeech() commands, hence the message vanishing more or less as soon as it appears.
If this is the problem, you'll probably need to play with the SetSkipSpeech () command, and the game.skip_display variable. Look them up in the manual for more details.
Title: Fixed: problems with hotspots when in certain modes
Post by: left on Sun 20/03/2005 13:47:14
yes that worls fine

in fact you can change the speech skip from general settings and that also works

thanks
Title: Re: problems with hotspots when in certain modes
Post by: Ashen on Sun 20/03/2005 13:51:03
Heh, I'm so used to playing around with scripting, I didn't even think about doing it that way. Does that change the skip Display settings as well, or do you not need that?
Title: Re: problems with hotspots when in certain modes (SOLVED)
Post by: left on Mon 21/03/2005 21:04:15
no dont need it, thanks for yuor help, am leaving the skip option just on the mouse now, makes sense