Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: on Thu 21/10/2004 13:13:35

Title: Abort Key Script (SOLVED)
Post by: on Thu 21/10/2004 13:13:35
Hi,

Is it possible to overwrite the Abort Key <ALT-X> function in AGS games ?

I'd like to make a function that shows and asks a question like : "Are you sure you want to quit ? Yes/No" like in the lucasarts style.

I tried to make a function wich executes herself by pressing <ALT> and <X> (so, I use the special ascii code for doing this) but it doesn't seem to work (the default script is still executed).

If someone know how to resolve this...  ???

PS : Sorry for my bad (?) english but it's not my mother tounge.
Title: Re: Abort Key Script
Post by: Barbarian on Thu 21/10/2004 13:46:54
Well, I seem to recall this question (or something similar) was asked a little while ago, and at the time the Alt+X key combination was a default built in to force an exit of the game, and was not able to be changed. Which is a good feature to have if an AGS game happens to lock up on you for some reason (I've had to use Alt+X on a couple of AGS games that didn't like my computer).

However, I then recall reading something recently in on of the posts, ahh, yes, here, from the "AGS v2.62 RC2, Standard Edition" post in this forum, look a little down in that message under "Changes since beta 3:" and I see:

"* Added game.abort_key, to allow you to customize the Abort Key to be something other than Alt+X."

Ã,  Ã, However, I can not find any more information in the manual or on the forums here on how to properly use this script.Ã,  Anyone else know how to properly implement this "game.abort_key" script code into a game to be able to change the Alt+X combo to something else?
Title: Re: Abort Key Script
Post by: strazer on Thu 21/10/2004 13:50:22
Yeah, put
game.abort_key = ASCII;
in the game_start function, where ASCII is the new abort key combination (for example 24 (CTRL+X)).
Title: Re: Abort Key Script
Post by: Barbarian on Thu 21/10/2004 13:52:30
Kool, thanks Strazer. Good info to know.  :)
Title: Re: Abort Key Script
Post by: on Thu 21/10/2004 14:27:34
Thanks a lot !  ;)