I fixed my previous problem, but now after someone *cough* Vel *cough* gave me the wrong advice my save button won't work! Take a look, please help! Please? :)
// main global script file
function game_start() {
// called when the game starts, before the first room is loaded
}
function repeatedly_execute() {
// put anything you want to happen every game cycle here
}
function show_inventory_window () {
// This demonstrates both types of inventory window - the first part is how to
// show the built-in inventory window, the second part uses the custom one.
// Un-comment one section or the other below.
// ** DEFAULT INVENTORY WINDOW
InventoryScreen();
/*
// ** CUSTOM INVENTORY WINDOW
GUIOn (INVENTORY);
// switch to the Use cursor (to select items with)
SetCursorMode (MODE_USE);
// But, override the appearance to look like the arrow
SetMouseCursor (6);
*/
}
function on_key_press(int keycode) {
// called when a key is pressed. keycode holds the key's ASCII code
if (IsGamePaused() == 1) keycode=0; // game paused, so don't react to keypresses
if (keycode==17) QuitGame(1); // Ctrl-Q
if (keycode==363) SaveGameDialog(); // F5
if (keycode==365) RestoreGameDialog(); // F7
if (keycode==367) RestartGame(); // F9
if (keycode==434) SaveScreenShot("scrnshot.bmp"); // F12
if (keycode==9) show_inventory_window(); // Tab, show inventory
if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
if (keycode==22) Debug(1,0); // Ctrl-V, version
if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
}
function on_mouse_click(int button) {
// called when a mouse button is clicked. button is either LEFT or RIGHT
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button==LEFT) {
ProcessClick(mouse.x, mouse.y, GetCursorMode() );
}
else { // right-click, so cycle cursor
SetNextCursorMode();
}
}
function interface_click(int interface, int button) {
if (interface == ICONBAR) {
if (button == 0) { // show inventory
show_inventory_window();
}
else if (button == 1) { // use selected inventory
if (character[ GetPlayerCharacter() ].activeinv >= 0)
SetCursorMode(4);
}
else if (button == 1) // save game
SaveGameDialog();
else if (button == 2) // load game
RestoreGameDialog();
else if (button == 3) // quit
QuitGame(3);
else if (button == 4) // about
{Display("MAGS game by Alex Varlakova");
Display("Staring highwaygal (Al Ninio) as himself");
Display("onethinkinggal (Annie) as herself");
Display("Miez as Prof.Miez");
Display("and Femme Fatale as Evil Bitch");
Display("Engine by Chris Jones www.agsforums.com");
Display("VISIT itkid.com/sasha.htm and itkid.com for more free games!");
Display("Love, Alex");}
} // end if interface ICONBAR
if (interface == INVENTORY) {
// They clicked a button on the Inventory GUI
if (button == 1) {
// They pressed SELECT, so switch to the Get cursor
SetCursorMode (MODE_USE);
// But, override the appearance to look like the arrow
SetMouseCursor (6);
}
if (button == 2) {
// They pressed LOOK, so switch to that mode
SetActiveInventory(-1);
SetCursorMode(MODE_LOOK);
}
if (button == 3) {
// They pressed the OK button, close the GUI
GUIOff (INVENTORY);
SetDefaultCursor();
}
if ((button == 4) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
// scroll down
game.top_inv_item = game.top_inv_item + game.items_per_line;
}
if ((button == 5) && (game.top_inv_item > 0)){
// scroll up
game.top_inv_item = game.top_inv_item - game.items_per_line;
}
}
}
function character0_a() {
// script for character0: Look at character
}
:)