Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Nixxon on Sat 21/06/2003 22:17:11

Title: Keypress new room in wait mode
Post by: Nixxon on Sat 21/06/2003 22:17:11
Howdy  :)
I want to be able to skip my intro when i press escape... however i can't since my intro consists of the cursor being in wait mode for the entire duration... how can i get around this? heres the code -

if (IsKeyPressed(27) == 1)
NewRoom(7);
PlayMusic(1);
SetObjectView(2,23);
AnimateObject(2,0,2,1);
SetObjectView(3,24);
AnimateObject(3,0,2,1);
Wait(200);
ObjectOff(0);
ObjectOn(1);
SetObjectView(1,22);
AnimateObject(1,0,5,0);
while (IsObjectAnimating(1)) {
Wait(1);
}
NewRoom(9);

Thanks a lot, greatly appreciated  8)
Title: Re:Keypress new room in wait mode
Post by: Dorcan on Sat 21/06/2003 22:25:14
You know what ? You don't need to script all this stuff.

Kasaaam :

StartCutscene and EndCutscene functions are the solution

From the manual : StartCutscene (int skip_with)

Marks the start of a cutscene. Once your script passes this point, the player can choose to skip a portion by pressing a key or the mouse button. This is useful for things like introduction sequences, where you want the player to be able to skip over an intro that they've seen before.
SKIP_WITH determines how they can skip the cutscene:

1  by pressing ESC only
2  by pressing any key
3  by clicking a mouse button
4  by pressing any key or clicking a mouse button
5  by pressing ESC or clicking the right mouse button

Title: Re:Keypress new room in wait mode
Post by: Nixxon on Sat 21/06/2003 22:28:12
do the StartCutscene and EndCutscene functions go in the global or in the room script?

EDIT -
S'all good, I dunno if this is right but it seems to work

StartCutscene(4);

PlayMusic(1);
SetObjectView(2,23);
AnimateObject(2,0,2,1);
SetObjectView(3,24);
AnimateObject(3,0,2,1);
Wait(200);
ObjectOff(0);
ObjectOn(1);
SetObjectView(1,22);
AnimateObject(1,0,5,0);
while (IsObjectAnimating(1)==1) Wait(1);
EndCutscene();
NewRoom(9);

Thanks again :D :D
Title: Re:Keypress new room in wait mode
Post by: Dorcan on Sat 21/06/2003 22:38:10
Anywhere.

It must be set like this :


function blah(){

   StartCutscene (1)
   ...
   ...<--- Your animation, intro code here
   ...
   EndCutscene();

   NewRoom(9);
}