Forum rules - please read before posting.

Tie my container to my inventorybox menu

I have created a container in the Logic / Containers folder.

I have also create a new menu in the menu manager that I want to use specifically for the above container.

I have a hot spot that when you go to it the action is container open.

Is there a way to tie them together?

I am going to have several locations where I want to open containers and have custom menu UI for each.

Comments

  • I also forgot another part to this. In this container dialog I have my own section of the dialog that I want to be the player's inventory.
  • I keep posting and then thinking of more things that might help describe what I am trying to do. Sorry for all the comments.

    I have several areas of my ship where the player can store stuff. I have a very specific UI that I want to use. I am trying to recreate a game from back in the 1980's, so I really want it to look a certain way.

    Anyway, when the user goes to one container there will be 4 slots on the left side of the UI that are the player's "on person" inventory.

    The right side is the area of the container. The user can drag and drop between the 2.

    Now when the player goes to a different container again the left area has 4 slots for the "on person" inventory and the right side is the container.

    The player can drag stuff from the "on person" area to the container area.

    I also customized the pause menu. When you are in the pause menu the area on the left has those same 4 slots that are the "on person" inventory area.

    I am not using the normal inventory bar at the top of the screen at all.

    There is also a slot on the left side for the user to "eat" stuff. I need to know how to deal with that.

    There is also a slot on the left side for the user to hold something. Based on what they are holding they can do things like shoot.

    Let me know if there are ways to handle these things. They are key to my game. I have a feeling there is a way because AC is so very cool and flexible. Great job!
  • Please post separate issues/questions in separate threads, along with clear explanations - you haven't fully described how the slot on the left to "eat" stuff works, for example.  Let's stick to the original question in this thread.

    A Container can be opened by using the Container: Open Action in your Hotspot's Interaction list.  The behaviour of moving items between your own Inventory and the Container is already provided in the default "Container" Menu - I would recommend getting your functionality correct before concerning with appearance.  If you want to enable drag-drop inventory, you can do so within the Settings Manager.
  • Ok, we can worry about the eat thing later then.

    I am using Container: Open on my hot spot. It opens the default inventory drag drop interface.

    I looked in the settings manager and see a check box for drag drop interface. I check it and it just shows a slider for drag distance.

    I don't know if I am confusing the issue here. The main thing is wanting to customize the interface.

    To keep it to the point I want to customize the interface.

    I will have several container's at different locations. How do I customize what it looks like when I perform the open container.

    I read the tutorial on customizing the Inventory and have that working. How do I customize the UI for containers?
  • What I am trying to understand is how to connect things.

    I created a new menu item for my own container. I put 2 inventory boxes on it. I set up the buttons for the slots.

    When I looked at the default container I see something called ContainerItems and something called PlayerInventory. The only diff is ContainerItems type is container and PlayerInventory is Default. I assume that is how I tell the system which is the container and which is the player inventory. So far ok.

    What I am stuck on is how do I replace the menu item that gets open when I use Container: Open as an action?

    I tried a different route. I decided to try replacing the functionality in the default Container menu item.

    Now my UI is the one that shows, but it doesn't work right. I have the container default to having 5 of a certain item. When I run my game all 5 show up in the first slot, but no number. If I click on it all 5 move to my player inventory slots. That is a problem because I only allow 4 items in player inventory. It is a limited number allowed and this is important.

    If I then click on one of the items in player inventory and try to click it over to the container, it just stays in the player inventory. I can't seem to move the items back and forth like in the default container UI.

    Sorry I am having such trouble. This system is both wonderful and complicated at the same time.
  • I answered one of my questions. I found the Appear Type setting. This must be how I set my own menu to appear when there is a container open action.
  • I have looked at the default ContainerUI prefab. I assume this is the one that gets used if the menu source is set to Adventure Creator.

    I have made my container UI have the same elements as the default one, but can't get it to work the same way. The main difference is when I click an item in player inventory it attached to the cursor, but when I click on a container slot the item just goes back to the player inventory.

    Any ideas why I can't take an item from inventory to container? I tried really hard to make mine have everything the same as the default ContainerUI prefab except for the look and where everything is.
  • The ContainerUI is used when you have your Source set to Unity Ui Prefab or Unity Ui In Scene - when you have it set to Adventure Creator, you design your Menu entirely from within the Menu Manager while previewing it in the Game window.

    Keep your Source set to Adventure Creator while building the functionality - it's best for prototyping, though you'll likely want to move onto Unity UI Prefab when you're ready to fine-tune it's appearance.

    Linking a Unity UI to an AC Menu involves connecting each element up in the Menu Manager (see this tutorial), which is an additional step so you should first become familiar with how the "AC standard" Menu system works.

    If you have multiple Container Menus, and want to control which one opens, you have to lock all those that you don't want to appear.  You can lock Menus by default in their list of properties, and lock/unlock them while your game is running by using the Menu: Change state Action.
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.