Select differents elements from an array

Howdy!

So I have this BP where you can read a wooden sign and I want to store all the text possibilities for the sign in an array and choose which one pops up when placing the sign in the world. I made an editable int in the sign BP to be able to select which text pops up from the sign, but the problem is if I put more than one sign in the world they all display the same message. Can’t tell what I’m doing wrong this time.

Thanks for wasting your time helping me.

For each sign you are looping over the list of all signs and returning the String of the first sign.

When you click to read the sign, you need to pass the Txtnb of the sign you’re reading to the widget and Get that index from the list of Text options.

Don’t loop over a list of all of the Signs.

Yeah I watched it a while ago, rewatching can’t do any harm.

Well after watching it completely this time I’m even more clueless than ever.

I meant I know that GetAllActorsOfClass is far from being the best thing to use, but I can’t use event dispatcher direct bp communication won’t work through overlaps and BP interfaces just plain suck. All of this due to the fact that I’m trying to communicate between a function in a widget and a blueprint. Simply getting a reference of the sign BP is what I tried first and led me nowhere too.

Your pro tip makes sense though, why do I always have to overthink things ?

Oh I got confused with the wrong term then. My bad.

Here’s the screengrab :

Didn’t know that exposed method. Good to know, thanks. I don’t quite get why you want me to set a reference of my sign bp in my sign bp though.

Oh yeah now I get what you mean. I’m getting tired, doesn’t take much to lose me today hehe. Anyways now I get it, and the exposed on spawn works wonders. Thanks a bunch mate.

Thats what you doing wrong. Node name should be clue enough I guess :stuck_out_tongue_winking_eye:

Here some BP Communication Training Session to get you up to Speed.

Your Probably have something like a Linetrace or Overlap that returns you a Sign after you Cast to it. Probably in your Player Character. Than you create that Widget Pass that refference along (You exposed it on Spawn there should be a Pin now) and Add it to the Viewport. Call it a Day :stuck_out_tongue_winking_eye:

Pro Tip: Make a Text Variable on your Sign and use that directly instead of the Index. Why you bother to keep track of them in the Widget BP? Read it directly from where it comes → The Sign.

Also Watch it again and play around with what you learn. Make a throw away Project and simply Practise and experiment throwing Data around from BP to BP in the various ways. Refer back to the Video if you got trouble listen very closly to what Zak says he does explain it very well =)

The Answer I Posted is the Way to directly Communicate. The Problem you got with GetAllActorsOfClass you have to manually filter out the Specific sign you want and thats as effective as creating a new Widget for Every Sign you have + the Overhead of Filtering. (btw dont try it not worth at all)

Can you screengrab the BP where you Create your Widget and the Nodes that come before?

If I’m understanding you correctly, the player approaches the sign, interacts with that sign in some fashion and a message is displayed?

Well that makes things easy xD Expose your BPSignVar as I showed in the Last screen inside your Widget.

The thing you see after the Create Widget is how you set it via Ref (You dont need todo that if you use the Exposed Method, also forgot that you have to input self there as well)

In your Widget :stuck_out_tongue_winking_eye: Not your SignBP! If you are confused about the Node that comes after simply start typing the name of the Refference Var Name you set in the Widget. I think you get what I mean once you try (but again you dont have to it will just set it twice would make no difference, but thats a Example how direct Communication Works)