Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Inventory stay after open after examining inventory item

Latest Unity 2018 2.15f1, AC V1.65.2

Hi,

I would like my Inventory to stay after open after examining inventory item. I have the drag and drop technique on my inventory items set, and one click to examine the item in inventory. I have a menu entitled Invisible over the inventory for hover off and close inventory. But if I click on an empty inventory slot, the inventory stays open. It is only when I click on an inventory item to examine, that the inventory then closes.

Please see screenshots and video:

https://www.dropbox.com/sh/dtesdxd1sccd3o6/AAD-fPS3CeaSONEL8RQAV33xa?dl=0

Thanks

Comments

  • I have sorted this thanks
  • Could you please tell how you did it? I Have the same problem. The Inventory Window should only close if an item is dragged outside of the window. When examining or combining inside the inventory the window closes currently, but should stay open.
  • Send me a pic of your ameni window and action lists for it
  • I don't really know what ameni menu is but I made some screenshots. This is the Inventory Menu itself:
    image
    There are no action lists used in here.

    Then I have a invisible menu in the size of the inventory menu above it which detects if the mouse moves outside of it that has the following action list attached:
    image

    All of the inventory items have action lists attached that look like this:
    image
    Hope that helps. Thank you in advance.
  • Hi yeah that was a typo!

    OK so, why not create a menu with two buttons for your inventory box in the bottom left - 'open' and 'close', with set to Manual Appear type.

    Set the 'open' menu element action list to turn on Inventory menu, and to turn on inventory menu, hide 'close' menu element and show 'open' menu element, and the on action list for 'close' to be turn off inventory, and show 'close' menu element and hide 'open' menu element?
  • The button in the bottom left corner opens and closes the inventory fine. I did a lot of experimenting lately and nailed down what the real problem with my setup is:
    I have this invisible second menu that opens on mouse over. It has an ActionList defined in the "ActionList when turn off" field that should close both itself and the "real" inventory menu when the mouse cursor leaves it. That works fine. If the mouse enters the inventory menu and leaves it the Action got fired and the "real" inventory menu closes.
    If I disable this second invisible menu I can click on an inventory item and combine them without closing the inventory. But when it is turned on, the click on an item - even though the mouse does not leave the area - fires the turn off action. I don't think that is the correct behaviour, since this Action should only be run if the mouse leaves the area.
    Does anyone know why this Action runs? Is a mouse click equal to "mouse is leaving menu" internally? "Ignore mouse clicks" is enabled for the invisible menu, by the way.

  • The ActionList itself is not set to run when the mouse leaves the Menu, only when it turns off.  This type of Menu will turn itself off automatically when the game enters "cutscene" mode, so if clicking an item runs an ActionList then that's likely the cause.

    If you'd like to elaborate fully on the exact behaviour you're looking for, I may be able to suggest an alternative approach.
  • Yes, cutscene mode is entered if one of the items is clicked. Then that is what actually happens and runs the "close inventory" ActionList. What would be the way to avoid this?
  • Again, I'll need you to fully explain your intent - from the top, please.
  • OK, I try my best to explain what I'm aiming for:
    As you can see in the first screenshot I have an inventory window that can be opened and closed with the bottom left icon (works fine). I use drag and drop functionality for the items to have the same controls on PC and Android. When the player wants to use an item on let's say a hotspot, he should drag the item outside the inventory window which then closes and item can then be combined with any hotspot on the screen. Right now I'm achieving this with a second, invisible menu with the appear type "mouse over" and an attached ActionList that closes the "real" inventory window when the mouse leaves the invisible second one. This has the effect that the inventory is closed by either dragging an item outside or by leaving the inventory with the mouse cursor after entering it. This is not vital, basically the inventory window should only close when dragging an item outside. To examine an item I use the "Dropping on itself to examine" (don't know exactly right now what it's called). Combining items works also by dragging an item onto another one. When examining an item or combining them ActionLists start and they all switch the game mode to "cutscene" which is nice for having the possibility to skip dialogue lines.
    Everything works quite nice except for the cutscene mode closing the invisible menu which I never would have thought of because I thought that only leaving mouse cursor would close a menu with appear type "mouse over".
    When I disable the invisible menu everything works fine except for the inventory closing when you drag an item outside.

    I hope that explains my intents. Otherwise I could maybe wrap up a video to explain it.
  • No need - that explains it fine, thanks.

    Your Inventory menu is actually turning off during Cutscenes because its Appear type is set to During Gameplay.  It'll turn off regardless of the mouse-over technique.

    You'll need to set it to Manual to give you full control over its enabled state, unless you have your inventory interactions run during gameplay.  Showing and hiding it would then be a case of turning it on/off, instead of locking it.

    To have the "mouse over" technique only kick in if the player has an inventory item selected, you can precede the "mouse over menu on turn off" ActionList with an Inventory: Check selected Action to first determine whether or not the player has an item selected - and only turn Inventory off if so.
  • MACMAC
    edited November 2018
    I already switched the appear type of the inventory window to manual. But the Inventory: Check selected did the trick. Works as expected now. Thanks!

    And now I've run into the next problem, but that is something for another thread...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.