WEBVTT

00:06.810 --> 00:07.980
Welcome back.

00:08.130 --> 00:13.680
Now, when we press play and we look at our spells, we can see that we have one spell equipped.

00:13.710 --> 00:20.460
Now, one of the things that I want to do is when I level up, I want to see what other spells I'm eligible

00:20.490 --> 00:22.790
to spend points on.

00:22.800 --> 00:28.920
And so that means as soon as I do level up, as in like I'm doing here.

00:29.810 --> 00:37.910
I should be able to open my spells menu and any abilities that have that level requirement equal to

00:37.910 --> 00:41.640
the level that I've just reached should now show as eligible.

00:41.660 --> 00:44.190
We shouldn't see a locked icon for those.

00:44.210 --> 00:48.110
We should see what the icon for that ability is supposed to be.

00:48.140 --> 00:54.050
Now, for that reason, we need the concept of a level requirement for our spells, and I'd like to

00:54.050 --> 00:56.180
keep that in my data asset.

00:57.190 --> 01:05.260
So in content blueprint's ability system data, I have my ability info data asset and I'd like to be

01:05.290 --> 01:08.830
able to set the level requirement for a given ability here.

01:08.860 --> 01:15.550
That way, every time we level up we can check the level requirements for these abilities and grant

01:15.550 --> 01:17.830
those abilities to the player.

01:17.830 --> 01:20.980
If that player now meets those level requirements.

01:21.010 --> 01:25.390
Now, Aura isn't going to have all of her abilities right away.

01:25.420 --> 01:29.220
She only starts with those abilities in her start up abilities array.

01:29.230 --> 01:36.190
So as we add more abilities that she will not start with our ability system component needs to know

01:36.190 --> 01:38.410
what class of ability to grant.

01:38.410 --> 01:45.670
So ability information should also contain a class that the ability system component can retrieve and

01:45.670 --> 01:49.570
then give that ability to aura and set its ability status.

01:49.900 --> 01:57.190
So we're going to add two things to our ability info struct, a gameplay ability class and a level requirement

01:57.290 --> 02:01.010
set and both will be exposed to our data asset.

02:01.010 --> 02:02.840
So let's close the editor.

02:04.700 --> 02:14.090
We'll close all tabs and let's go into our public folder into ability system data and ability info.

02:14.850 --> 02:19.800
Our ability info struct is going to now have a level requirement.

02:19.950 --> 02:21.750
So we're going to add that.

02:22.860 --> 02:26.310
It'll be an int 32, we'll call it level requirement.

02:27.000 --> 02:30.780
It's going to be edit defaults only blueprint read only.

02:30.780 --> 02:33.480
So we'll go ahead and give it that new property.

02:34.560 --> 02:41.490
In addition to that, we need a subclass of this will be for the game play ability, which means we're

02:41.490 --> 02:48.690
going to need to forward declare that class class you gameplay ability.

02:49.590 --> 02:58.620
So let's add this subclass of t subclass of you gameplay ability and this is going to be the ability

02:58.620 --> 02:59.430
itself.

02:59.430 --> 03:05.370
We can just call it ability and this too will get added defaults only and we'll make it blueprint read

03:05.370 --> 03:06.000
only.

03:06.300 --> 03:14.100
So now that we have this level requirement and the gameplay ability class itself, our ability system

03:14.100 --> 03:21.320
component is going to need to know when we level up and when it does, it needs to access ability info.

03:21.330 --> 03:27.330
So we need a nice central place where we can put one of these ability infos that our ability system

03:27.330 --> 03:29.340
component can get it from.

03:29.340 --> 03:35.200
And I'd like to add that to the game mode as that's a nice central place that only exists on the server.

03:35.380 --> 03:42.700
So let's go into the game folder to or a game mode base and we'll add a new object pointer here.

03:42.700 --> 03:48.130
It's going to be T object pointer of type you ability info.

03:48.940 --> 03:54.730
We're going to go ahead and forward declare it and call this ability info.

03:54.850 --> 04:01.420
We'll make it edit defaults only and the category can be just ability info.

04:02.790 --> 04:04.810
Now it exists on the game mode.

04:04.830 --> 04:07.650
I'd like it to be easily obtainable.

04:07.650 --> 04:11.850
I'd like a nice function that can get it in our ability system library.

04:11.850 --> 04:14.760
So let's go to our ability system library.

04:14.910 --> 04:18.570
Now we have already one function that returns a data asset.

04:18.570 --> 04:20.850
It's called get character class info.

04:20.880 --> 04:26.580
We're going to model this new function after this one, so I'm going to copy and paste it and call this

04:26.580 --> 04:28.650
one get ability info.

04:29.630 --> 04:33.260
Its type that it returns will be you ability info.

04:34.820 --> 04:36.860
We'll go ahead and forward declare it.

04:36.900 --> 04:39.200
It'll take a world context object.

04:39.230 --> 04:45.020
Let's go ahead and generate the definition and it's going to be similar to get character class info.

04:45.050 --> 04:50.750
I'm going to copy the contents of that function and paste it here because we do want our A game mode

04:50.750 --> 04:51.470
base.

04:51.500 --> 04:54.800
We're going to get that and check to see if it's Null first.

04:54.800 --> 05:01.610
And if it's not null, we'll get our aura game mode and return the ability info on it.

05:02.250 --> 05:04.980
Now both of these can be made const.

05:05.590 --> 05:11.170
So while I'm at it here, I'll go ahead and make them both const and now we have Git ability info,

05:11.200 --> 05:13.690
which is a very easy to use function.

05:13.690 --> 05:18.310
It exists on our ability system library and we can use that.

05:18.340 --> 05:25.420
Now we can go ahead and just compile and launch the editor and set the level requirement for the one

05:25.450 --> 05:31.120
ability we have in our data asset as well as set the ability info on the game mode.

05:32.190 --> 05:35.670
Okay, I'm going to click open and get that ability info back up.

05:35.670 --> 05:42.600
Now, level requirement is going to have a value of one for our firebolt, which doesn't really matter

05:42.600 --> 05:47.400
because it's one of the startup abilities, but now it's level requirement is set.

05:47.610 --> 05:50.610
And by the way, that's zero because we're not setting it.

05:51.060 --> 05:53.100
We'll get an error if we don't.

05:53.100 --> 05:57.450
So I'm going to set that to a default value of one in C plus plus.

05:58.520 --> 06:00.360
So that's one thing that we need to do.

06:00.380 --> 06:01.550
I'm going to save that.

06:01.550 --> 06:08.090
And the next thing is to go into our blueprints game folder, open our blueprint for the game mode and

06:08.090 --> 06:10.520
set its ability info data asset.

06:10.550 --> 06:15.080
Now we can always access it at least on the server where the game mode exists.

06:15.820 --> 06:18.100
Okay, so we're almost done.

06:18.100 --> 06:24.640
But now that we have a level requirement, we're going to want to check it every time we level up and

06:24.640 --> 06:26.800
then change the icons here.

06:26.800 --> 06:29.590
But to do that, we need other abilities.

06:29.590 --> 06:31.600
We need at least one more ability.

06:31.630 --> 06:34.780
Now, this middle column is going to be for lightning abilities.

06:34.780 --> 06:42.250
So I think I'm going to create a placeholder ability that can go right here for our next ability that

06:42.250 --> 06:43.390
I'd like to show.

06:43.420 --> 06:50.140
Once we become eligible, I'd like to show the eligible icon for it in the next column.

06:50.440 --> 06:53.680
So let's go ahead and make a new gameplay ability.

06:53.680 --> 07:00.910
I'm going to go to Blueprints, Ability System, Aura abilities and make a new folder here called Lightning

07:01.150 --> 07:03.610
and we'll make our first lightning ability.

07:03.610 --> 07:09.100
Let's right click, make a new blueprint and we're going to base this on Aura gameplay ability.

07:11.750 --> 07:18.050
And we'll call this G a underscore and let's choose a cool name for it.

07:18.530 --> 07:19.940
Electrocute.

07:21.660 --> 07:25.730
Electrocute is going to be just a basic gameplay ability.

07:25.740 --> 07:36.510
In fact, we can just print a string for now that says electrocute activated and we can simply use a

07:36.510 --> 07:37.470
delay.

07:39.260 --> 07:42.980
For one second and in the ability.

07:45.590 --> 07:48.170
We'll definitely be making this a real ability.

07:48.200 --> 07:50.000
For now, it's just a placeholder.

07:50.390 --> 07:53.990
But now we actually have a gameplay ability.

07:54.020 --> 07:55.820
Aside from Firebolt.

07:56.520 --> 08:03.750
Now in class defaults, we're going to need a gameplay tag to identify this ability as we only have

08:03.750 --> 08:04.560
abilities.

08:04.560 --> 08:07.860
Fire firebolt and of course attack.

08:07.890 --> 08:14.460
I'm going to want abilities lightning electrocute to add to that and then we can add it to our data

08:14.460 --> 08:14.910
asset.

08:14.910 --> 08:21.180
So let's go ahead and close the editor and add a new gameplay tag in or a gameplay tags.

08:21.180 --> 08:22.950
Let's find our abilities.

08:23.100 --> 08:24.270
Here they are.

08:24.300 --> 08:26.250
Here's my fire Firebolt.

08:26.700 --> 08:34.830
I'm just going to copy and paste it and change this one to abilities Lightning underscore electrocute.

08:35.550 --> 08:38.790
So we'll go ahead and define this gameplay tag.

08:39.670 --> 08:41.830
I'm going to find Firebolts.

08:42.220 --> 08:44.050
That's the cooldown tag.

08:44.670 --> 08:46.320
Here's the ability tag.

08:47.290 --> 08:48.580
I'll copy this one.

08:48.580 --> 08:51.550
And just beneath it we'll paste it.

08:51.550 --> 08:58.090
But this will be abilities lightning electrocute so its tag will be abilities.

08:58.090 --> 09:01.930
Dot lightning dot electrocute.

09:03.630 --> 09:08.530
And the comment will say electrocute ability tag.

09:08.550 --> 09:12.540
Now that we have this tag, we'll compile and go back to the editor.

09:14.220 --> 09:20.280
Okay, so let's go ahead and get everything open again for Electrocutes ability tags.

09:20.280 --> 09:26.040
We're going to add a tag Abilities Lightning Electrocute.

09:26.660 --> 09:35.990
So just like our other ability abilities, fire Firebolt and the Firebolt ability tags contains abilities.

09:36.230 --> 09:37.880
Fire Firebolt.

09:37.910 --> 09:40.700
That's what we use to identify that ability.

09:40.730 --> 09:44.150
Now electrocute is identified with abilities.

09:44.150 --> 09:45.620
Lightning electrocute.

09:46.430 --> 09:47.900
Let's go ahead and save that.

09:47.900 --> 09:53.780
And now here in ability info, we can set up our new ability electrocute.

09:53.780 --> 09:58.820
By the way, aside from level requirement, we also have the ability itself.

09:58.820 --> 10:04.190
Again, Firebolt is one of the start up abilities, so it doesn't matter much, but we can set that

10:04.190 --> 10:06.770
gameplay ability to firebolt there.

10:06.770 --> 10:10.910
And now let's add a new element to ability information.

10:10.910 --> 10:14.810
This will be the next element and we can set its ability tag.

10:14.810 --> 10:18.800
It's going to be abilities, lightning electrocute.

10:18.800 --> 10:27.590
It doesn't have a cooldown tag yet, but we can set its icon now if we search for shock and choose that

10:27.620 --> 10:33.140
we have this texture and if you open it, you'll see that it looks like a lightning bolt.

10:33.590 --> 10:34.940
We're going to use that.

10:34.940 --> 10:40.460
And for the background material, let's actually see what other flowing materials we have by browsing

10:40.490 --> 10:41.330
to fire skill.

10:41.360 --> 10:44.720
BG Here we have an my shock skill.

10:44.750 --> 10:48.300
BG I'm going to select it and choose that one.

10:48.720 --> 10:54.570
And for the level requirement for electrocute, I'm going to set it to two and for the ability I'm going

10:54.570 --> 10:57.270
to set it to a electrocute.

10:57.890 --> 11:03.110
And now our ability info has info for this ability.

11:03.410 --> 11:11.600
Now that means we can go to our offensive spell tree in blueprints ui spell menu.

11:11.630 --> 11:19.340
Offensive spell tree and assign our new electrocute tag to one of these spell globes and it's going

11:19.340 --> 11:23.240
to go into the bottom most globe in the second column.

11:23.240 --> 11:29.360
So here I'm going to search for its ability tag and set that ability tag to lightning electrocute.

11:30.000 --> 11:33.660
So now that one has the electrocute tag.

11:34.390 --> 11:42.100
Okay, so now our abilities have the concept of a level requirement, and every time we level up, we're

11:42.100 --> 11:47.260
going to expect our offensive spell tree to update itself.

11:47.260 --> 11:53.020
And as soon as we meet the level requirements for any of those other abilities in our ability info,

11:53.050 --> 11:59.350
I want to be able to first of all give that ability to aura and then set its status so that we can see

11:59.350 --> 12:01.390
what the icon is supposed to look like.

12:01.390 --> 12:07.480
So we have a few more steps to go, but we're making good progress and we'll continue with this in the

12:07.480 --> 12:08.590
next video.

12:08.620 --> 12:09.790
I'll see you soon.
