I am creating a tooltip widget for my character’s inventory hud.
If I print string of the item reference before added to inventory? Correct.
If I print string of the reference after it has been passed to inventory? Correct.
If I pass the info to the tooltip hud when it’s created the info will not display in the hud and now every value for the weapon item is the default.
But it’s only the tooltip widget which does not display the info correctly. All other aspects of my inventory display it correctly and will work; just not the tooltip.
The good news is that a setup like this should definitely work.
Could you confirm that this very function prints? Perhaps print the Weapon Type - just to see the correct data gets into the widget in the first place.
I just checked all 3 areas where the info is being passed.
When the item is added to inventory ti checks out, and then passes the reference to the slot hud via a custom event. The slot hud only utilizes the weapon name and then passes the reference to the tooltip hud on it’s creation. I’m thinking this is where it breaks down.
Since I’m using a custom event maybe the tooltip hud is being created before the event can fire?
I’m gonna grab some screenshots right quick to better illustrate what I mean…
It will then run the “setup weapon info” event which literally just takes the reference of the weapon and sets it in the slot hud.
It uses that reference to create the tooltip widget we see at the very top of this post. Somewhere along the way the reference just isn’t getting passed correctly or something… Thanks for your help thus far.
Hard to say where it breaks down looking at these. The very fact that the tooltip both prints and displays data, albeit the defaults, indicates that a valid reference is passed.
My guess is it’s either the incorrect reference (as in, another weapon object or a base class if that’s at all possible). Or it’s the item_struct. Do you, at any point, alter the data in the struct?
If all else fails, you may need to manually place Prints at every junction and follow the breadcrumbs manually. It’s a disheartening task.
I do not have an answer for that. The technique you’re trying to implement generally works well. Tooltip widgets mesh well with Getter functionality but can also be directly fed reference chains like so: