Forum rules - please read before posting.

Selected Item Display

I'm currently working on a 2D direct control game with cursor frozen & hidden. The thing I want to achieve is 1) open inventory & select an item 2) selected item displays above the player's head 3) close the inventory, but the item remains above the player 4) when interacting with a hotspot, it then checks the item above the player's head and does stuff.

However, I couldn't let the item remain selected after closing the inventory menu, and I need the menu to be closed when interacting with the hotspot (otherwise the game would be paused). I used a separate menu with an inventory box element set to display selected item to appear above the player, and it did display the item, but again only when the inventory menu was open. I couldn't figure out a way to do it--setting it to display last selected item may be a workaround, but then there seems to be no action that checks the last selected item, only the currently selected one.

What should I go about doing it? Is there an option to make an item remain selected even after closing the inventory menu? Thank you.

Comments

  • edited October 2016
    Also, this might be a bug: after I changed the when slot is empty option of the inventory box element to disable object and ran the game, the highlight green texture disappeared and item selection stopped working. so I changed it back to clear content. But the green texture did not come back, and the item interaction actionlist did not work, etc. Duplicating the inventory menu or creating a new inventory box element did not make the problem go away. However making a new inventory menu fixed it.  
  • In which version of AC?

    Creating a new Menu with an InventoryBox set to Display Selected is indeed the correct workflow, but the item shouldn't be disappearing unless it's no longer selected.  The Display Last Selected option isn't appropriate here because if it's no longer selected, the Hotspot won't be interactible with it.

    We'll need to work out how the Inventory item is being de-selected.  How are you enabling and disabling your Inventory menu?  The default Pause menu is set to run an ActionList named DeselectInventory - is this somehow being run by your Menu system at the wrong time?

    When an item is de-selected, the RuntimeInventory script's SetNull function is called - if you inserted a Debug.Log statement in there, we could look at the stacktrace in the Console when the de-selection occurs to work out why it's happening.  At this point it's not clear if this is a bug or not.

    As for the second post, thank you for the alert but I'm afraid I can't recreate it from the above description.  Please post version numbers, screenshots and more detail / steps to recreate in a new thread so that I can look into it further.
  • edited October 2016
    Thank you! I found the problem--I used the wrong input key to trigger the inventory menu, which also deselects the active item.
    I was unable to replicate the issue in my second post; it's likely just a one-time thing. I'm using the most recent version (updated a few days ago).
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.