Can not interact with an inventory item.

Started by Two Tales, Fri 13/09/2019 11:44:30

Previous topic - Next topic

Two Tales

I'm using the default TwoClickHandler which I've used numerous times before but for some reason, with this project, when I use Inventory item interact from the inventory items properties it is being completely ignored and uses inventory graphic as cursor instead. I have not changed any of the script for the TwoClickHandler in TwoClickHandler.asc or in global script other than what message is displayed in the Unhandled events.
'Look at inventory item' in the inventory items properties is working fine it is just the interact.
I've tried changing the mouse mode to eModeInteract incase it was a mouse mode issue but this makes no difference when I test it.
I did have an issue the other day where I added an inventory item and it was just passing type=1 on the unhandled events for inventory items. There seemed to be no explanation for that so in the end I just deleted the inventory item from my project, then re-added it and suddenly it wasn't doing it anymore so I put it down to a random glitch and moved on.
I've never had an inventory item's interact property be ignored when using the TwoClickHandler before so I'm totally baffled.
Any ideas?

eri0o

I don't have access to a PC with AGS right now. I would look into Inventory Window properties on the editor and global settings to see if there's any option to change behavior of the inventory window. Also, not sure if you are falling on this case

https://adventuregamestudio.github.io/ags-manual/TextScriptEvents.html

There's a small note on the inventory saying "Interact with inventory (currently not possible)".

Khris

#2
I took a look at the script and it uses a property called "propInstantUse". This will determine whether an interact click on the item selects it as active or interacts with it.

The prop's default value is "false", which means you probably changed the prop to true for the item at some point but didn't have an interact handler set up. That's why clicking it did nothing. Removing the item and re-adding it means the prop was again set to "false", so selecting it worked.

I guess the module should probably use  i.IsInteractionAvailabe(eModeInteract)  instead to determine how a click is handled.

Cassiebsg

Yes, it's a custom property, you don't really need to remove the item, just go to the inventory item's property, click the custom property and set the propInstantUse to false. My guess is that you "re-used" the Pan flutes item, that comes with the template, and you just changed the name and image and script stuff...
I have done that once before too.  ;)
There are those who believe that life here began out there...

Two Tales

Quote from: Cassiebsg on Fri 13/09/2019 14:34:01
My guess is that you "re-used" the Pan flutes item

Yep, that is exactly what I did with the 'other day' incident.

I can't believe I forgot about the custom property! kicking myself now.
Thanks guys. You've saved me from tearing my hair out unnecessarily.

SMF spam blocked by CleanTalk