Make your own free website on

A.G.S. v2.21
Text Script Commands Manual by Spyros

Main Page





DisableInterface ()
Disables the player interface. This works the same way as it is disabled while an animation is running: the mouse cursor is changed to the Wait cursor, and mouse clicks will not be sent through to the "on_mouse_click" function. Also, all interface buttons will be disabled.

EnableInterface ()
Re-enables the player interface, which was previously disabled with the DisableInterface function. Everything which was disabled is returned to normal.

GetSliderValue (int gui, int object)
Returns the value of slider OBJECT on GUI to your program. You would usually use this command in the interface_click function to find out what value the player has changed the slider to, in order to process their command.

InputBox (string prompt, string buffer)
This function allows your script to read a string typed in by the user. When this function is called it pops up a window asking the user to type in a string, with PROMPT as the text in the window. What they type in will be copied into BUFFER.
Note that this function only allows small strings (about 20 characters) due to the size of the input box it uses.
InputBox ("Type the password", buffer);

InterfaceOff (int interface)
Turns interface element number INTERFACE off. It will no longer appear on the screen (or, if it is a pop-up interface, it cannot be popped up).

InterfaceOn (int interface)
Turns interface element number INTERFACE on and displays it on the screen. This can be used to display a previously turned off interface, or to bring up a special interface like an inventory window. If the specified interface is a script-only interface (set to "On script command" in the Room Editor), then the game will be paused while the interface is displayed, and you should use InterfaceOff as a reaction to a button click in the interface to remove it.

SetButtonPic (int gui, int object, int which, int newslot)
Changes a GUI button's graphic to the one you specify. This could be used as an indicator of whether a feature is switched on or off by changing its picture. Sets object number OBJECT on gui GUI to NEWSLOT from the sprite manager.
The WHICH parameter selects which picture to change. It can have these
1 normal picture
2 mouse-over picture
3 button pushed picture
Note that you can pass NEWSLOT as -1 to disable the mouse-over and pushed pictures.
If the GUI setup in roomedit specifies a pushed-pic, but you want to change the main picture in the game (and so remove the old pushed picture), you can do something like this:
SetButtonPic (2, 3, 1, new_picture);
SetButtonPic (2, 3, 3, -1);
which will change button 3 on GUI 2 to have normal picture NEW_PICTURE and
not have a pushed graphic.

SetGUIPosition (int gui, int x, int y)
Moves the top-left corner of GUI to the new location (X,Y) on the screen. This allows you to dynamically move GUIs around on the screen while the game is running. The co-ordinates are screen co-ordinates, not room co-ordinates, and use the same scale as in RoomEdit.
SetGUIPosition (2,134,35);

SetLabelText (int gui, int object, string newtext)
Changes the text displayed in the specified label to NEWTEXT. The affected label will be object OBJECT from GUI. You can find out a label's object number by looking at the Properties window of the label. This command allows you to change the text during the game, for example to create a Lucasarts-style status line.

SetSliderValue (int gui, int object, int value)
Changes the specified slider (object number OBJECT on GUI) to have the new value VALUE. VALUE must lie between the MIN and MAX settings for the slider, as set up in the GUI editor.
SetSliderValue (2,3,14);