Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: sqpp on Tue 09/02/2016 14:46:41

Title: Intro Skip with Click and Keyboard press
Post by: sqpp on Tue 09/02/2016 14:46:41
Hello, i have a simple cutscene/intro when i starts the game, tried to make a simple function, but its doesn't work. I haven't got any error.

The character called cSalad

i tried the next in the Intro Room Script:

Code (ags) Select

function on_key_press(eKeyCode keycode)
{
  if (IsGamePaused()) keycode = 0; // game paused, so don't react to keypresses
 
  if (keycode == eKeyEscape) player.ChangeRoom(2, 100, 50);
}


So if i would press ESC should be change the room to 2.

Any idea?
Title: Re: Intro Skip with Click and Keyboard press
Post by: Danvzare on Tue 09/02/2016 15:08:09
There's already cutscene functions.
StartCutscene() and EndCutscene().

You put StartCutscene() where you want the cutscene to start, and EndCutscene() where you want the game to skip to when you press a skip button.
It really is that simple.
Title: Re: Intro Skip with Click and Keyboard press
Post by: sqpp on Tue 09/02/2016 15:34:19
Thanks so much, you solved it :)

Next time, i should think before post :|