BUG: Game continues loading on inv scroll

Started by joelphilippage, Sat 27/01/2007 01:00:52

Previous topic - Next topic

joelphilippage

On three of my rooms, I try pressing the inventory scroll button on the inventory gui and the game shows the loading cursor and dosin't stop. this only happens on three of the rooms. I have been looking through the script and I cain't find a problem. also I can only use the inventory gui once on the last room. I'm using the enhanced verb coin module. this may have somthing to do with it.



Gilbert

I think it's quite possibly a problem on scripting. If you didn't post the related codes and info. we can't help you much.

joelphilippage

ok heres the code
Code: ags
invMain.ScrollDown();

the name of the inventory box is invMain
here is the code for inventory on enhanced verbcoin scripting
Code: ags
function on_key_press(int keycode) {
	if (keycode==9){											// press TAB key
		if (gGui3.Visible == false){
			gGui3.Visible = true;
			player.ActiveInventory = null;
			mouse.Mode = eModeInteract;
			inv_entered = true; 
			custom_1 = null;
			custom_2 = null;
			custom_3 = null;
			custom_4 = null;
		}
		else{
			gGui3.Visible = false;
			if (mouse.Mode != eModeUseinv){ //if you don't have an inventory-item activated
				mouse.Mode = eModeWalkto;
				player.ActiveInventory = null; //go back to regular cursor mode
			}
			custom_1 = null;
			custom_2 = null;
			custom_3 = null;
			custom_4 = null;
		}
	}

	if (keycode==32){											//SPACE BAR = left-click
		if (gGui3.Visible == false){
			location_name = Game.GetLocationName(mouse.x, mouse.y); //get the name of whatever you clicked on
			clicked = 1;
		}
		else{
		  if (player.ActiveInventory == null){ //if you have no inventory item selected
				clicked = 1;
			}
		  else{
			  if (InventoryItem.GetAtScreenXY(mouse.x, mouse.y) != null){
					InventoryItem* item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
					if (item.IsInteractionAvailable(eModeUseinv) == true){
						item.RunInteraction(eModeUseinv);
					}
				}
			}
		}
		  
		mousex = mouse.x; //we set these params to store the exact location of
		mousey = mouse.y; //where you clicked

		guix = mousex - gGui2.Width/2; //we set the location of the GUI
		guiy = mousey - gGui2.Height/2; //and center it

		if (guix < 0) guix = 0; if (guix > verbc_border_x) guix = verbc_border_x;
		if (guiy < 0) guiy = 0; if (guiy > verbc_border_y) guiy = verbc_border_y;
	}
	if(keycode==13){								//ENTER = right-click
		if (gGui3.Visible == false){			
			if (mouse.Mode == eModeWalkto){	
				gGui3.Visible = true;					
				player.ActiveInventory = null;
				mouse.Mode = eModeInteract;
				inv_entered = true;
				custom_1 = null;
				custom_2 = null;
				custom_3 = null;
				custom_4 = null;
			}
			else{
				mouse.Mode = eModeWalkto;
				player.ActiveInventory = null;
			}
		}
		else{
		  if (mouse.Mode != eModeInteract){
        mouse.Mode = eModeInteract;
				player.ActiveInventory = null;
			}
			else{
				gGui3.Visible = false;
				if (mouse.Mode != eModeUseinv){ //if you don't have an inventory-item activated
					mouse.Mode = eModeWalkto;
					player.ActiveInventory = null; //go back to regular cursor mode
				}
				custom_1 = null;
				custom_2 = null;
				custom_3 = null;
				custom_4 = null;
			}
		} 
	}
}

function on_mouse_click(int button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  
	/*RIGHT-CLICK*/
	if (button==eMouseRight) {
		if (gGui3.Visible == false){			// if inventory not active
			if (mouse.Mode == eModeWalkto){	// and you're not holding an active item or something
				gGui3.Visible = true;					// activate the inventory
				player.ActiveInventory = null;
				mouse.Mode = eModeInteract;
				inv_entered = true;
				custom_1 = null;
				custom_2 = null;
				custom_3 = null;
				custom_4 = null;
			}
			else{
				mouse.Mode = eModeWalkto;
				player.ActiveInventory = null;
			}
		}			
	}




SMF spam blocked by CleanTalk