Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: PsychicHeart on Thu 23/06/2005 07:16:16

Title: button for save game, load etc.
Post by: PsychicHeart on Thu 23/06/2005 07:16:16
how would i go about assigning buttons to things i want to do.
My GUI is stuffing around so that's out.
I need:

Ctrl+S (or similar) : Save Game
Ctrl+L (or similar) : Load Game
Ctrl+B (or similar) : Go Back to main menu

thanks,
Blake
Title: Re: button for save game, load etc.
Post by: Gilbert on Thu 23/06/2005 08:31:21
Look up in the global script and find the function on_key_press(), and add lines like:

if (keycode==2) { //Ctrl-B
  //do whatever you need for pressing this key here
}

You can look up the keycodes from the manual:
Reference --> ASCII Code Table

For your convenience the keycodes for Ctrl-B, Ctrl-L and Ctrl-S are 2, 12 and 19, respectively.