Welcome back.
So we now know that we can set these values in our text value row.
We can set the label and we can set the numerical value for any of these.
Right now, we've bound to a delegate here and text value button row where we're setting the label text
and the numerical value integer.
But really we should check the incoming attribute tag and see exactly what that is and if we're checking
it, well, what do we check against?
We need a value to check against.
We need some kind of information tag.
It can be an attribute tag, but really it's just a game play tag.
And if we go back and look at our attribute menu, each of these rows is a widget that needs its own
attribute tag.
But what about this one up here?
This isn't for an attribute.
This is for attribute points, something we haven't implemented yet, but we will.
And that's not exactly an attribute, but we'll handle this case later.
For now, each of these widgets should get a gameplay tag for its attribute and it should check to see
if the incoming attribute is the attribute assigned to it.
So that means I'd like to go all the way to the parent class here.
This one, the text value row class, the one that doesn't have the button, which is not the one that
we used to bind, but the other one text value row this one and I'd like to give it a variable of type
gameplay tag.
So in the graph we're going to add the variable right here in blueprint add variable, and we're going
to call this attribute tag.
We're going to change its type.
We're going to search for gameplay tag and choose gameplay tag and compile.
So we now have this attribute tag.
Let's check the eye icon, make sure it's set to public editable and that way we can go back to our
attribute menu and set the tag for all of these.
Now to know which one is which, I'm going to rename them.
I'm going to select this row and instead of letting it be called text value button row, I'm going to
click right click and rename and call this one strength row.
No, let's call it row underscore strength.
And I'm going to copy row underscore so I can rename the others.
Let's get the next one.
I'm going to rename this one to row underscore intelligence.
Next one will be row underscore resilience and next will be row underscore vigor.
And then we need to get all these ones in the scroll box.
We got quite a few, don't we?
So let's name these accordingly so we know which one is which.
This one we can call row armor.
Next will be row armor penetration.
Next will be block chance.
So row.
Block chance.
This one will be ro critical hit chance.
Next one row critical hit resistance.
No damage.
Critical hit damage.
Next one is resistance.
Critical hit resistance.
Next one is health regeneration.
Next is mana regeneration.
Next, we have max health.
And finally, we have Ro.
Max Mana.
And I know what you're thinking.
I forgot the ro underscore for this one.
So fixing that.
Okay, now all of these rows have names and we can easily know what they are.
Now we're going to want to set their tags, their attribute tags, which means, as I was renaming them,
I should have checked is variable on each of them.
You live and you learn, I'm going to go ahead and do it manually.
So selecting row strength checking is variable.
In fact, I probably should be able to hold control and just click on these.
Like so and check is variable.
And yes, they're now all set to as variable.
Let's compile and save and we'll go back to the graph.
And here, as soon as our widget controller is set for the attribute menu, we're broadcasting initial
values, right?
We need to make sure that all of these widgets have their attribute tags set before broadcasting initial
values.
So that's kind of one of the first things I want to do.
So here's what I'm going to do.
Let's get those nodes out of the way.
Let's get this event destruct up here and out of the way.
And I'm going to use a sequence node to organize this a bit more.
So sequence.
The first thing is binding to on clicked for our close button.
We'll get that out of the way there.
And next is setting our widget controller.
And then next is broadcasting initial values.
Before this step, let's actually add a pin.
This will be then two.
And before this step, we're going to set all the gameplay tags, the attribute tags for these rows.
So for that I'd like to make a function.
So I'm going to click add function and call this set attribute tags and we'll set all the attribute
tags and we'll call this right here set attribute tags.
Boom.
And in set attribute tags, we need to get all of these rows and set their tags.
So I'd like the primary tags kind of off to the side.
So I'm going to hold control and click and drag out strength, intelligence, resilience and vigor.
I'll get those right there and then I'd like all the rest of them.
So we have armor penetration block chance and so on.
Let's get these all out.
So starting up at the top, we have armor.
Armor penetration blocked chance.
The three critical hit ones.
Chance damage and resistance.
Health Regeneration.
Mana Regeneration.
Max Health.
Max Mana.
So we got them all.
And each of these needs to have their tag set so we can use a sequence that'll probably make things
a little less painful here.
So I'm going to go ahead and do that.
We'll do a sequence and let's handle the primary attributes first.
So we're going to take row strength.
And we're going to set its attribute tag.
So searching for attribute tag, we're going to set that for the strength.
And we can set it directly right here.
Two attributes Primary strength.
And there we go.
And we have to do this for all of them.
So I'm going to time lapse the rest of these.
All I'm doing is repeating the process, starting with strength and ending all the way down here at
Max Mana.
So let's time lapse this.
Okay, So I set all of these.
I made two sequences.
And in fact, I'm going to have actually, I think, one splitting sequence right here in the very beginning.
So we're going to say sequence with the first one, which is only going to set the primary attributes.
So I don't need this one.
So this one is only the primary attributes.
And then the second one, which will go down to this one.
So three sequences total, one that splits off into two.
The first one is up here with the primary attributes and then the second one down here has zero through
nine.
So our ten secondary attributes right there.
So it's kind of a lot, but hey, we have a lot of attributes, so that's okay.
If you highlight three of them and press Q, it'll straighten them up.
So.
Q.
We can do that on all of them if we want a little bit more.
Sort of order here like so and really we can just comment them all.
But that's just about all we can do.
I'm going to go ahead and comment them.
I'm going to say see secondary
attributes.
Zooming in.
And of course, I misspelled it there.
Okay, cool.
So, yeah, that's the function that will set all the attribute tags.
And now that we're setting these, each of our widgets that at least derive from text value, row this
widget, they have an attribute tag.
So where we bound to attribute info delegate here in text value button row, we can now check that attribute
tag.
We can say matches tag.
We can check exact match and we can check if that attribute tag matches.
Attribute tag.
This is that variable.
Belonging to this widget class and we can only set the label and the numerical value.
If that's the case, so we can plug that into a branch.
And now this event will only set those values if.
The incoming attribute tag matches this widget's tag.
So if we press play and open the attribute menu, look at this.
Only strength is being updated.
The rest of them, they're checking the attribute tag and it's not their tag.
This one has intelligence for its tag and so on.
So now only strength gets those values and that's great.
Now we bound to that and this text value button row, but we want to bind to it in text value row,
right?
Because our attribute menu has secondary attributes and those are just the text value row without the
button.
So let's take this out of text value button row.
Let's go ahead and just copy these nodes here.
And we'll go to text value button row.
We'll go to the event graph and we'll do this in event construct.
So let's get event pre construct out of the way.
Actually, we'll move event construct down.
I'm going to delete event tick and from event construct, let's see what we did here.
We got the attribute menu Widget Controller.
So let's do that here.
We'll say Git attribute menu widget controller passing in a reference to self.
We need that world context object.
And what did we do?
We bound to attribute info delegate.
So let's do that.
Here we're going to say assign attribute info delegate.
We have an event now.
And now we can control V.
I don't know if you still have yours copied, but I copied these nodes here.
Control V and the info will be broken.
So break attribute info and we're checking against the attribute tag here.
And then plug in that into branch.
The branch will branch off of whether or not the attribute tag matches.
So we can organize this a little better.
We can have attribute tag there.
We can have the text for the label there like so and that looks great.
Compile and save that.
Now, here's the thing.
We're only.
Saving all.
By the way.
We're only broadcasting for strength.
Remember?
So only strength is showing up.
We're not broadcasting for any of the other attributes.
I'm going to close out of the editor and just remind you, here's attribute menu Widget Controller.
We're only broadcasting the strength because we're only finding that attribute here in broadcast initial
values.
And you may imagine that this could be quite tedious if we had to go through and do this over and over
again for every single attribute we have.
That's one way to do it.
We could do it that way, but we like more robust code.
We like more flexible systems that are not rigid.
I don't want to have to.
Every time I add a new attribute to my attribute set, I don't want to have to come in here and change
the code here.
I'm already going to have to add more to my attribute menu, more rows to it, and assign those attribute
tags.
That's enough for me.
I don't want to have to come in here and change the code and add more and more lines every time.
I'd rather be able to do something along the lines of have a for loop here, right?
A for loop or some kind of loop that can do the same thing for every attribute.
That would be really, really nice.
Now before we do it and we're going to do that in the videos to come, I want you to kind of brainstorm.
How can we make that happen?
It's kind of a tricky problem to solve in this case.
So think it over a little bit.
Give it a few minutes.
Think about how you would make this a little bit more automated, a little bit more flexible, something
like a for loop or any kind of way to automatically broadcast all the values of all the attributes without
having to point them out by name one by one.
It's a little bit tricky.
So give it some thought and we'll do that in the videos to come.
So great job and I'll see you soon.