Trigger custom event in UMG widget from Player Character

I knopw there are many similar requests in the forums. I have read documentation but I am still confused.

I am trying to trigger a custom event that lives in a widget UMG from the player character when I press a button.

I get error accessed none.

I THINK i need to bind something to the custom event but i am not sure how.

Here are the screen shots of what I have now.

Any help with greatly appreciated!

How are you setting “Item Data Widget”?

I am setting it inside of the Player Character BluePrint as Object Reference.

By setting, I mean assigning a value, a reference to the widget? This should be the widget you create with “Create Widget” and then added it to the viewport.

Ahhhhh Well technically, the itemDATA widget is created for each item pulled from my player characters inventory INSIDE the inventory widget.

I currently am using a branch to load different class types into separate “windows/vertical boxes”, I will eventually do a filter array by class but this was beginning stages so i am still evolving the idea to work as I get better with blueprint scripting.

Thanks!

I think I am also starting to see a flaw in my logic. even if this works, its going to run the update quantity on ALL the active itemData Widgets. I need to also figure out how to make sure the selected item is the one i am referencing. :head desk:

2 things to note:
Your remove item function is not being told what to remove. (the reference you have there is not valid, and could really be anything).
and
You may be better off implementing a blueprint interface for it, so that you are forced to use a standardized signature with proper references to remove the correct item.

also, what does the door open thing have to do with the menu? wrong image upload?

What I am really trying to do is just alter the value of an items Structure data. I want to be able to change the quantity of the item. I am able to get the quantity to stack on each item pickup. But dropping has been hell.

The door branch check is because I am using the same button “button face left” to interact with items, doors and NPCs etc. I may change that but I like having one button to interact. so depending on circumstances it will perform different interactions (has been working so far but i may change it)

I am not 100% knowledgeable on interfaces. I am using an interface for interacting with items and doors, how would I implement an interface to interact with the widget and changing the quantity of the stacked items? sorry this may be next level stuff and I am unprepared experience wise to implement what I am thinking of…

Thanks for your help!

the gist of what i am trying to accomplish:

Basically the same idea.
you create the interface, you add it to the widget, and you create the proper function for it that does what you need it to do.

In the case of something as simple as altering a quantity you probably set up the function to have 2 references, one for the object and one for the quantity.

Like the other interfaces, you can then just call the function with the proper hooked up information. Maybe something like the object and a -1 in this case.

You do however have a deeper issue. It seems you have no way to actually determine what the object to pass may be.
seems, because we can’t know what you think or the rest of your code.

I would suggest that this information can probably be gathered from the selection you do before clicking a button by finding what it is that has focus…

yea… i might have to scrap and start anew…

update, so I am able to trigger a custom event in the inventory itself and referencing the has focus item by comparing the focused items index to the inventory and print its name and that’s working so far. I guess i have to work with whats there and see where i can take it.

So I gave a worst case scenario A TRY.

in the itemDATA widget, I passed ALL the item info structure slots as variables set in the itemDATA widget through to the inventory window via inputs on a custom event. i then stored those variables in the itemDATA widget in the inventory widget as variables with matching names and types.

I then set the item data variable in the inventory widget to capture the individual variables for each item to store as item data variable.

it now works!!! LOL

The final outcome of all that craziness
https://i.ibb.co/QFzRRmD/ezgif-4-c34de981b8ca.gif

Thanks for everyone’s help!