Welcome back everyone in this video, our goal is to create a means of messaging our HUD that our slotted white magic here is no longer ready and that it's actually being used. So we're going to be working in a couple of blueprints here you see me inside of my w BP HUD up here. Also our BP player if you don't remember how to get to these assets, how to get to our w BP HUD is this directory right here, double click on it to open it up. And to get to our BP player, that is this directory, double click on the BP player to open it up. We're going to start off inside of our BP player. And we're going to add something inside of our BP player known as an Event Dispatcher in over in the My Blueprint panel way at the bottom, we've got something called Event dispatchers.
I heard event dispatchers described by Zachary Parrish. And unreal is kinda like Twitter. Basically, what it allows you to do is communicate between blueprints. There is a Tweeter, so to speak. In this case, our BP player is going to be able to send out a tweet. And any listeners, that is subscribers to a Twitter account can pick up on that message and then do something.
So here inside of our BP player, we're going to add an Event Dispatcher by clicking this plus Event Dispatcher. We're gonna call this toggle w magic ready? message. So this is kind of like saying, Hey, we just established a Twitter account. Okay. Next one I want to do is here inside of our white magic tab.
We're where we were creating a This script in the previous video, we're going to come off of where we are updating our manner. And we're going to continue on here a little bit. We're going to add a sequence node by holding down the S key and left clicking. After we update the manner in this whole chain, when we are trying to use our Lens of Truth, which this is still remaining a hookup to initiate that by the way, we're going to update the manner and we got a sequence node here and I'm going to add a couple more pins on this because eventually we're going to be doing multiple things off of the then zero pin. I want to bring in our w magic ready. Let's drag off of this and type in w magic.
Ready. We've got this up Boolean variable, it's in our player info category over here. b w magic ready. So that's another way we can find it. I want to set this We're going to set this to false because it is no longer ready, it is being used at this point. Then after this, I want to bring in our Event Dispatcher here that we just created this toggle w magic ready message.
We're going to drag it into our graph like this. And it's going to give us a little sub menu here. What do we want to do? Well, we want to call this we're going to call this so think of this as our BP player, just establish a Twitter account right here. And now they are sending out a tweet to anyone who is going to be subscribing to their, their Twitter feed here, okay. So after this, we are then going to find that function that we just created our lens FX on, drag that into the graph, and we're going to play our lens FX on function.
Okay, so this video Right here, I'll just left click and drag, tap the C key and call this Lens of Truth on. Okay, so with that done, let's compile in save. And now we are ready to move on to to our w. b p HUD. So again, here in our BP player, we established our Twitter account so to speak, and here we're sending out a tweet. Okay. Now we want our w BP HUD to pee to be able to listen out and receive that message.
So jump on over to our w BP HUD. Let's jump on over to our Graph tab. Currently, I got over to this function, we want to get over to the Event Graph portion of our tab. Okay, so we've got this event construct going on here. We got a few things going off of our event construct reference to the player playing some HUD animations. I want to build off of This sequence note here this then to pin.
So I'm just gonna bring these on down a little bit just for ease of access. And what I want to do is I want to drag in a reference to my player. So under the variable section appears where we created a reference to our players stored in a variable. Under our variable section, we can find our player. So I'm going to drag him into the graph, right here, get the player and out of our player, I'm going to drag out a wire and type in a sign w actually assigned toggle here is our assign toggle w magic ready message. This is the Event Dispatcher that we just created inside of our BP player.
So when I click on this, it's gonna bring in two nodes. It's gonna bring in a bind node and a custom event node, and it gives us this name right off the bat which I'm going to be fine with And what this is going to allow us to do off of event construct. If we wire this in here, what we've just done here is we have said we have basically made it so that our w BP, HUD is now subscribed to this Twitter account. Our player set up that Twitter account that we called toggle w magic ready message. And upon this web hook getting constructed, it's going to listen out for any tweets that come from that Event Dispatcher that is getting called currently right here in our BP player. So when this gets called over in our BP player, our w BP HUD is going to pick up on that and then it will fire out of here to do some script.
So what do we want to have happen? Well, after we drag off here, I'm gonna bring in a flip flop node and a flip flop. Note if you don't know how it works the first time this event gets called it'll go out a then the second time it gets called it'll fire out a B than a than B with every subsequent calling of this message here. And out of the a message, or the a pin, I should say I'm going to drag out a wire and type in set visibility. And I want to set the visibility of our w magic ready? w magic ready?
Where is it w magic. Ready w magic ready? Don't see it. Let me jump back to my Designer tab. My w magic ready text. So there it is W magic ready.
I've got it selected here. And the reason I don't see it over my graph here is because I do not have EAS variable checked here. So let's go ahead and check that. And now that we have is variable checked over in the graph, we can find w Magic ready? Where is it? w Oh, we call the W magic texted me not Yes, W magic txt.
So that's the one we're looking to bring on over. We're gonna get that. We're gonna plug that in as the target. And we're going to say that we want you to become hidden. Like so. Also, I'm going to bring in a reference to our w magic button here.
Get that because we want that to be hidden at this point, as well. However, the second time that we get this message call, we want to do something else. Remember the first time that we receive this tweet. It's going to set the visibility now of our ready text and our ready button, that is this left trigger button right here. It's gonna set them to Hidden, they're gonna go by by the second time this is going to get called, we want to do the opposite, we want to make them visible. So I'm going to duplicate this set visibility function right here, I'm gonna hit Control C, Control V, out of the B plug this in here, set the invisibility now to be visible, and both of these will be plugged into the target.
Now, right now, the only time that this is going to be receiving a tweet is right here in our BP player, we just sent out this message earlier from this portion of script. In a few videos time, we're going to be making another call to toggle the W magic ready message to essentially fire this out again so that we then fire out of the B output. So for now, we've only got it set up to call this one time and to set this hidden But eventually, we will set this back to be visible, you're just gonna have to be patient and wait for a few more videos. Okay, so after our set visibility down here, I want to do one more thing I'm going to drag off and say plays sound, 2d. This is just a little sound effect to accompany this. And the sound effect that I want to put in here is going to be click on button Q, this is an engine content sounds.
So again, if you don't have that available to you, make sure you are showing engine content and you will have it as well. Okay, so with that, let me just kind of bring these nodes down a little bit. going to left click drag out, tap the C key, put a comment box around all this that says sets. white magic ready? message and button on the HUD sure I'll set this to be green as well just to be consistent with what I've done before here. Okay, and finally, let's go ahead and compile, see if we made any mistakes here and save.
And that's going to do it all for part number two of our lens scripting still plenty more to be done. But that will come see you in the next video.