Inventory Bar issues with two-button mouse configuration

Started by Tyshalle, Wed 13/11/2013 04:33:38

Previous topic - Next topic

Tyshalle

Hi all,

So I started out with the standard Default Game template and have been modifying it a bit while I try to figure out how to code using AGS. Currently I'm trying to design the interface so that it works similar to what you see in the Blackwell games, that is, with a simple, two-button interaction method, and an inventory bar that simply pops up when you move your cursor to the top of the screen. I've managed to figure out how to get it so that left clicking moves around the character and Interacts with hotspots, and right clicking Looks At hotspots. What I can't figure out is how to make the inventory bar work.

I created the inventory bar over the standard icon bar, simply removing the buttons there that I don't need (like changing the mouse cursor to Walk To, Interact, Talk, etc.). When I click on an object that's supposed to create an inventory item, that works fine, and the inventory item drops into the inventory just fine.

The problem comes in when I try to interact with the inventory. I would like left clicking on the inventory item to switch to the Use Inventory mode, while right clicking on the item would be the same as looking at it. Currently, right clicking on an inventory item does nothing at all, and left clicking on it also does nothing at all.

It seems that while my two-button system seems to be functioning in the room, it doesn't work the same way with the inventory. I tested it out by allowing the mouse wheel to cycle between mouse cursors, and sure enough, the Look at cursor will look at the item, and the Interact cursor will pick it up. But that's not what I need.

I've searched the forums pretty thoroughly and while I found a lot of somewhat similar answers, I never managed to find one that solves the problem of the inventory bar when you don't want to cycle between types of interactions.

Is this a pretty simple scripting thing? And do I put it under function on_mouse_click, or elsewhere?

Thanks!

Crimson Wizard

#1
Tyshalle, Default template is suggested for games with classic Sierra interface, it may have things superfluous for the style you're aiming (like verbs panel).
There are two templates that already have the "two-button interaction" interface, you probably could use them instead:

Lightweight BASS template:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48441.0
More extended template with extra functions:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48638.0


To answer your question:
Quote
The problem comes in when I try to interact with the inventory. I would like left clicking on the inventory item to switch to the Use Inventory mode, while right clicking on the item would be the same as looking at it. Currently, right clicking on an inventory item does nothing at all, and left clicking on it also does nothing at all.
First, you need to make sure that the option in General Settings "Inventory" -> "Override built-in inventory window clicks" is on (True).
Second, for clicks in inventory you should check special "eMouseLeftInv" and "eMouseRightInv" buttons.

Tyshalle


SMF spam blocked by CleanTalk