Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Edwin Xie

#181
 :o The caretaker got me by suprise!
#182
// main global script file
//=========================================================================
// SAVE GAME DIALOG - The following functions implement the Save Game
// interface. The SAVE GAME dialog is normally activated via a user
// click on the ICON BAR.
//
// bgSave(state)
// This function opens the dialog box and performs the operations initiated
// by controls within the dialog box.
//
// state - This parameter determines the behavior of dialog as follows:
//Ã,  Ã,  DIALOGÃ,  - Open the Save dialog box
//Ã,  Ã,  CANCELÃ,  - Close dialog box without performing any operation
//Ã,  Ã,  OKÃ,  Ã,  Ã,  - Save the selected game slot
//Ã,  Ã,  LISTÃ,  Ã,  - Get user selection from listbox
//
//=========================================================================
Ã,  Ã, stringÃ,  bg_save_buf;Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // text buffer
Ã,  Ã, intÃ,  Ã,  Ã, bg_save_idx;Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // index
Ã,  Ã, intÃ,  Ã,  Ã, bg_save_slot;Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // save game id

function bgSave(int state) {
Ã,  Ã, // SAVE icon was pressed, open dialog
Ã,  Ã, if (state==DIALOG) {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  bgCursor(6);
Ã,  Ã,  Ã,  GUIOn(bgSAVE_DLG);
Ã,  Ã,  Ã,  ListBoxSaveGameList(bgSAVE_DLG,bgSAVE_LIST); // Populate listbox with previous saves
Ã,  Ã,  Ã,  bg_save_idx = ListBoxGetNumItems(bgSAVE_DLG,bgSAVE_LIST);
Ã,  Ã,  Ã,  if (bg_save_idx <= 20) {Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // Less than max saves
Ã,  Ã,  Ã,  Ã,  Ã, ListBoxAdd(bgSAVE_DLG,bgSAVE_LIST,"<new>");
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  else {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // Max number of saves exceeded
Ã,  Ã,  Ã,  Ã,  Ã, bg_save_idx = 0;Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // Setup overwrite of existing slot
Ã,  Ã,  Ã,  Ã,  Ã, ListBoxGetItemText(bgSAVE_DLG,bgSAVE_LIST,bg_save_idx,bg_save_buf);
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  ListBoxSetSelected(bgSAVE_DLG,bgSAVE_LIST,bg_save_idx);
Ã,  Ã,  Ã,  ListBoxGetItemText(bgSAVE_DLG,bgSAVE_LIST,bg_save_idx,bg_save_buf);
Ã,  Ã,  Ã,  if (StrComp(bg_save_buf,"<new>")==0) StrCopy(bg_save_buf,"");
Ã,  Ã,  Ã,  SetTextBoxText(bgSAVE_DLG,bgSAVE_TEXT,bg_save_buf); // Setup text entry box
Ã,  Ã, }

Ã,  Ã, // List element was clicked, copy selected item's text to the TextBox
Ã,  Ã, else if (state==LIST) {
Ã,  Ã,  Ã,  bg_save_idx = ListBoxGetSelected(bgSAVE_DLG,bgSAVE_LIST);
Ã,  Ã,  Ã,  ListBoxGetItemText(bgSAVE_DLG,bgSAVE_LIST,bg_save_idx,bg_save_buf);
Ã,  Ã,  Ã,  if (StrComp(bg_save_buf,"<new>")==0) StrCopy(bg_save_buf,"");
Ã,  Ã,  Ã,  SetTextBoxText(bgSAVE_DLG,bgSAVE_TEXT,bg_save_buf);
Ã,  Ã, }

Ã,  Ã, // SAVE button was pressed, save the game
Ã,  Ã, else if (state==OK) {
Ã,  Ã,  Ã,  SetRestartPoint();Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // Restart here
Ã,  Ã,  Ã,  bg_save_idx=ListBoxGetSelected(bgSAVE_DLG,bgSAVE_LIST); // Save game in new save game slot
Ã,  Ã,  Ã,  ListBoxGetItemText(bgSAVE_DLG,bgSAVE_LIST,bg_save_idx,bg_save_buf);
Ã,  Ã,  Ã,  if (StrComp(bg_save_buf,"<new>")==0) {Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  Ã,  Ã, bg_save_slot = ListBoxGetNumItems(bgSAVE_DLG,bgSAVE_LIST);
Ã,  Ã,  Ã,  Ã,  Ã, GetTextBoxText(bgSAVE_DLG,bgSAVE_TEXT,bg_save_buf);Ã, 
Ã,  Ã,  Ã,  Ã,  Ã, if (StrComp(bg_save_buf,"")==0) StrFormat(bg_save_buf,"Game-%d",bg_save_slot);
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  else {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // Over-write an existing save game
Ã,  Ã,  Ã,  Ã,  Ã, bg_save_slot=savegameindex[bg_save_idx]; // slot with name from textbox.
Ã,  Ã,  Ã,  Ã,  Ã, GetTextBoxText(bgSAVE_DLG,bgSAVE_TEXT,bg_save_buf);Ã, 
Ã,  Ã,  Ã,  Ã,  if (StrComp(bg_save_buf,"")==0) ListBoxGetItemText(bgSAVE_DLG,bgSAVE_LIST,bg_save_idx,bg_save_buf);
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  GUIOff(bgSAVE_DLG);Ã,  Ã,  Ã,  Ã,  Ã,  // Close dialog amd return
Ã,  Ã,  Ã,  SaveGameSlot(bg_save_slot, bg_save_buf); // Perform save operation last otherwise
Ã,  Ã,  Ã,  Display("Saved as: %s", bg_save_buf);Ã,  Ã,  // SAVE dialog will be active on restore
Ã,  Ã,  Ã,  bgCursor(0);Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 
Ã,  Ã, }

Ã,  Ã, // CANCEL button was pressed, cancel operation
Ã,  Ã, else if (state==CANCEL) {
Ã,  Ã,  Ã,  GUIOff(bgSAVE_DLG);Ã,  Ã,  Ã,  Ã,  Ã,  // Close dialog and return
Ã,  Ã,  Ã,  bgCursor(6);Ã, 
Ã,  Ã, }
}

//=========================================================================
// RESTORE GAME DIALOG - The following routines implement restore game
// interface. The RESTORE GAME dialog is normally activated via a user
// click on the ICON BAR.Ã, 
//
// bgRestore(state)
// This function opens the dialog box and performs the operations initiated
// by controls within the dialog box.
//
// state - This parameter determines the behavior of dialog as follows:
//Ã,  Ã,  DIALOGÃ,  - Open the Restore dialog box
//Ã,  Ã,  CANCELÃ,  - Close dialog box without performin any operation
//Ã,  Ã,  OKÃ,  Ã,  Ã,  - Restore the selected game slot
//Ã,  Ã,  LISTÃ,  Ã,  - Get user selection from listbox
//
//=========================================================================
Ã,  Ã, stringÃ,  bg_restore_buf;Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // text buffer
Ã,  Ã, intÃ,  Ã,  Ã, bg_restore_idx;Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // index

function bgRestore(int state) {
Ã,  Ã, // RESTORE icon was pressed, open dialog
Ã,  Ã, if (state==DIALOG) {
Ã,  Ã,  Ã,  bgCursor(6);Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  GUIOn(bgRESTORE_DLG);Ã,  Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  ListBoxSaveGameList(bgRESTORE_DLG,bgRESTORE_LIST);
Ã,  Ã, }

Ã,  Ã, // CANCEL button was pressed, cancel operation
Ã,  Ã, else if (state==CANCEL) {
Ã,  Ã,  Ã,  GUIOff(bgRESTORE_DLG);Ã,  Ã,  Ã,  Ã, // Close dialog and return
Ã,  Ã,  Ã,  bgCursor(6);
Ã,  Ã, }

Ã,  Ã, // RESTORE button was pressed, restore the game
Ã,  Ã, else if (state==OK) {
Ã,  Ã,  Ã,  bg_restore_idx=ListBoxGetSelected(bgRESTORE_DLG,bgRESTORE_LIST); // Perform save operation
Ã,  Ã,  Ã,  if (bg_restore_idx==-1) {Ã,  Ã,  Ã,  Ã,  Ã,  // No selection, nothing to restore
Ã,  Ã,  Ã,  Ã,  Ã, Display("Please make a slection first...");
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  elseÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // Ok continue restoring game
Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã, ListBoxGetItemText(bgRESTORE_DLG,bgRESTORE_LIST,bg_restore_idx,bg_restore_buf);
Ã,  Ã,  Ã,  Ã,  Ã, RestoreGameSlot(savegameindex[bg_restore_idx]);
Ã,  Ã,  Ã,  Ã,  Ã, Display("Restored from: %s",bg_restore_buf);
Ã,  Ã,  Ã,  Ã,  Ã, GUIOff(bgRESTORE_DLG);Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  Ã,  Ã, bgCursor(6);Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  }
Ã,  Ã, }

Ã,  Ã, // LIST box was clicked
Ã,  Ã, else if (state==LIST) {
Ã,  Ã,  Ã,  // nothing to do
Ã,  Ã, }
}
//=========================================================================
Ã,  Ã, int bg_cursor_type;
Ã,  Ã, int bg_cursor_id;
Ã,  Ã, int bg_cursor_delay;

function bgCursor(int state) {Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // Setup cursor modes
Ã,  Ã, if (state==1) {
Ã,  Ã,  Ã,  SetCursorMode(1);
Ã,  Ã, }
Ã,  Ã, else if (state==3) {
Ã,  Ã,  Ã,  SetCursorMode(3);
Ã,  Ã, }
Ã,  Ã, else if (state==4) {
Ã,  Ã,  Ã,  SetCursorMode(4);
Ã,  Ã, }
Ã,  Ã, else if (state==2) {
Ã,  Ã,  Ã,  SetCursorMode(2);
Ã,  Ã, }
Ã,  Ã, else if (state==6) {
Ã,  Ã,  Ã,  SetMouseCursor(6);
Ã,  Ã, }
Ã,  Ã, else if (state==0) {
Ã,  Ã,  Ã,  SetDefaultCursor();
Ã,  Ã, }
Ã,  Ã, else if (state==7) {
Ã,  Ã,  Ã,  SetCursorMode(7);
Ã,  Ã, }
}

#sectionstart game_startÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
Ã,  // called when the game starts, before the first room is loaded
Ã,  GiveScore(100);
Ã,  SetGlobalInt(24,0);
Ã,  InterfaceOff(6);
}
#sectionend game_startÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
// LEC Statusline

Ã,  Ã,  string bunky;
Ã,  Ã,  string texty;
Ã,  Ã,  int cursy;

Ã,  Ã,  StrCopy (texty, "");
Ã,  Ã,  cursy=GetCursorMode();

Ã,  Ã,  if (cursy==0) StrCat(texty,"Walk to ");
Ã,  Ã,  else if (cursy==1) StrCat (texty,"Look at ");
Ã,  Ã,  else if (cursy==2) StrCat(texty,"Use ");
Ã,  Ã,  else if (cursy==3) StrCat(texty,"Talk to ");
Ã,  Ã,  else if (cursy==4) {
Ã,  Ã,  Ã,  Ã,  StrCat(texty,"Use ");
Ã,  Ã,  Ã,  Ã,  GetInvName (player.activeinv, bunky);
Ã,  Ã,  Ã,  Ã,  StrCat(texty,bunky);
Ã,  Ã,  Ã,  Ã,  StrCat(texty," with ");
Ã,  Ã,  }
Ã,  Ã,  else if (cursy==5) StrCat(texty, "Pick up ");
Ã,  Ã,  else if (cursy==8) StrCat(texty, "Open ");

Ã,  Ã,  GetLocationName(mouse.x,mouse.y,bunky);
Ã,  Ã,  StrCat(texty,bunky);
Ã,  Ã,  SetLabelText (0,0,texty);

Ã,  Ã,  if (IsGUIOn(1) || IsGUIOn(3) || IsGUIOn(4) || IsGUIOn(8) || IsGUIOn(9)) {
Ã,  Ã,  Ã,  Ã,  SetMouseCursor(6);
Ã,  Ã,  Ã,  Ã,  SetLabelText(0,0, " ");
Ã,  Ã,  }
Ã,  if (game.score == 0){
Ã,  Ã,  Display("Sorry, you died. Don't worry, you played well, you just got killed. Sigh, well, try again.");
Ã,  Ã,  RestartGame();
Ã,  Ã,  }
}
#sectionend repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE


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);
}

#sectionstart on_key_pressÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press(int keycode) {
Ã,  // called when a key is pressed. keycode holds the key's ASCII code
Ã,  int bg_save_idx;
Ã,  string bg_save_buf;
Ã,  if (IsGamePaused() == 1) keycode=0;Ã,  // game paused, so don't react to keypresses
Ã,  else if (keycode==17)Ã,  GUIOn(4);Ã,  Ã, // Ctrl-Q
Ã,  else if (keycode==363) bgSave(DIALOG);Ã,  Ã, // F5
Ã,  else if (keycode==365) bgRestore(DIALOG);Ã,  // F7
Ã,  else if (keycode==367) RestartGame();Ã,  // F9
Ã,  else if (keycode==434) SaveScreenShot("scrnshot.bmp");Ã,  // F12
Ã,  else if (keycode==9)Ã,  Ã, show_inventory_window();Ã,  // Tab, show inventory

Ã,  else if (keycode==19 && GetGlobalInt(24)==1){
Ã,  Ã,  Debug(0,0);Ã,  // Ctrl-S, give all inventory if GetGlobalInt(24)==1
Ã,  Ã,  }
Ã,  else if (keycode==22 && GetGlobalInt(24)==1){
Ã,  Ã,  Debug(1,0);Ã,  // Ctrl-V, version if GetGlobalInt(24)==1
Ã,  Ã,  }
Ã,  else if (keycode==1 && GetGlobalInt(24)==1){
Ã,  Ã,  Debug(2,0);Ã,  // Ctrl-A, show walkable areas if GetGlobalInt(24)==1
Ã,  Ã,  }
Ã,  else if (keycode==24 && GetGlobalInt(24)==1){
Ã,  Ã,  Debug(3,0);Ã,  // Ctrl-X, teleport to room if GetGlobalInt(24)==1
Ã,  Ã,  }
}
#sectionend on_key_pressÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart on_mouse_clickÃ,  // DO NOT EDIT OR REMOVE THIS LINE
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();
Ã,  }
}
#sectionend on_mouse_clickÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart interface_clickÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {

Ã,  Ã,  if (interface == ICONBAR)
Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  if (button == 4)Ã,  Ã,  // show inventory
Ã,  Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  show_inventory_window();
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (button == 5)Ã,  Ã,  // game controls
Ã,  Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  InterfaceOff(1);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  SetCursorMode(6);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  InterfaceOn(3);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (button == 6)Ã,  Ã,  // save game
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  GUIOn(SAVE);
Ã,  Ã,  Ã,  Ã,  else if (button == 7)Ã,  Ã, // load game
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  GUIOn(LOAD);
Ã,  Ã,  Ã,  Ã,  else if (button == 8)Ã,  Ã, // quit
Ã,  Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  GUIOn(4);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (button == 9)Ã,  Ã,  // about
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Display("The Adventures of Bob I [[Made with Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2004 Chris Jones");
Ã,  Ã,  }Ã,  // 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);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã, 
Ã,  Ã,  Ã,  Ã,  else if (button == 2) {
Ã,  Ã,  Ã,  Ã,  // They pressed LOOK, so switch to that mode
Ã,  Ã,  Ã,  Ã,  SetActiveInventory(-1);
Ã,  Ã,  Ã,  Ã,  SetCursorMode(MODE_LOOK);Ã, 
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (button == 3) {
Ã,  Ã,  Ã,  Ã,  // They pressed the OK button, close the GUI
Ã,  Ã,  Ã,  Ã,  GUIOff (INVENTORY);
Ã,  Ã,  Ã,  Ã,  SetDefaultCursor();
Ã,  Ã,  Ã,  Ã,  }

Ã,  Ã,  Ã,  Ã,  else 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;
Ã,  Ã,  Ã,  Ã,  }

Ã,  Ã,  Ã,  Ã,  else if ((button == 5) && (game.top_inv_item > 0))
Ã,  Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // scroll up
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  game.top_inv_item = game.top_inv_item - game.items_per_line;
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (button == 6) {Ã,  Ã, // use selected inventory
Ã,  Ã,  Ã,  Ã,  Ã,  if (character[ GetPlayerCharacter() ].activeinv >= -1)
Ã,  Ã,  Ã,  Ã,  SetCursorMode(4);
Ã,  Ã,  Ã,  }
Ã,  Ã,  }



Ã,  Ã,  CentreGUI(3);

Ã,  Ã,  if (interface == 3){
Ã,  Ã,  Ã,  if (button ==Ã,  8) SetGameSpeed(GetSliderValue(3,8));
Ã,  Ã,  Ã,  else if (button ==Ã,  9) SetMusicMasterVolume(GetSliderValue(3,9));
Ã,  Ã,  Ã,  else if (button == 10) game.text_speed = GetSliderValue(3,10);
Ã,  Ã,  Ã,  else if (button ==Ã,  0) GUIOn(9);
Ã,  Ã,  Ã,  else if (button ==Ã,  1) GUIOn(8);
Ã,  Ã,  Ã,  else if (button ==Ã,  2) GUIOn(4);
Ã,  Ã,  Ã,  else if (button ==Ã,  3){
Ã,  Ã,  Ã,  Ã,  SetCursorMode(6);
Ã,  Ã,  Ã,  Ã,  RestartGame();
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (button == 4 && GetGlobalInt(24) == 1){
Ã,  Ã,  Ã,  Ã,  Ã,  SetGlobalInt(24,0);
Ã,  Ã,  Ã,  Ã,  Ã,  Display("Debug mode has been turned off.");
Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  Ã,  else if (button == 4 && GetGlobalInt(24) == 0){ // If debug mode has already been turned off
Ã,  Ã,  Ã,  Ã,  Ã,  Display("Hey, debug mode has already been turned off!");
Ã,  Ã,  Ã,  Ã,  Ã,  Display("Unless this was an excuse to act like you got the password right for the thing there....");
Ã,  Ã,  Ã,  Ã,  Ã,  }

Ã,  Ã,  Ã,  Ã,  else if (button == 11){
Ã,  Ã,  Ã,  Ã,  Ã,  InterfaceOff (3);
Ã,  Ã,  Ã,  Ã,  Ã,  InterfaceOn (ICONBAR);
Ã,  Ã,  Ã,  Ã,  Ã,  SetCursorMode (1);
Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  }



Ã,  Ã,  if (interface == 4)
Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã, if (button == 0)Ã,  QuitGame(0);
Ã,  Ã,  Ã,  Ã, else if (button == 1) {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã, GUIOff(4);
Ã,  Ã,  Ã,  Ã,  if (character[BOB].room == 100){
Ã,  Ã,  Ã,  Ã,  Ã,  Ã, SetCursorMode(6);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã, }
Ã,  Ã,  Ã,  Ã,  Ã, else { //If the player isn't in room 100, set the cursor mode to MODE_WALK
Ã,  Ã,  Ã,  Ã,  Ã,  Ã, SetCursorMode(MODE_WALK);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã, }
Ã,  Ã,  Ã,  Ã, }

Ã,  Ã,  }
Ã,  Ã,  if (interface == 6) {Ã,  Ã,  //starts parsing, including any global commands
Ã,  Ã,  Ã,  if (button == 2){
Ã,  Ã,  Ã,  string forparser;
Ã,  Ã,  Ã,  StrCopy(forparser,"");
Ã,  Ã,  Ã,  GetTextBoxText(6,2,forparser);
Ã,  Ã,  Ã,  InterfaceOff(6);
Ã,  Ã,  Ã,  if (StrComp(forparser,"")){
Ã,  Ã,  Ã,  Ã,  ParseText(forparser);
Ã,  Ã,  Ã,  Ã, // These are things that should happen in any room
Ã,  Ã,  Ã,  if (Said("xxxxxxxxx")){ //No lookie at my password!
Ã,  Ã,  Ã,  Ã,  Display ("Yes, that is the correct password!");
Ã,  Ã,  Ã,  Ã,  SetGlobalInt(24,1);
Ã,  Ã,  Ã,  Ã,  Display ("Debug options are now on!");
Ã,  Ã,  Ã,  Ã,  Display ("Reference: [[ Ctrl+S : Give all inventory [[ Ctrl+V : Version [[ Ctrl+A : Shows walkable areas [[ Ctrl+X : Teleports to room X");
Ã,  Ã,  Ã,  Ã,  InterfaceOff(6);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  else { //If the word isn't the password do this
Ã,  Ã,  Ã,  Ã,  Display ("Sorry, this isn't the password. Please try again, or you can just stop trying to cheat.");
Ã,  Ã,  Ã,  Ã,  InterfaceOn(6);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  }
Ã,  Ã,  }
Ã,  Ã,  Ã,  if (button == 3){
Ã,  Ã,  Ã,  Ã,  Display("That's ok, you didn't have to type in the password.");
Ã,  Ã,  Ã,  Ã,  InterfaceOff(6);
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  } // previous interface
Ã,  Ã,  Ã,  CentreGUI(8);
Ã,  Ã,  Ã,  CentreGUI(9);
Ã,  Ã,  Ã,  // SAVE DIALOG
Ã,  Ã,  if (interface==bgSAVE_DLG) {Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  if (button==bgSAVE_LIST) bgSave(LIST);Ã,  Ã, 
Ã,  Ã,  Ã,  else if (button==bgSAVE_TEXT) bgSave(OK);
Ã,  Ã,  Ã,  else if (button==bgSAVE_OK) bgSave(OK);
Ã,  Ã,  Ã,  else if (button==bgSAVE_CANCEL) bgSave(CANCEL);Ã,  Ã, 
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  // RESTORE DIALOG
Ã,  Ã,  if (interface==bgRESTORE_DLG) {Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  if (button==bgRESTORE_LIST) bgRestore(LIST);
Ã,  Ã,  Ã,  else if (button==bgRESTORE_OK) bgRestore(OK);
Ã,  Ã,  Ã,  else if (button==bgRESTORE_CANCEL) bgRestore(CANCEL);
Ã,  Ã,  Ã,  }
Ã,  Ã,  }
#sectionend interface_clickÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart inventory4_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function inventory4_a() {
Ã,  // script for inventory4: Interact inventory item
game.score = 0;
}
#sectionend inventory4_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart inventory4_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function inventory4_b() {
Ã,  // script for inventory4: Talk to inventory item
game.score = 0;
}
#sectionend inventory4_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart character0_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function character0_a() {
Ã,  // script for character0: Use inventory on character
game.score = 0;Ã, 
}
#sectionend character0_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
#183
No, it just started with function bgCursor(...);
#185

Ok, I try to do what 'BlueGUI' does but I get this error when importing a function in the script header:

---------------------------
Adventure Game Studio
---------------------------
Script link failed: Runtime error: unresolved import 'bgSave'

---------------------------
OKÃ,  Ã, 
---------------------------

The script header has the following:

//STATES FOR THE FUNCTION
#define OKÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 1
#define CANCELÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 0
#define LISTÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 134
#define DIALOGÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 100
// SAVE GAME DIALOG
#define bgSAVE_DLGÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 8
#define bgSAVE_LISTÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  2
#define bgSAVE_TEXTÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  3
#define bgSAVE_OKÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  0
#define bgSAVE_CANCELÃ,  Ã,  Ã,  Ã,  Ã,  2

// RESTORE GAME DIALOG
#define bgRESTORE_DLGÃ,  Ã,  Ã,  Ã,  Ã,  9
#define bgRESTORE_LISTÃ,  Ã,  Ã,  Ã,  Ã, 2
#define bgRESTORE_OKÃ,  Ã,  Ã,  Ã,  Ã,  Ã, 0
#define bgRESTORE_CANCELÃ,  Ã,  Ã,  Ã, 1

import function bgSave(int state);
import function bgRestore(int state);

I think that I am missing something. What is the thing I'm missing?


New error when tryin to declare the function:

---------------------------
Compile Error
---------------------------
There was an error compiling your script. The problem was in 'Main script':



Error (line 137): Already referenced name as import



Do you want to fix the script now? (Your game has not been saved).
---------------------------
Yes   No   
---------------------------

Line 137:  function bgCursor(int state) {           // Setup cursor modes

I didn't declare it two times...what's wrong?
#186
Stick? Where do you get the stick?
#187
Hmm, I agree with Andail, sometimes Sierra Games are useful..... you can just forget to accomplish that, do some things restart the game and you can probably get it right the next time. That is how I figure out games.....
#188
Wow, great game, however I can't get past the terrorist near the 7th floor lift...... I think you get your gun ready in the elevator.......but there's that wait cursor....
#189
Still waiting on a walkthrough for the RPG part. :P
#190
http://www.agsforums.com/yabb/index.php?topic=14369.0

It has all the information you need on doing this. If you still don't get it, ask me about it.
#191
I see the problem. You renamed the room file other than roomx.crm. It happens to me when I forgot what I should to when I start a new room in AGS.
#192
Sometimes scripting can do anything you can't do in the interactions editor. ;) That's why I script (that is why I bother asking questions about it on this forum). ;D
#193
Sorry for reviving this topic but Ben's script gave me this error:

---------------------------
Adventure Game Studio
---------------------------
An error has occured. Please contact the game author for support, as this
is likely to be a scripting error and not a bug in AGS.
(ACI version 2.61.747)

(Global script line 273)
Error: ListBoxGetItemText: invalid item specified

---------------------------
OKÃ,  Ã, 
---------------------------

EDIT: I now used the ones Ben specified. Anything wrong?
#194
The BlueGUI is very confusing. I just found that out about the list box........
#195
Or you could use Hotspot 0; the black one and use it to delete anything you don't want if you don't want to do the whole thing over again. ;)
#196
The title explains it all and I know it has to do with "SaveGameSlot" and "RestoreGameSlot".... and I don't know about how to do the "Save" or "restore" buttons on the two.
#197
Critics' Lounge / Re: Lizard like creature
Thu 07/10/2004 06:34:43
 :o This thing is actually over 1000 pixels wide and tall, gotta crop it.  I know it looks squarish becase I had to redraw it using the line tool.....
#198
 ;D I have been waiting for this moment. I would download large games if they are great, like this, only it's better...
#199
Critics' Lounge / Lizard like creature
Sun 03/10/2004 07:50:35
So here is the picture I want you to C&C on:


Meh, I forgot the tail and the picture may appear transparent with some outlines. How does this look? You may want to straighten some parts. ;)
#200
*Smacks head
game.debug_mode, why didn't I think of that?
SMF spam blocked by CleanTalk