Item actions -- how to adjust these?

I'm starting with the UCC + Ultimate Inventory integration. I've added one item definition called "Butterfly" in the "consumable" category and added it to the player's inventory. I'm attempting to implement a "consume" action, but I can't find where it's getting the "Item Action Button" action from:
I believe actions come from these definitions:
I see "Heal" coming from here:
But I don't see any any which have the "Item Action Button" defined.

I added my own ("ItemActionSet-ConsumeButterfly") and added it to the list:
But it doesn't show up in the in-game action context menu: https://i.imgur.com/du94U8i.png

I'm missing something and would greatly appreciate your help! Thank you
 
Everything you did is correct, most likely the error you mentioned in the previous post is preventing the action from being shown on screen.

I would highly recommend you duplicate the IntegrationDemoCategoryItemActions asset as it is a scriptable object in the demo folder. Updating the demo will override the changes you made.

The order of the elements in the list matters, They'll appear in the action panel in order.

Ah, I just saw something off.

In the integration "Consumable" refers to Bullets not food.
1606722841020.png

You should use another Category for healing items, for example "Health", of course you may rename those categories to your liking
 
Here's my debug action for the new "Consumable" category:
It's assigned to the item actions for my grid:

I renamed the old category "Ammo" and created a new "Consumable" category. You can see it here and the butterfly item within it:
I only see this "Item Action Button" item, but perhaps that's what the "Debug" action renders. Hard to tell, because when I click it nothing happens.

When clicking the "Butterfly" item, this error occurs as the item action fly-out appears:
 
Ah you are getting the same errors as a few other users. It's because of the Assign action for the Item Hotbar. It can't find the Item Hotbar and it's throwing an error instead of displaying a nice message as to what is wrong. It's fixed now but the update is not public yet, there are other things I need to add first.

Here is another post with the instructions to follow on how to prevent the bug from happening:
 
Okay, that finally made the proper actions show up. Thank you.

Now -- they still show up far off to the right, instead of next to the inventory icon which was clicked:
How do you make it show up next to the clicked item tile?

Thank you for your help
 
The Item Action Panel by default does not move, it stays where you've set it and gets enabled/disabled when an item is clicked.

If you whish to show the options in a position relative to an Item View Slot you can use a component called
"ItemViewSlotPanelToTooltip"

Here is an example from the demo Storage Menu:
1606984414794.png
You can set the anchor relative position and even a fixed offset (If yours look different, then it might be because I haven't made the improvements live yet. This component used to have canvas scaling issues which I fixed recently)

A new update should come out in the next few days
 
Sorry, but which game object should I attach that component to? Alternatively, which game object can I see it active on in the demo? I did some snooping but couldn't spot it.
 
You can actually set this component anywhere you want. Usually it is set on the Item View Slot (Inventory Grid) or the panel that needs to the placed in the correct spot, in your case that's the Item Action Panel.

What really matters is the references in the first two fields.
The example in the demo scene can be found in the storage menu:
1607070820117.png
The storage menu uses the same item description component for both the storage and the player inventory grid.
Here I have two tooltip components, one to detect selection on the storage Item View Slots and the other for the players Item View Slots.

I hope this helps
 
Interesting... The issue is that you show the Item Action panel on select and not on click, since the panel has a image it blocks the raycast blocking the click, so the panel is never give the item actions.

So instead of placing and showing on select (used for item description mostly), try placing and showing on click

1607244895782.png
 
I made this change and now it does show the correct height and all six buttons as expected, but only for a split second, then it disappears. Clicking again will show it for an instant, then it disappears. I tried changing the archor relative offset so the action panel will be off to the right more and not under the cursor, in case that was causing any issues, but the behavior didn't change.
 
... I'm really sorry it's taking this long to get it working.
I forgot to tell you to untick the last option "Hide Show On Deselect". When you press the item the first element in the Item Action Panel will be selected therefore the item will be deselected which will Hide the Item Action Panel.
 
Hmm, so that fixed the disappearing, but it's still glitchy.

The first time I click the butterfly item, it still shows to the right: Close it. Click item again. Now it’s on top (as expected):
In testing, I notice that even clicking an empty item tile opens the action panel: I removed the "Panel to Tooltip" component, believing this change had caused the error, but it's still happening:
So there are two issues:
1) the first click still opens off to the right.
2) any tile opens the action menu, not just the one with the item
 
Thanks for this thread - I'm working on this same thing at the moment. I'm also experiencing the panel appearing in the middle for the first time and then in the correct position off to the right.

Two additional questions:
  1. Is there a way to get the AsyncFuncActionPanelInt that shows up when you use the Assign method to also have this tooltip functionality? It's not going to like me adding an item view slot panel to tooltip component to it since it's a prefab (so I won't be able to drag in the panel to place or item view slot container). Ideas?
  2. Is there a way to get the tooltip to work with the place/show on select and hide on deselect working? When I try it with those checkboxes, the action panel just flickers in and out. Ideally I'd like to be able to hover over an item, have the action panel show up, then select an option. Or if I hover off of it or to another one, have it behave correctly.
Thanks!
 
@AndrewSidereal
You can choose whether empty slots opens the panel or not with this field:
1607431286515.png

As for the bug where the panel is not placed correctly on the first try. It is because the Awake function was not called yet. You can avoid this by leaving the gameobject active in the scene.

I found a solution that would make it work even if the object is not active before it is used, the fix will be in the next update


@cptscrimshaw

For the first question that's not possible yet. I will look into a possible solution in the future
EDIT: Maybe you could create a new Assign Item Action try to place the panel manually. I'm not sure how easy/hard that would be though

For the second question. The Deselect will happen as soon as you deselect the item... so what you are trying to do wouldn't work with the current setup. We would need to have a condition for if the item is deselected and that the new selection is not the item action.
I'm afraid you would need to create a custom tooltip script for that.

I'll add both of these in my todo list such that I do not forget, but it may take a while before I get to them because they won't make the next update, I'm sorry
 
Last edited:
Great -- the "Disable Action on Empty Slot" worked as expected. It probably makes sense to default this to 'true' as showing actions for an empty item seems nonsensical.

Regarding the "enabled" status -- it is currently enabled but still showing the incorrect alignment on first click: I may have misunderstood. What should I adjust?
 
I meant the gameobject with the Tooltip component.
Usually that's on the same gameobject as your Item Action Panel.

The update is live now so you can download v1.1.2 if you wish. You'll still need to have the tooltip component and the Item Action Panel on the same game object for it to work
 
Top