What's wrong with my widgets?

I’m having problems with two widgets I’ve been working on (well, three+ technically, but we’ll get to that).

I.

The first one is a name tag widget that appears whenever the player looks at something nameworthy. The way I have it set up, it’s always there but hidden, it just gets its visibility changed when your ray trace hits something with the right component attached to it.

Here’s the logic that determines whether the thing you’re looking at should cause its visibility to change:

Here’s the logic that i. creates it, ii. makes it visible when you’re looking at an appropriate actor, and iii. makes it hidden when you’re not

The issue that I’m having is that when you initiate conversation with an NPC, I can’t change the visibility of this widget to make it hidden and it just shows up behind the dialog widget.

I’ve tried plugging in nodes after the nodes that check the visibility of the dialog box but before the ones that make it visible and pause the game that change the visibility of the name tag, but that doesn’t do anything.

I thought that maybe the ray trace is going through the widget so I’ve tried to add a bunch of convoluted boolean logic to the front end where it decides whether the thing it’s looking at should make it display (such that, if the dialog box is visible, and it’s looking at something that would otherwise make it visible, collapse the name tag).

I have the dialog box set to Not Hit testable (Self only), but it was originally just visible, so I would expect that to stop the ray tracing if that’s the issue. On that note, I also played around with the Z order a bunch, but it doesn’t seem to be doing anything.

That’s about all I can think of to try to handle this situation; the only thing left that I can think of is that there’s something in the logic itself that I’m not seeing that is causing this.

II.

The second one is the dialogue box itself.

The way this one is built is like this:

The scroll box is the one on the left, which is important to know because there is logic that essentially takes a table attached to the NPC you talk to, look up all the row names in the table, then create text widgets and make them children of the scroll box.

Eventually, I’m going to figure out how to make it so that for each of these widgets, when you click on it, it changes the text in the big box to whatever the content of the row is. That’s a challenge for later, however, because I have a stupider problem.

I don’t seem to be able to click on these widgets. In order to test whether I can actually click on them or not, I set it up so that upon clicking on one of them, I should trigger a print string node and remove the widget from parent (ought to be very easy to tell if it’s working).

However, it’s not. I can tell that the mouse at least recognizes the widget because I added tool tip text to appear when I hover over the widgets, which you can see below.

Again, with this issue, I’ve tried a few things.

I know for sure that the big dialog box is set to Not hit testable (self only), I know it’s got a lower Z order than the topic name widgets. I checked the Player HUD widget that comes in the starter content by default and made sure that one is not hit testable as well. I’ve got clickable events enabled on the player controller, and when the dialog box appears, it sets it the input to game mode and UI. So, again, I’ve exhausted my limited knowledge of widgets on this one.

Any help with these would be greatly appreciated, of course. To the extent that it matters, II. is a priority to me because it’s not just cosmetic and it’s actually impeding the development of this system.

Thanks to all.

1 Like

I think your logic is faulty. The looker can send the ‘I’m looking’ message, but it can’t send the ‘I’ve looked away’ message.

Consider the scenario when the looker is inspecting actorA and then the line trace moves smoothly to actorB, you never get to say to actorA ‘I’ve looked away’.

Also, what may be happening here, is you never get to say you’ve looked away because of the widget, for some reason.

It would work better, if the code for inspected items set a timer, and told itself you had looked away after a certain amount of time. If you look again during that time, it can just reset the timer.

I’m not sure if that’s an issue. The name tag goes away when you stop looking at an object, and it does just fine picking up the name of the second object.

Give it a go, very simple version with a delay node :slight_smile:

Try using your system with a box on a table, and you want to be able to interact with both of them…

So, I still need help with these, in case there are any widget experts our there

Hey @davi1521!

In regards to your name tag widget, I agree with @ClockworkOcean. For example, I am not sure where you are calling your look at function, but you can simply check if you can show the widget/interaction via the player or other means and use a repeatable delay to check if you can still see the widget before closing.

Take the below for example. In this crude example, the function is called on a timer of .05 with a re-triggerable delay of .1. This should only display your visibility when the can display condition is true, but will turn off and then back on when entering and leaving the dialogue, so long as you update the bool, which is what it seems like you you are wanting in this case.

1 Like

Okay , that’s cool and all, and I appreciate the advice, but it’s not the answer to either of the questions I actually asked. I’m really hoping someone can lend me some more insight on why I can’t click these widgets in II

If you try it, you will get information…

@ClockworkOcean Oh, yeah, I see; I thought we were still talking about the nametag going from one object to another. as it so happens, using a Repeatable Delay node was actually how I managed to smooth that out. My apologies

This is working okay; it seems like I can’t change the name tag’s visibility when the game is paused, so what I’m doing is setting up a branch in front of the ray trace that it only creates the ray trace line when the cursor is not showing. Now I have a half-second delay after the appearance of the cursor and the appearance of the dialogue box, during which time the name tag disappears once the ray trace stops. It’s not immediate, so that’s the quickest I could make it. Not ideal, but it works

1 Like

Hey @davi1521,

If the problem is pausing, there is the “Set Tickable when Paused” node. Depending on how specifically you set up the actors to do the checks, this could be what you need.

image

It’s a good idea and I’m glad to now know this node exists, but, unfortunately, it doesn’t take widgets as arguments.

I finally figured it out. The issue was here:

I wasn’t adding the widgets themselves to the scroll box, I was just adding the TXT component. So, when you go into the dialog box and click on them, what you click on doesn’t even have that OnClick event on it.

What I needed to do was not drag the pin out form the TXTNPCDialogueTopic node, but pull it right out fro mthe Return Value of the Create Widget node.

I feel like both a genius and an idiot.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.