Forum rules - please read before posting.

"Item Found" Screen Display Issues

Hi all, as suggested by Chris I've made this into another thread. I am working on a carousel style inventory (see topic) and started implementing the tutorial regarding first time discovery screen of items (found here).

However I'm running into certain issues :

1.) The found item screen tends to overlay behind my inventory screen, creating a strange double effect. When I exit my inventory, I also have to "exit" the found item screen after

Overlaying behind

2.) The item name and description don't always show or sometimes would display incorrectly paired with the image shown

No text
Correct text and image
Wrong text and image pair

My console shows that the correct items are being picked up

Console log
Event manager
Action list

Any help in regards to this would be greatly appreciated!

Comments

  • The found item screen tends to overlay behind my inventory screen, creating a strange double effect. When I exit my inventory, I also have to "exit" the found item screen after

    Are you looking to have the "Found item" menu appear over Inventory, or close the Inventory while it shows?

    If you're using Unity UI for both Menus, you can control their display order with the Sort Order value in their Canvas components.

    The item name and description don't always show or sometimes would display incorrectly paired with the image shown

    Your Console shows two items being picked up - are these being picked up at the same time?

    I don't see anything related to Descriptions - are you handling that with a separate script?

    In your "Wrong text and image pair" screenshot, which one is wrong? Is there a pattern to the data that's wrong, i.e. the wrong image is from the item that was previously picked up?

  • edited June 28

    Are you looking to have the "Found item" menu appear over Inventory, or close the Inventory while it shows?

    I think it should be an either/or situation, as while you are in "Found item" menu everything else should be paused. It should display only on first acquisition of the item and never again, and since the inventory being open should also pause the player from interacting at all with the world I don't think there is a chance these two menus can overlap in gameplay. When Inventory is on, Found Item should be off and vice versa.

    Right now in this case it is a bit special because there is an item that I included in the player's inventory from the start as a sort of lore thing but perhaps to resolve the issue I could remove this.

    Your Console shows two items being picked up - are these being picked up at the same time?

    Apologies for the confusion, they are being picked up one after another as I was testing.

    I don't see anything related to Descriptions - are you handling that with a separate script?

    Yes correct, there is a custom property for each item created via this script :smile:

    using UnityEngine;
    using UnityEngine.UI;
    using AC;
    using TMPro;
    
    public class ShowItemLabels : MonoBehaviour
    {
    
        public GameObject slot;
        public TMP_Text labelText;
        public TMP_Text descriptionText;
    
    
        void Update()
        {
            var inventoryBox = PlayerMenus.GetElementWithName("Inventory", "ItemSlots") as MenuInventoryBox;
            var item = inventoryBox.GetItem(2);
    
            if (item != null)
            {
                labelText.text = item.GetLabel(0);
                descriptionText.text = item.GetProperty("Description").TextValue;
            }
            else
            {
                labelText.text = string.Empty;
                descriptionText.text = string.Empty;
            }
        }
    
    }
    

    In your "Wrong text and image pair" screenshot, which one is wrong? Is there a pattern to the data that's wrong, i.e. the wrong image is from the item that was previously picked up?

    You are on the money there, the first item often displays no title or description text, whereas the next item displays both correctly, and the third will show the title and description of the previous item and any item from that point will display the correct title and description of the former.

  • The script gets its text data from your Inventory menu - not the Item that's been picked up. Are you attaching this to your New Item menu?

    The tutorial's use of the Menu: Update content Action handles the display of the Item's name - no need for a script to affect that.

    For the description, create a Global string variable to act as a temporary storage for it, and use the Inventory: Property to variable Action to transfer the Inventory item parameter's Description property to this variable. You can then have your Description Label element display this Global variable - a script should not be needed to affect it's text.

  • Hi Chris, I've tried to do the global variable but I must be doing something wrong as not much has changed.

    I'm also encountering an issue where the "Empty" item keeps displaying as a newly acquired item if I open the inventory while it is empty, loading me into an Item Found screen whenever I enter or exit the inventory.

    I've included the video as well as all of my settings in the post below, I would appreciate anyone's help with this issue :) and sorry if I made some obvious mistakes, I'm still getting the hang of things!

    Video and settings

  • Remove your Show Item Labels component - we're handling this in Actions now.

    The Inventory: Property to variable Action needs its Get property of field set to Specific Item, so you can then override this value with the Inventory Item parameter.

  • Ah yes, my bad. I removed the script and all seems to work well at least for the name, now it is accurate on pickup screen. However there are still some persistent issues :

    1.) The "Empty" item keeps displaying its "Item Found" menu every time I open the inventory if there are any instances of it there. Is it possible to disable this screen on a per-item basis?

    2.) The descriptor text shows "label" which is my default string indicated in the Inventory menu instead of the updated string that is appropriate for the item.

    Interestingly, my console kept putting out an error that it could not find an inventory item with ID number X etc. even though the ID number exists. It also kept saying the same ID number when I am picking up clearly different objects from the ID number.

    Video of issue

    Description element in inventory menu

    Console errors

    Inventory items ID

    Action list

    Global events

  • Your Inventory: Property to variable is not using the parameter - you're assigning the Key item each time it's run.

    Click the "P" icon to the right of Key and select the Inventory Item parameter.

    To prevent the ActionList from running when dealing with the "Empty" item, have it begin with the ActionList: Check parameter Action, and have it compare the Inventory Item parameter with Empty. If they match, stop the ActionList.

  • Amazing, that did the trick! Everything works like a charm.

    Thanks so much Chris, I learned a lot from this :)

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.