Hi,
I have a suitcase in my inventory which I'd like to open upon "Interact Inventory Item". The problem is that nothing I put under "Interact Inventory Item" will be executed. When you click on the inventory item with the interact cursor active the cursor changes to the image of the inventory item, which is OK for most of the inventory items but for the suitcase I'd like to change this default behaviour. How can I do that?
Thanks for helping,
PennyLane
Use Talk to and not Interact with the item.
To explain: the default AGS behaviour is that using eModeInteract on Inventory items sets them as active inventory, and there's no simple way to get round this - other than using a different cursor mode, as petazzo suggests.
However, if you do that, remember that you'll need to set all the other items to become active inventory when you 'Talk to' them. The easiest way would be using unhandled_event, e.g.:
function unhandled_event(int what, int type) {
if (what == 5 && type == 2) { //'Talk to' inventory
player.ActiveInventory = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
}
}
Rather than manually adding the command to every item's 'Talk to inventory item' interaction. (Or whatever mode you choose to use.)
You could also use the 'Handle inventory clicks in script' option, but that's a lot more work, for the same result.
Thanks for your help. Meanwhile we have found another very inelegant yet effective solution ;D
PennyLane