Using escape to cancel any "demo"

Started by Intangible, Tue 14/06/2011 00:56:23

Previous topic - Next topic

Intangible

In "professionally" made AGS games like AGD's King Quest remakes, the escape key can be used to skip most demo sequences, "snapping" the main character into the room and position he'd be at if he had actually gone through the whole demo. How is this accomplished? If I have a sequence of commands for moving characters and making them say things, how can I allow the escape key to interrupt all that and put people in their final positions?

It seems like I'd have to put something in the global script's on_key_press event that always checks for Escape, and then does a bunch of things instantly if it's pressed (it would also have to know what "demo" is currently running).

Is that all there is to this trick of programming Escape to skip demos, or is there something a little more "native" in AGS that I can use?

ddq

What you're talking about is a cutscene and AGS supports them well.
Look up StartCutscene and EndCutscene in the manual. What you're trying to do can be accomplished by...
Code: ags

StartCutscene(eSkipESCOnly);
// Code you want in the demo, such as talking, moving, etc...
Endcutscene();

Intangible

Niiiice! I was hoping this would be built-in somewhere. Thanks for pointing me to it.

SMF spam blocked by CleanTalk