Forum rules - please read before posting.

Inventory items as conversation choices

My game has picture-based conversations - no text, labels, nothing. If you have played Broken Sword games, you know what I'm talking about. This has the benefit of creating "surprising" dialogue - based on visual response, when the player doesn't have to and can't read everything beforehand.

My inventory appears via mouseover on the top of the screen. When engaged in a conversation, the conversation option icons appear from the bottom of the screen. In addition to whatever the conversation options are at the time of conversation, I need to have the current inventory items to be selectable for conversation also.

Visually I've succesfully achieved some of this by copying the inventory (hacky) and setting the copy's appearing type to be "During conversation". Now I can see and hover the items, but clicking them does of course nothing as they are not a part of the actual conversation in any way.

I found an earlier thread concerning this topic and there were some talk about an option to automatically including the current inventory items as choices. I could of course toggle each picked up item as a conversation choice but as you can imagine, this would require huge amount of manual work and I'd really like the inventory to be a separate entity at the top of the screen.

Is there a way to automatically include inventory in all conversations as choices?

Thanks!
Andy

Comments

  • The first step would be to have the options showing up in a single place.

    A Conversation's Dialogue option has a Only show if carrying specific inventory item? property. If you create both inventory item topics as regular Converation Dialogue options, you can set them to only show if the Player is carrying their associated items.

    Next, you'd have to have a way to move these items to the top of the screen.

    This would involve some custom scripting, but the first thing to do would be to determine exactly which buttons need to be re-positioned. This can be done within the OnMenuTurnOn custom event (similar to the snippet I posted in your other thread):

    private void OnEnable () { EventManager.OnMenuTurnOn += OnMenuTurnOn; }
    
    private void OnDisable () { EventManager.OnMenuTurnOn -= OnMenuTurnOn; }
    
    private void OnMenuTurnOn (Menu menu, bool isInstant)
    {
        if (menu.title == "Conversation")
        {
            MenuDialogList dialogList = menu.GetElementWithName ("DialogList") as MenuDialogList;
            for (int i=0; i<dialogList.GetNumSlots (); i++)
            {
                bool isInventoryLinked = dialogList.GetDialogueOption (i).linkToInventory;
                UnityEngine.UI.Button linkedButton = dialogList.uiSlots[i].uiButton;
                // Update the Button's position accordingly
            }
        }
    }
    
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.