Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Babar on Sun 19/06/2005 21:50:29

Title: inventory problem
Post by: Babar on Sun 19/06/2005 21:50:29
I've got this problem with my inventory GUI. The right click always results in the "LOOK" action. I don't want it to, but it does. It's annoying because there is already a look button. I have no idea how to change it. There is nothing I can see in the inventory script about looking with the right mouse button.
Title: Re: inventory right click
Post by: monkey0506 on Mon 20/06/2005 06:09:45
Perhaps posting some script?  Without it, it's kind of hard to see what the problem is.
Title: Re: inventory right click
Post by: Babar on Mon 20/06/2005 10:04:45
I'm just using the standard inventory GUI. I didn't change anything (except for the GUIs background graphic). Try it yourself. The same thing should happen.
Title: Re: inventory right click
Post by: strazer on Mon 20/06/2005 13:52:31
This is probably the default behaviour for right-clicks on inventory items. You can customize this by checking the "Handle inventory clicks in script" checkbox in the General settings and adding something like this to your global on_mouse_click function:


//...
//}
  else if (button == eMouseLeftInv) { // if left mouse button clicked on an inv item
    inventory[game.inv_activated].RunInteraction(mouse.Mode);
  }
  else if (button == eMouseRightInv) { // if right mouse button clicked on an inv item
    inventory[game.inv_activated].RunInteraction(eModeLookAt); // this is the standard behaviour, change as desired
  }
//else {   // right-click, so cycle cursor
//...

Title: Re: inventory problem
Post by: Babar on Mon 20/06/2005 14:16:00
Thanks...
Ok, I have another inventory related question:
I've decided I don't want an inventory. Too much trouble. My character will only be able to carry 2 items at a time (however, there are more than 2 inventory items used in the game), so I thought that I could have both of them in the Iconbar that appears on the top.
One of them can be the active inventory, and I thought that the other can be an inventory box. The problem is that the inventory box would show both the inventory items. Is there a way to have two active inventories? I want it so that when the player right-clicks to change the cursor, it can cycle through both of the inventory items. Is that possible?