Inventory Setup Nightmare

Started by Whelandrew, Fri 10/08/2007 19:25:09

Previous topic - Next topic

Whelandrew

This is a very aggravating setback and I have scoured the help file and Forums for a good 2 hours. So I have somehow accrued two problems:

1. My inventory button, in-game, will not bring up the inventory window. All other buttons on the screen work.

2. As I was trying to find a solution to that problem, the game suddenly began flashing this message: Error (line 63): Undefined token 'show_inventory_window'
I have never even touched this area yet, so I have no idea where it came from. Here is the scripting that it refers to:
#sectionstart btnIconInv_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconInv_Click(GUIControl *control, MouseButton button) {
 
  show_inventory_window();
}
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Khris

Your two problems are really one.

The function btnIconInv_Click() is called if you click the inventory button.
It in turn calls the function show_inventory_window().

The error message you get indicates that the declaration of the show_inventory_window() function has been removed or tampered with.

This is the original code, from the default game:

Code: ags
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
  gInventory.Visible = true;
  // switch to the Use cursor (to select items with)
  mouse.Mode = eModeInteract;
  // But, override the appearance to look like the arrow
  mouse.UseModeGraphic(eModePointer);

}


Put it back into the global script, somewhere above the snippet you posted.

Whelandrew

That did it :) Thank you very much
The bulb in my reading lamp went out.
I'm seeking enlightenment.

SMF spam blocked by CleanTalk