WEBVTT

00:06.980 --> 00:08.180
Welcome back.

00:08.180 --> 00:14.270
So we now know that we can set these values in our text value row.

00:14.300 --> 00:20.400
We can set the label and we can set the numerical value for any of these.

00:20.420 --> 00:29.750
Right now, we've bound to a delegate here and text value button row where we're setting the label text

00:29.750 --> 00:32.030
and the numerical value integer.

00:32.390 --> 00:40.430
But really we should check the incoming attribute tag and see exactly what that is and if we're checking

00:40.430 --> 00:42.440
it, well, what do we check against?

00:42.470 --> 00:45.120
We need a value to check against.

00:45.140 --> 00:48.840
We need some kind of information tag.

00:48.860 --> 00:52.880
It can be an attribute tag, but really it's just a game play tag.

00:52.880 --> 00:59.690
And if we go back and look at our attribute menu, each of these rows is a widget that needs its own

00:59.690 --> 01:00.680
attribute tag.

01:00.680 --> 01:02.270
But what about this one up here?

01:02.270 --> 01:03.770
This isn't for an attribute.

01:03.770 --> 01:08.610
This is for attribute points, something we haven't implemented yet, but we will.

01:08.610 --> 01:13.170
And that's not exactly an attribute, but we'll handle this case later.

01:13.170 --> 01:22.050
For now, each of these widgets should get a gameplay tag for its attribute and it should check to see

01:22.050 --> 01:25.770
if the incoming attribute is the attribute assigned to it.

01:25.770 --> 01:29.550
So that means I'd like to go all the way to the parent class here.

01:29.550 --> 01:36.540
This one, the text value row class, the one that doesn't have the button, which is not the one that

01:36.540 --> 01:43.890
we used to bind, but the other one text value row this one and I'd like to give it a variable of type

01:43.890 --> 01:45.090
gameplay tag.

01:45.090 --> 01:51.360
So in the graph we're going to add the variable right here in blueprint add variable, and we're going

01:51.360 --> 01:53.400
to call this attribute tag.

01:53.790 --> 01:55.590
We're going to change its type.

01:55.590 --> 02:02.070
We're going to search for gameplay tag and choose gameplay tag and compile.

02:02.070 --> 02:04.890
So we now have this attribute tag.

02:04.890 --> 02:12.120
Let's check the eye icon, make sure it's set to public editable and that way we can go back to our

02:12.120 --> 02:15.510
attribute menu and set the tag for all of these.

02:15.540 --> 02:19.290
Now to know which one is which, I'm going to rename them.

02:19.290 --> 02:28.140
I'm going to select this row and instead of letting it be called text value button row, I'm going to

02:28.140 --> 02:35.450
click right click and rename and call this one strength row.

02:35.460 --> 02:38.220
No, let's call it row underscore strength.

02:40.010 --> 02:44.670
And I'm going to copy row underscore so I can rename the others.

02:44.690 --> 02:46.130
Let's get the next one.

02:46.130 --> 02:50.990
I'm going to rename this one to row underscore intelligence.

02:51.710 --> 02:59.960
Next one will be row underscore resilience and next will be row underscore vigor.

03:00.740 --> 03:04.400
And then we need to get all these ones in the scroll box.

03:04.430 --> 03:06.180
We got quite a few, don't we?

03:06.200 --> 03:10.120
So let's name these accordingly so we know which one is which.

03:10.130 --> 03:12.710
This one we can call row armor.

03:12.740 --> 03:17.390
Next will be row armor penetration.

03:18.320 --> 03:19.730
Next will be block chance.

03:19.730 --> 03:20.780
So row.

03:20.810 --> 03:22.100
Block chance.

03:23.160 --> 03:27.630
This one will be ro critical hit chance.

03:29.260 --> 03:34.310
Next one row critical hit resistance.

03:34.330 --> 03:35.860
No damage.

03:36.160 --> 03:37.870
Critical hit damage.

03:38.170 --> 03:40.120
Next one is resistance.

03:40.780 --> 03:42.880
Critical hit resistance.

03:43.210 --> 03:46.780
Next one is health regeneration.

03:49.300 --> 03:51.520
Next is mana regeneration.

03:53.440 --> 03:55.750
Next, we have max health.

03:58.150 --> 04:02.260
And finally, we have Ro.

04:02.290 --> 04:03.220
Max Mana.

04:03.430 --> 04:04.990
And I know what you're thinking.

04:04.990 --> 04:07.120
I forgot the ro underscore for this one.

04:07.240 --> 04:08.890
So fixing that.

04:08.920 --> 04:14.860
Okay, now all of these rows have names and we can easily know what they are.

04:14.890 --> 04:20.560
Now we're going to want to set their tags, their attribute tags, which means, as I was renaming them,

04:20.560 --> 04:23.500
I should have checked is variable on each of them.

04:24.430 --> 04:27.760
You live and you learn, I'm going to go ahead and do it manually.

04:28.210 --> 04:32.350
So selecting row strength checking is variable.

04:32.560 --> 04:38.560
In fact, I probably should be able to hold control and just click on these.

04:42.240 --> 04:44.520
Like so and check is variable.

04:45.340 --> 04:47.890
And yes, they're now all set to as variable.

04:47.890 --> 04:51.760
Let's compile and save and we'll go back to the graph.

04:52.030 --> 04:57.850
And here, as soon as our widget controller is set for the attribute menu, we're broadcasting initial

04:57.850 --> 04:59.110
values, right?

04:59.140 --> 05:06.160
We need to make sure that all of these widgets have their attribute tags set before broadcasting initial

05:06.160 --> 05:07.030
values.

05:07.180 --> 05:10.630
So that's kind of one of the first things I want to do.

05:10.720 --> 05:12.010
So here's what I'm going to do.

05:12.010 --> 05:14.980
Let's get those nodes out of the way.

05:14.980 --> 05:18.700
Let's get this event destruct up here and out of the way.

05:18.880 --> 05:23.460
And I'm going to use a sequence node to organize this a bit more.

05:23.470 --> 05:24.910
So sequence.

05:26.760 --> 05:31.740
The first thing is binding to on clicked for our close button.

05:31.740 --> 05:33.420
We'll get that out of the way there.

05:35.270 --> 05:38.900
And next is setting our widget controller.

05:39.110 --> 05:41.720
And then next is broadcasting initial values.

05:41.720 --> 05:44.660
Before this step, let's actually add a pin.

05:44.690 --> 05:46.310
This will be then two.

05:46.310 --> 05:52.970
And before this step, we're going to set all the gameplay tags, the attribute tags for these rows.

05:53.000 --> 05:55.820
So for that I'd like to make a function.

05:55.820 --> 06:05.000
So I'm going to click add function and call this set attribute tags and we'll set all the attribute

06:05.030 --> 06:08.990
tags and we'll call this right here set attribute tags.

06:09.020 --> 06:10.280
Boom.

06:10.280 --> 06:16.100
And in set attribute tags, we need to get all of these rows and set their tags.

06:16.100 --> 06:19.820
So I'd like the primary tags kind of off to the side.

06:19.820 --> 06:27.560
So I'm going to hold control and click and drag out strength, intelligence, resilience and vigor.

06:27.890 --> 06:31.370
I'll get those right there and then I'd like all the rest of them.

06:31.370 --> 06:35.370
So we have armor penetration block chance and so on.

06:35.370 --> 06:36.450
Let's get these all out.

06:36.450 --> 06:39.180
So starting up at the top, we have armor.

06:40.290 --> 06:43.590
Armor penetration blocked chance.

06:43.890 --> 06:46.860
The three critical hit ones.

06:46.860 --> 06:49.410
Chance damage and resistance.

06:50.900 --> 06:52.780
Health Regeneration.

06:52.790 --> 06:54.530
Mana Regeneration.

06:54.560 --> 06:56.060
Max Health.

06:56.090 --> 06:57.350
Max Mana.

06:57.560 --> 06:58.760
So we got them all.

06:59.030 --> 07:06.680
And each of these needs to have their tag set so we can use a sequence that'll probably make things

07:06.710 --> 07:08.610
a little less painful here.

07:08.630 --> 07:11.000
So I'm going to go ahead and do that.

07:11.000 --> 07:16.700
We'll do a sequence and let's handle the primary attributes first.

07:16.940 --> 07:19.760
So we're going to take row strength.

07:20.530 --> 07:23.950
And we're going to set its attribute tag.

07:25.930 --> 07:31.060
So searching for attribute tag, we're going to set that for the strength.

07:31.990 --> 07:34.600
And we can set it directly right here.

07:34.600 --> 07:37.660
Two attributes Primary strength.

07:38.450 --> 07:39.720
And there we go.

07:39.740 --> 07:42.450
And we have to do this for all of them.

07:42.500 --> 07:45.260
So I'm going to time lapse the rest of these.

07:45.290 --> 07:52.220
All I'm doing is repeating the process, starting with strength and ending all the way down here at

07:52.220 --> 07:52.920
Max Mana.

07:52.940 --> 07:54.620
So let's time lapse this.

09:15.290 --> 09:18.800
Okay, So I set all of these.

09:18.800 --> 09:20.540
I made two sequences.

09:20.540 --> 09:27.170
And in fact, I'm going to have actually, I think, one splitting sequence right here in the very beginning.

09:27.170 --> 09:37.130
So we're going to say sequence with the first one, which is only going to set the primary attributes.

09:37.130 --> 09:39.170
So I don't need this one.

09:39.380 --> 09:42.440
So this one is only the primary attributes.

09:43.400 --> 09:47.200
And then the second one, which will go down to this one.

09:47.240 --> 09:51.140
So three sequences total, one that splits off into two.

09:51.170 --> 09:58.610
The first one is up here with the primary attributes and then the second one down here has zero through

09:58.610 --> 09:58.910
nine.

09:58.910 --> 10:03.200
So our ten secondary attributes right there.

10:03.320 --> 10:08.210
So it's kind of a lot, but hey, we have a lot of attributes, so that's okay.

10:08.570 --> 10:13.280
If you highlight three of them and press Q, it'll straighten them up.

10:13.310 --> 10:13.850
So.

10:13.850 --> 10:14.660
Q.

10:15.890 --> 10:20.060
We can do that on all of them if we want a little bit more.

10:21.920 --> 10:29.510
Sort of order here like so and really we can just comment them all.

10:29.540 --> 10:32.270
But that's just about all we can do.

10:32.270 --> 10:33.380
I'm going to go ahead and comment them.

10:33.380 --> 10:36.650
I'm going to say see secondary

10:39.920 --> 10:41.300
attributes.

10:42.310 --> 10:43.360
Zooming in.

10:43.810 --> 10:46.420
And of course, I misspelled it there.

10:46.450 --> 10:47.300
Okay, cool.

10:47.320 --> 10:51.820
So, yeah, that's the function that will set all the attribute tags.

10:51.820 --> 10:59.890
And now that we're setting these, each of our widgets that at least derive from text value, row this

10:59.890 --> 11:03.100
widget, they have an attribute tag.

11:03.100 --> 11:10.960
So where we bound to attribute info delegate here in text value button row, we can now check that attribute

11:10.990 --> 11:11.320
tag.

11:11.320 --> 11:14.170
We can say matches tag.

11:15.130 --> 11:22.810
We can check exact match and we can check if that attribute tag matches.

11:23.350 --> 11:24.400
Attribute tag.

11:24.400 --> 11:27.610
This is that variable.

11:28.300 --> 11:36.130
Belonging to this widget class and we can only set the label and the numerical value.

11:36.370 --> 11:40.000
If that's the case, so we can plug that into a branch.

11:40.060 --> 11:44.710
And now this event will only set those values if.

11:45.270 --> 11:49.020
The incoming attribute tag matches this widget's tag.

11:49.020 --> 11:53.700
So if we press play and open the attribute menu, look at this.

11:53.700 --> 11:56.490
Only strength is being updated.

11:56.490 --> 12:01.710
The rest of them, they're checking the attribute tag and it's not their tag.

12:01.710 --> 12:04.980
This one has intelligence for its tag and so on.

12:04.980 --> 12:09.530
So now only strength gets those values and that's great.

12:09.540 --> 12:16.860
Now we bound to that and this text value button row, but we want to bind to it in text value row,

12:16.890 --> 12:17.490
right?

12:17.490 --> 12:25.260
Because our attribute menu has secondary attributes and those are just the text value row without the

12:25.290 --> 12:25.890
button.

12:25.890 --> 12:28.620
So let's take this out of text value button row.

12:28.650 --> 12:32.250
Let's go ahead and just copy these nodes here.

12:33.180 --> 12:35.550
And we'll go to text value button row.

12:36.480 --> 12:40.590
We'll go to the event graph and we'll do this in event construct.

12:40.590 --> 12:43.290
So let's get event pre construct out of the way.

12:43.290 --> 12:45.780
Actually, we'll move event construct down.

12:45.780 --> 12:51.330
I'm going to delete event tick and from event construct, let's see what we did here.

12:52.850 --> 12:56.240
We got the attribute menu Widget Controller.

12:56.780 --> 12:58.190
So let's do that here.

12:58.190 --> 13:03.950
We'll say Git attribute menu widget controller passing in a reference to self.

13:03.950 --> 13:07.310
We need that world context object.

13:07.700 --> 13:09.290
And what did we do?

13:09.320 --> 13:13.100
We bound to attribute info delegate.

13:13.100 --> 13:14.000
So let's do that.

13:14.000 --> 13:18.140
Here we're going to say assign attribute info delegate.

13:18.170 --> 13:19.580
We have an event now.

13:20.640 --> 13:23.730
And now we can control V.

13:23.760 --> 13:28.290
I don't know if you still have yours copied, but I copied these nodes here.

13:28.410 --> 13:31.470
Control V and the info will be broken.

13:31.470 --> 13:36.600
So break attribute info and we're checking against the attribute tag here.

13:37.220 --> 13:40.490
And then plug in that into branch.

13:41.160 --> 13:46.320
The branch will branch off of whether or not the attribute tag matches.

13:47.380 --> 13:49.630
So we can organize this a little better.

13:50.770 --> 13:53.050
We can have attribute tag there.

13:54.590 --> 14:01.010
We can have the text for the label there like so and that looks great.

14:01.730 --> 14:03.380
Compile and save that.

14:03.620 --> 14:05.030
Now, here's the thing.

14:05.030 --> 14:06.110
We're only.

14:06.140 --> 14:06.890
Saving all.

14:06.890 --> 14:07.370
By the way.

14:07.370 --> 14:10.010
We're only broadcasting for strength.

14:10.040 --> 14:10.790
Remember?

14:10.790 --> 14:13.070
So only strength is showing up.

14:13.070 --> 14:16.070
We're not broadcasting for any of the other attributes.

14:16.070 --> 14:21.230
I'm going to close out of the editor and just remind you, here's attribute menu Widget Controller.

14:21.260 --> 14:27.890
We're only broadcasting the strength because we're only finding that attribute here in broadcast initial

14:27.890 --> 14:28.940
values.

14:28.940 --> 14:36.290
And you may imagine that this could be quite tedious if we had to go through and do this over and over

14:36.290 --> 14:39.290
again for every single attribute we have.

14:39.320 --> 14:40.580
That's one way to do it.

14:40.610 --> 14:44.660
We could do it that way, but we like more robust code.

14:44.660 --> 14:48.200
We like more flexible systems that are not rigid.

14:48.230 --> 14:50.030
I don't want to have to.

14:50.030 --> 14:56.300
Every time I add a new attribute to my attribute set, I don't want to have to come in here and change

14:56.300 --> 14:57.410
the code here.

14:57.410 --> 15:03.510
I'm already going to have to add more to my attribute menu, more rows to it, and assign those attribute

15:03.540 --> 15:04.230
tags.

15:04.230 --> 15:05.280
That's enough for me.

15:05.280 --> 15:09.720
I don't want to have to come in here and change the code and add more and more lines every time.

15:10.050 --> 15:15.000
I'd rather be able to do something along the lines of have a for loop here, right?

15:15.030 --> 15:20.640
A for loop or some kind of loop that can do the same thing for every attribute.

15:20.640 --> 15:22.680
That would be really, really nice.

15:22.710 --> 15:28.230
Now before we do it and we're going to do that in the videos to come, I want you to kind of brainstorm.

15:28.230 --> 15:29.910
How can we make that happen?

15:29.910 --> 15:33.300
It's kind of a tricky problem to solve in this case.

15:33.300 --> 15:35.810
So think it over a little bit.

15:35.820 --> 15:36.870
Give it a few minutes.

15:36.870 --> 15:43.620
Think about how you would make this a little bit more automated, a little bit more flexible, something

15:43.620 --> 15:51.690
like a for loop or any kind of way to automatically broadcast all the values of all the attributes without

15:51.690 --> 15:54.750
having to point them out by name one by one.

15:54.750 --> 15:55.770
It's a little bit tricky.

15:55.770 --> 15:59.640
So give it some thought and we'll do that in the videos to come.

15:59.640 --> 16:01.890
So great job and I'll see you soon.
