WEBVTT

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

00:07.980 --> 00:11.460
In this video, we're going to start making our spell menu.

00:11.460 --> 00:13.710
Buttons actually work.

00:13.800 --> 00:16.680
We're going to start with spending spell points.

00:16.680 --> 00:21.000
Now, if we level up, we're going to get a spell point.

00:22.020 --> 00:29.310
And as soon as we do when we have a spell globe selected, depending on its status, we should be able

00:29.310 --> 00:30.710
to spend a spell point.

00:30.720 --> 00:33.720
The button should be enabled if it's an equipped spell.

00:33.720 --> 00:38.640
In the case of our firebolt, we should be able to click spend point.

00:38.640 --> 00:44.160
We should see the spell points go down by one and our ability should level up.

00:44.190 --> 00:46.260
It should go up to the next level.

00:46.290 --> 00:53.370
Now I also want to show in the description box what the current level is of whatever ability we have

00:53.370 --> 00:56.640
selected as long as it's not a locked ability.

00:56.640 --> 01:02.040
So in the case of our equipped ability, I want to see what its level is here along with the description,

01:02.040 --> 01:06.450
and I'd like to see the description for the next level in this box down here.

01:06.660 --> 01:14.220
Now, if I were to say click on an eligible ability, then I should be able to spend a point on it to

01:14.220 --> 01:18.300
unlock it, and then it should now be in the unlocked state.

01:18.330 --> 01:24.100
It should be colorful, not grayed out as this one is, and then I should be able to equip it with the

01:24.100 --> 01:24.910
equip button.

01:24.910 --> 01:27.880
So we should see the equip button become active.

01:27.910 --> 01:29.590
So that's a lot of things.

01:29.590 --> 01:32.230
We're going to take this all one step at a time.

01:32.320 --> 01:37.360
In this video, I'd like to handle actually being able to spend a spell point.

01:37.360 --> 01:43.330
So if I click the spend point button, then depending on which ability we have selected, I want to

01:43.330 --> 01:51.250
use up one of my spell points and upgrade it if it's in the equipped state, actually equipped or unlocked.

01:51.280 --> 01:56.830
But if it's eligible, I want to upgrade its status to unlocked.

01:56.890 --> 01:59.860
So that's what I'd like to handle in this video.

02:00.390 --> 02:07.500
So we're going to close the editor and we'll start by creating a function we can call when we attempt

02:07.500 --> 02:09.660
to spend a spell point.

02:10.510 --> 02:13.300
So we'll make a blueprint callable function here.

02:13.540 --> 02:19.000
I'm going to keep my ability system component open right there, but we're going to make a blueprint

02:19.000 --> 02:23.850
callable function for pressing the spawn point button.

02:23.860 --> 02:30.160
So I'm going to make a void function called spend point button pressed.

02:31.850 --> 02:36.920
And it'll be blueprint callable and we can generate a definition for it.

02:36.920 --> 02:38.700
It's not going to take any inputs.

02:38.720 --> 02:45.800
If we click the spawn point button, then all I really want to do is pass that information along to

02:45.800 --> 02:50.430
the ability system component and tell it what our currently selected ability is.

02:50.480 --> 02:54.020
So I'm going to make a function on the ability system component.

02:54.020 --> 02:55.070
But here's the thing.

02:55.070 --> 03:01.450
We might be on a client and things like spending points is something that should be managed on the server.

03:01.460 --> 03:07.520
So in the ability system component class, I'm going to make a new function we can call, it'll be public,

03:07.520 --> 03:13.640
but it's going to be a server RPC, so that way it'll be only executed on the server.

03:13.640 --> 03:22.820
So we're going to make a void function called server spent point and we'll call it actually server spend

03:22.820 --> 03:23.810
spell point.

03:24.410 --> 03:26.300
So we know what we're talking about.

03:26.330 --> 03:31.230
Now server spend spell point needs to receive the gameplay tag.

03:31.230 --> 03:33.570
We'll pass it in by const reference.

03:33.570 --> 03:37.830
So a const gameplay tag reference and it needs to know the ability.

03:37.830 --> 03:40.560
So it's going to be the ability tag.

03:41.240 --> 03:48.860
And this is going to be a new function with server and reliable so we can go ahead and generate this

03:48.890 --> 03:51.020
RPC function definition.

03:51.830 --> 03:58.330
And server spin point is going to need to perform a few checks so we know the ability tag.

03:58.340 --> 04:03.260
We need to know the status of the ability we're trying to spend a point on.

04:03.350 --> 04:08.900
Now, in order to get the status it needs to be an ability in our activatable abilities.

04:08.930 --> 04:13.640
Otherwise, if we try to get the spec from the ability tag, we'll get a null pointer.

04:13.820 --> 04:21.560
In other words, if we call get spec from ability tag passing in that ability tag this returns a pointer

04:21.560 --> 04:23.980
that could be a null pointer, right?

04:23.990 --> 04:32.720
So what we can do is we can make an gameplay ability spec pointer for gameplay ability spec, we can

04:32.720 --> 04:39.500
call this ability spec and we can check to see if it's a null pointer.

04:40.100 --> 04:42.950
In fact, we could just place this in an if statement.

04:46.630 --> 04:52.390
Because if we don't get inside this if statement, then we know that this game playability does not

04:52.390 --> 04:56.920
exist in activatable abilities, which is just as good as locked.

04:56.920 --> 05:01.960
And if it's locked, we can't spend a spell point on it, so we shouldn't do anything.

05:02.110 --> 05:08.920
Now, if we have a valid ability spec, we know that we can get the status from the ability spec so

05:08.920 --> 05:17.290
we can make an gameplay tag called status and set it equal to the result from get status from spec passing

05:17.290 --> 05:22.750
in the ability spec we have to dereference it, but we know it's not a null pointer at this point.

05:22.780 --> 05:24.460
So we have our status.

05:25.050 --> 05:31.740
So at this point, we know that this ability spec is in our activatable abilities, which means it's

05:31.740 --> 05:37.920
not a locked ability, it's at least unlocked, eligible or equipped.

05:37.950 --> 05:44.850
So for that reason we can check its status and see if it's eligible or equipped or unlocked.

05:44.970 --> 05:47.750
Now we have two major scenarios.

05:47.760 --> 05:55.680
One of them is if our status is eligible, we're going to say if status Dot matches tag exact, and

05:55.680 --> 05:58.740
we're going to see if it matches for a gameplay.

05:58.770 --> 06:05.790
Tags get dot abilities status eligible.

06:06.030 --> 06:09.750
Why is that one of the major scenarios?

06:09.750 --> 06:15.270
Well, if it's eligible and we're wanting to spend a point on it, it should now become unlocked.

06:15.330 --> 06:17.280
That's going to be a major change.

06:17.280 --> 06:22.320
Right now we're going to be using our gameplay tags multiple times.

06:22.320 --> 06:30.400
So I'm going to just make an const for a gameplay tags here called Gameplay tags.

06:33.610 --> 06:35.320
And we'll use gameplay tags.

06:39.280 --> 06:43.150
So if eligible, we have to change the status.

06:43.180 --> 06:50.320
We're also going to have an else if here, and that's going to be when our status dot matches tag exact

06:50.350 --> 06:52.000
the equipped status.

06:52.000 --> 06:54.040
So we're going to say gameplay tags.

06:56.080 --> 06:56.590
Abilities.

06:56.590 --> 06:57.070
Status.

06:57.100 --> 06:57.910
Equipped.

06:58.820 --> 07:04.340
But we're going to have an oar here because we're going to do the same thing if it's equipped as if

07:04.340 --> 07:05.420
it's unlocked.

07:06.050 --> 07:07.490
So we're going to say status.

07:08.420 --> 07:10.220
That match is tag exact.

07:10.430 --> 07:11.960
Gameplay tags.

07:12.300 --> 07:15.410
Dot ability status unlocked.

07:17.440 --> 07:21.610
Why are we doing the same thing if it's equipped or unlocked?

07:21.640 --> 07:25.570
Because either way, we're just leveling up the ability.

07:25.720 --> 07:28.390
We're going to increase the ability level.

07:28.600 --> 07:30.520
So let's handle the first case.

07:30.520 --> 07:38.290
If the status is eligible, if the ability is eligible, then we can now change its status from eligible

07:38.320 --> 07:39.700
to unlocked.

07:39.880 --> 07:42.820
Now, how is status actually managed?

07:42.850 --> 07:46.270
Well, it's managed in the dynamic ability tags.

07:46.570 --> 07:49.870
We can see that if we look at git status from spec.

07:51.260 --> 07:53.030
Let's see if we can find that.

07:54.970 --> 07:55.630
Here it is.

07:55.630 --> 07:57.370
Here's git status from RSpec.

07:57.640 --> 08:03.970
What we do is we take that spec and we loop through its dynamic ability tags.

08:03.970 --> 08:08.380
And if we find one that has abilities dot status in it, we return that.

08:08.380 --> 08:15.100
So dynamic ability tags contains the status tag and we do need to make sure that there's only one status

08:15.100 --> 08:17.410
tag for any spec at a time.

08:17.620 --> 08:25.780
So if we're going to change this ability spec to have the unlocked status instead of eligible, then

08:25.780 --> 08:27.870
we need to remove the eligible tag.

08:27.880 --> 08:34.300
So what we'll do is we'll take the ability spec which we know is a valid pointer and we'll get its dynamic

08:34.300 --> 08:37.720
ability tags and we can remove a tag from it.

08:37.810 --> 08:43.840
So we're going to use remove tag and we're going to remove the eligible tag because we know that's what

08:43.840 --> 08:44.710
it has.

08:44.710 --> 08:50.920
So we're going to have gameplay tags, dot ability status eligible, we're going to remove that tag

08:50.920 --> 08:51.850
completely.

08:52.090 --> 08:54.740
And then we need to add the new status.

08:54.740 --> 09:02.240
So we take ability spec, take its dynamic ability tags and we're going to call add tag and we're going

09:02.240 --> 09:03.680
to add the unlocked tag.

09:03.680 --> 09:07.790
So gameplay tags dot ability status unlocked.

09:08.720 --> 09:12.080
So after this it'll no longer have the eligible tag.

09:12.080 --> 09:14.450
It'll now have the unlocked tag.

09:14.940 --> 09:17.850
So that takes care of changing its tag.

09:17.880 --> 09:23.520
Now, if it's equipped or unlocked, we don't need to change its status.

09:23.550 --> 09:26.970
What we need to do instead is change its level.

09:27.000 --> 09:30.000
Now, there's two ways to level up a gameplay ability.

09:30.030 --> 09:40.830
One is to take the ability spec and simply take its level and use plus equals one or plus plus however

09:40.830 --> 09:41.730
you prefer.

09:42.030 --> 09:44.610
So we're just incrementing its level by one.

09:44.640 --> 09:46.290
That's one way to do it.

09:46.320 --> 09:52.020
What this results in is changing its level without canceling an ability if it's active.

09:52.230 --> 09:58.290
Now, if you want to level it up and cancel the ability, if it's currently active, then you have to

09:58.290 --> 10:00.840
remove the ability and give it back.

10:01.540 --> 10:05.650
So all we're going to do is increase its level if it's already active.

10:05.650 --> 10:07.830
I don't want to end the ability.

10:07.840 --> 10:09.760
I just want to increase the level.

10:09.760 --> 10:15.190
So next time we activate it or next time we use its level, it'll be one more than what it was.

10:16.270 --> 10:20.140
Okay, so we've just changed our abilities status.

10:20.170 --> 10:22.750
We need to also spend a point.

10:22.810 --> 10:27.940
In other words, we need to subtract one from spell points.

10:27.970 --> 10:36.070
We need to do that regardless of what the status is either way, whether it's eligible, equipped or

10:36.070 --> 10:36.940
unlocked.

10:36.970 --> 10:41.830
If we're in this if statement, we need to spend a spell point.

10:41.920 --> 10:43.630
So to do that.

10:44.490 --> 10:48.300
I'm first going to make some room up here at the top.

10:48.300 --> 10:51.930
We'll do the spell point spending First.

10:52.140 --> 11:01.020
I need to change the number of spell points and luckily we have an interface that our Avatar actor implements

11:01.050 --> 11:04.470
if we go to our interaction folder in public.

11:05.830 --> 11:07.960
And look at our player interface.

11:08.200 --> 11:16.600
We have add to spell points and our character or a character implements add to spell points.

11:17.500 --> 11:22.270
All it does is gets the player state and calls add to spell points.

11:22.270 --> 11:28.240
But the player state broadcast a delegate in response to changing spell points which are spell menu

11:28.240 --> 11:29.410
responds to.

11:29.440 --> 11:33.220
So that should take care of our spell menu updating.

11:33.460 --> 11:40.420
So I'm going to close our A character and player interface and we're going to see if our Avatar actor

11:40.420 --> 11:41.410
implements the interface.

11:41.410 --> 11:45.790
We know it does, but we're going to say if get Avatar actor.

11:48.410 --> 11:50.140
We're going to call implements.

11:50.150 --> 11:52.250
Checking if it implements you.

11:52.250 --> 11:53.540
Player interface.

11:56.920 --> 12:04.180
And then we're going to take iPlayer interface and call execute add to spell points and we're going

12:04.180 --> 12:06.430
to add negative one to the spell points.

12:06.430 --> 12:08.470
So we're spending a spell point.

12:09.110 --> 12:11.540
Of course we have to pass in the avatar first.

12:11.570 --> 12:13.190
Get Avatar actor.

12:14.540 --> 12:21.560
So this results in us spending a spell point and all of that stuff is handled for multiplayer, so that

12:21.590 --> 12:23.810
handles spending a spell point.

12:23.930 --> 12:25.610
But what about the status?

12:25.640 --> 12:34.400
Our spell menu needs to know of this change in status and we do have a client RPC client update ability

12:34.430 --> 12:40.760
status so we can call that and that will result in the ability status changed delegate broadcast.

12:40.760 --> 12:45.440
And because it's a client RPC that will work in multiplayer too.

12:45.530 --> 12:52.160
So we could just call client update ability status after changing the status, we know that the status

12:52.160 --> 12:53.270
has been changed.

12:53.270 --> 13:00.560
If it was eligible now it's going to be unlocked so we can broadcast that change, so we can just call

13:00.560 --> 13:01.250
it right there.

13:01.250 --> 13:02.510
But here's the thing.

13:02.510 --> 13:09.660
I also want my spell menu to know the level of the ability now because we're going to be displaying

13:09.660 --> 13:14.730
information in our description boxes, and that depends on the level.

13:14.730 --> 13:21.330
So I really think that whenever we update the ability status and broadcast this delegate, we should

13:21.330 --> 13:25.200
also broadcast the current ability level for this ability.

13:25.500 --> 13:31.140
I think that's important enough information to broadcast along with the tag and the status.

13:31.350 --> 13:37.050
Now that means we have to change it wherever we're calling client update ability status, which includes

13:37.050 --> 13:38.760
update ability statuses.

13:38.760 --> 13:41.970
But in update ability statuses, that's not a problem.

13:41.970 --> 13:43.740
We know what the level is.

13:43.770 --> 13:49.590
If we're updating ability statuses, right, If we're giving the ability for the first time, it's level

13:49.590 --> 13:50.370
one.

13:50.370 --> 13:56.340
And here in spend spell point when we're upgrading it, well, we know the level here too, because

13:56.340 --> 13:59.040
we can get the level from the ability spec here.

13:59.340 --> 14:06.750
So I'd like to take client update ability status and add another input parameter to it for the abilities

14:06.750 --> 14:07.490
level.

14:07.500 --> 14:10.460
Let's do that in the header file.

14:10.470 --> 14:12.960
So here's client update ability status.

14:12.960 --> 14:18.480
We're just going to add an int 32 called ability level.

14:21.140 --> 14:25.970
And that means we must add that to the implementation as well.

14:27.490 --> 14:34.090
And we also need to take ability status changed and change this delegate so it can take an INT 32 as

14:34.090 --> 14:34.680
well.

14:34.690 --> 14:42.460
So we'll go to ability status changed and change it so that it can also take an INT 32 and we'll make

14:42.460 --> 14:48.430
a inline comment here that says what the 32 is, it's going to be the ability level.

14:49.060 --> 14:52.030
So now this delegate takes an INT 32.

14:52.060 --> 14:58.660
We can broadcast the ability level that gets passed in to client update ability status.

14:58.750 --> 15:06.220
And of course this will be red because declare multicast delegate now has to be three params.

15:06.980 --> 15:08.510
So that'll take care of that.

15:09.570 --> 15:14.240
So now whenever we call client update ability status, we have to pass the level in.

15:14.250 --> 15:20.010
So I'm going to just quickly search for client update ability status and find all cases where we're

15:20.010 --> 15:24.000
calling it, we're calling it an update ability statuses.

15:24.000 --> 15:30.480
And here if we got the spec and it's null pointer, we're adding the ability for the first time with

15:30.480 --> 15:31.680
a level of one.

15:31.680 --> 15:38.250
So client update ability status in this case needs to take in one and then that's the only place we're

15:38.250 --> 15:43.440
calling it, except we're now going to call it again here in server spin spell point.

15:43.710 --> 15:50.130
Now we're going to call it passing in a different value depending on if we're changing its status or

15:50.130 --> 15:51.360
if we're leveling it up.

15:51.360 --> 15:52.040
Right.

15:52.690 --> 15:55.510
Really, we're just going to broadcast the abilities level.

15:55.510 --> 16:04.060
So we're going to call client update ability status passing in the ability tag, which we have its ability

16:04.060 --> 16:10.690
tag passing in the status we just called that status.

16:11.210 --> 16:16.430
And now passing in the ability level, which is ability spec level.

16:17.870 --> 16:24.470
And that will result in our delegates broadcast to the spell menu widget controller and then they'll

16:24.470 --> 16:25.190
update.

16:25.720 --> 16:31.210
And at this point, because we changed our ability spec, if we'd like to force it to replicate now

16:31.210 --> 16:37.990
rather than on the next update, we can call mark ability spec dirty passing in the ability spec which

16:38.020 --> 16:40.990
it's a pointer, so I have to dereference it to pass it in.

16:41.230 --> 16:50.080
So with that we're now broadcasting the ability status changed when we've spent a point and we've subtracted

16:50.080 --> 16:57.760
one from spell points and we've upgraded the status or the level of one of our abilities.

16:57.790 --> 17:05.230
Either way, we're broadcasting ability status changed and our spell menu widget controller is receiving

17:05.230 --> 17:07.120
that ability status change.

17:07.120 --> 17:12.820
But this lambda now has to receive an int 32 called level.

17:12.820 --> 17:14.260
We'll call it new level.

17:15.160 --> 17:21.430
So we're not using the level yet, but now our spell menu widget controller will receive it and as soon

17:21.430 --> 17:27.280
as the status changes, we'll know what that new level is and we can use that in the future.

17:28.160 --> 17:34.040
So for now, let's see what happens when we try to spend a spell point.

17:36.530 --> 17:36.980
Okay.

17:36.980 --> 17:38.150
We're back in the editor.

17:39.230 --> 17:41.090
I'm going to go ahead and press play.

17:41.600 --> 17:42.800
Open up my spells.

17:42.800 --> 17:46.100
I don't have any spell points, so I'm going to need to level up once.

17:48.350 --> 17:50.090
Now I have a spell point.

17:50.390 --> 17:52.160
So here's the thing.

17:52.250 --> 17:55.820
Right now, my firebolt spell is level one.

17:55.980 --> 17:57.710
At least it should be.

17:57.710 --> 18:04.700
And if I launch a single firebolt without being blocked or a critical hit, I should see.

18:04.730 --> 18:08.450
Well, of course I get a critical hit, but let's see what I get.

18:08.450 --> 18:08.750
I get.

18:08.750 --> 18:12.140
I should see ten if it's not blocked or critical.

18:12.900 --> 18:15.120
That was a critical but ten.

18:15.150 --> 18:23.460
Yes, I should see ten normally now, if I upgrade my firebolt spell by spending a point on it.

18:24.650 --> 18:28.550
Of course, nothing happens because I'm not calling my blueprint callable function.

18:28.550 --> 18:29.750
I do need to do that.

18:29.750 --> 18:36.170
So let's go into spell menu and make sure that we call that when we click our spend point button.

18:36.530 --> 18:43.100
So we need to assign an event for on clicked.

18:44.210 --> 18:47.360
We'll do it here for our other clicked events.

18:48.080 --> 18:51.260
So I'm going to take my button, spend point.

18:54.250 --> 18:58.870
I need to get its button widget because this is a wide button widget.

18:58.870 --> 19:03.460
So getting its button, I'm going to assign onclicked.

19:06.610 --> 19:12.250
So Onclicked I'm going to take my spell Menu Widget Controller.

19:15.180 --> 19:17.760
And call spin point button pressed.

19:18.030 --> 19:23.760
Now we're assigning to on clicked using a spell menu widget controller.

19:23.790 --> 19:26.550
Right here in event construct.

19:26.580 --> 19:30.600
We're doing it before widget controllers have been set.

19:30.630 --> 19:35.750
Now we're just relying on that happening before we go and click anything.

19:35.760 --> 19:42.390
But to be absolutely safe, we could make sure to bind this after widget controllers have been set.

19:42.810 --> 19:47.160
So that would be right here after we've set widget controller.

19:47.160 --> 19:49.020
So we should put this down here.

19:53.640 --> 19:59.810
So here when we click the spin point button, then we'll call spin point button pressed.

19:59.820 --> 20:04.590
So I'm going to comment this and say spend point button pressed.

20:05.740 --> 20:07.210
And all that stuff up here.

20:07.210 --> 20:08.710
This is just for.

20:10.680 --> 20:12.510
Clicking on spell globes.

20:12.780 --> 20:16.530
So we'll say spell globes selected.

20:17.070 --> 20:23.880
But what we're interested in right now is actually pressing on the spend point button.

20:23.880 --> 20:26.340
We want to see things happen.

20:26.340 --> 20:27.720
So let's try that again.

20:29.690 --> 20:35.900
I'm going to level up once we know that our damage is ten unblocked or on critical hit.

20:37.080 --> 20:40.290
And if I select my firebolt and click spend point.

20:42.170 --> 20:43.730
Okay.

20:44.240 --> 20:47.690
Spin point button pressed should be called.

20:47.870 --> 20:52.830
Oh yes, it is called, but I never called my ability system components function.

20:52.860 --> 21:00.560
I forgot another thing, so I'm going to need to call my ability system component function that I called

21:00.590 --> 21:02.100
server spin spell point.

21:02.120 --> 21:03.680
We need to call that function.

21:03.680 --> 21:11.060
So we're going to go back to spin point button pressed and call, get AC get or AC that is.

21:11.930 --> 21:18.050
And call server spend spell point and it's going to be our selected ability.

21:18.310 --> 21:20.030
Dot ability tag.

21:20.480 --> 21:23.030
It's just called selected ability dot ability.

21:23.030 --> 21:24.290
That's the gameplay tag.

21:24.290 --> 21:25.820
That's what we need to do.

21:25.910 --> 21:33.530
And just in case we call this before, the ability system component has been set, we can say if get

21:33.560 --> 21:40.670
aura, ability, system component and only do this if the ability system component is set.

21:41.540 --> 21:42.020
Okay.

21:42.020 --> 21:43.760
So that's an important step.

21:43.760 --> 21:45.920
I'm going to go ahead and close.

21:45.920 --> 21:48.320
We need to save our progress there.

21:48.410 --> 21:53.930
And now we should see this function called let's try this yet one more time.

21:55.410 --> 21:56.280
All right.

21:56.280 --> 21:57.480
So we're back.

21:57.510 --> 22:01.710
I expect something to happen, so I'm going to level up first.

22:03.310 --> 22:08.140
And now that I have a point, I'm going to select my firebolt spell, click spend point.

22:09.050 --> 22:09.890
There we go.

22:09.890 --> 22:11.360
That's what I expected to happen.

22:11.360 --> 22:12.260
So spell points.

22:12.260 --> 22:13.850
Updated the button.

22:13.850 --> 22:14.750
Updated.

22:14.870 --> 22:15.920
Excellent.

22:15.920 --> 22:19.070
And we should see more damage than ten.

22:23.680 --> 22:25.900
Okay, so it still says ten.

22:25.900 --> 22:28.420
It could be still ten.

22:28.420 --> 22:34.680
Based on our calculations, what we need to do is see if we're actually upgrading that ability.

22:34.690 --> 22:39.970
So we should be down here where we're increasing the abilities level.

22:40.210 --> 22:44.200
We'll see if we make it and I'll place a breakpoint down here just in case.

22:44.200 --> 22:46.540
So let's go ahead and level up.

22:49.160 --> 22:52.640
And upgrade and in server spend point.

22:52.670 --> 23:02.690
Yes, we are changing the ability spec level and we are calling client update ability status with firebolt

23:02.690 --> 23:03.890
status shouldn't change.

23:03.890 --> 23:05.060
It's still equipped.

23:05.090 --> 23:10.640
The level is now two, so our ability spec should now be two.

23:12.540 --> 23:18.900
And what I can do to make sure of that is I can go to blueprints, ability system or abilities, fire

23:18.900 --> 23:27.360
Firebolt, Firebolt and I can print the ability level right here as soon as we activate the ability.

23:27.510 --> 23:32.100
So I'm going to print string, I'm going to get ability level.

23:37.230 --> 23:40.080
Going to print that right there.

23:41.400 --> 23:47.130
I'm going to launch and I see one server, one I'm going to level up.

23:50.500 --> 23:55.140
And I'm going to spend a point and launch my ability.

23:55.150 --> 23:55.600
Yes.

23:55.600 --> 23:57.520
So my ability is level two.

24:01.810 --> 24:09.040
We still see that it's causing ten damage, which means I have the feeling something I must have hardcoded

24:09.070 --> 24:11.400
for testing purposes.

24:11.410 --> 24:19.180
I'm going to go to ability system abilities or a projectile spell and see what level I'm setting for

24:19.180 --> 24:20.080
my spec handle.

24:20.080 --> 24:21.880
I'm setting it to ability level.

24:22.030 --> 24:30.640
I'm setting my scale damage based on my ability level and my Firebolt if I go to class, defaults has

24:30.640 --> 24:34.090
my damage types with fire.

24:34.240 --> 24:38.650
We're using our firebolt curve in this curve table.

24:40.010 --> 24:43.250
At level one, it should be ten at level two.

24:43.280 --> 24:44.330
It's still ten.

24:44.330 --> 24:45.200
Look at that.

24:45.200 --> 24:47.840
It doesn't go up more than 0.168.

24:47.960 --> 24:55.370
So what I'm going to do just for testing purposes is take this other key here and bring it down to level

24:55.400 --> 24:57.410
two and make sure that it's 20.

24:57.440 --> 24:58.280
You know what?

24:58.280 --> 24:59.780
Let's put it up to 40.

24:59.810 --> 25:00.740
Why not?

25:01.070 --> 25:04.640
In fact, I'm just going to scale the whole thing up a little bit.

25:06.250 --> 25:08.200
Let's do more damage, shall we?

25:09.400 --> 25:13.270
So at level two, we should see now closer to 40 damage.

25:13.270 --> 25:16.120
At level one, it'll just be a measly ten.

25:16.120 --> 25:16.840
So.

25:18.000 --> 25:19.260
Well, that was a critical hit.

25:19.260 --> 25:21.420
But there we saw ten there.

25:21.420 --> 25:26.640
And if I upgrade it now, we should see something closer to 40.

25:26.910 --> 25:28.470
Boom, 39.

25:28.470 --> 25:29.580
So it's working.

25:29.580 --> 25:30.570
Awesome.

25:30.690 --> 25:33.150
So upgrading our ability worked.

25:33.180 --> 25:37.380
Now we need to change the status for this one here.

25:37.380 --> 25:39.710
We need to change it from locked to eligible.

25:39.720 --> 25:41.670
Let's gain an ability point.

25:43.550 --> 25:44.150
There we go.

25:44.150 --> 25:44.930
Let's select it.

25:44.930 --> 25:46.280
Let's spend a point.

25:47.580 --> 25:48.870
Okay.

25:48.870 --> 25:57.090
So it should have upgraded from eligible to unlocked, right?

25:57.420 --> 26:02.130
It should have gone from eligible to unlocked in our ability system component.

26:02.130 --> 26:03.870
We see that it should be right here.

26:03.870 --> 26:06.930
We should remove eligible and add unlocked.

26:06.930 --> 26:08.910
Let's see if we reach that.

26:15.940 --> 26:17.030
Yeah, we're reaching it.

26:17.050 --> 26:19.840
We're setting its status tag.

26:20.230 --> 26:21.730
We're removing eligible.

26:21.730 --> 26:23.110
We're setting unlocked.

26:24.830 --> 26:30.590
We're calling client update ability status with the new status eligible.

26:31.010 --> 26:32.240
No, we're not.

26:32.270 --> 26:33.470
It should be unlocked.

26:33.500 --> 26:35.450
We're passing in eligible.

26:35.480 --> 26:36.680
It should be unlocked.

26:36.680 --> 26:37.150
Right.

26:37.160 --> 26:39.840
That's because we're passing in status here.

26:39.860 --> 26:45.890
We're not passing in unlocked because we never set status to unlocked.

26:45.930 --> 26:46.250
Okay.

26:46.250 --> 26:48.410
So that's another thing to change.

26:48.440 --> 26:51.020
So what I'm going to do is resume.

26:51.790 --> 26:53.500
And close the editor.

26:54.990 --> 27:01.350
Saving all and we need to make sure to pass in that updated status because it's now changed.

27:01.380 --> 27:08.430
So right here, status needs to be updated right here if we're changing it to unlocked.

27:08.460 --> 27:10.710
That way we'll pass in unlocked.

27:11.280 --> 27:14.550
Otherwise we're just passing in that status before we changed it.

27:14.550 --> 27:20.280
So now that we're passing in the updated status, it should be correct.

27:20.430 --> 27:22.380
So let's test this again.

27:24.080 --> 27:27.260
So a little details that you get wrong sometimes.

27:27.410 --> 27:31.310
That's where debugging capabilities really comes in handy.

27:31.640 --> 27:36.530
The better your debugging abilities, the better you are as a software developer.

27:38.980 --> 27:39.960
All right, we're back.

27:39.970 --> 27:41.980
Let's test this again.

27:44.280 --> 27:45.810
So I have.

27:47.420 --> 27:49.250
A locked ability here.

27:49.670 --> 27:51.560
Let's go ahead and level up.

27:54.060 --> 27:59.930
We'll take this ability, click spend point and boom, look at that.

27:59.940 --> 28:02.310
It is now eligible.

28:02.670 --> 28:03.750
Amazing.

28:03.780 --> 28:04.920
Amazing.

28:05.630 --> 28:12.190
That just makes me really happy to see that next ability there with the blue color.

28:12.200 --> 28:13.220
It's working.

28:13.220 --> 28:14.410
It looks great.

28:14.420 --> 28:22.460
That is just a huge milestone and already this spell menu looks so much better with two different abilities.

28:22.730 --> 28:29.540
But now that it's unlocked, we need to be able to click, equip and then assign it and then be able

28:29.540 --> 28:30.890
to activate it.

28:30.920 --> 28:32.360
That's the next step.

28:32.360 --> 28:36.080
But for now, we have the ability to spend our spell points.

28:36.260 --> 28:37.460
It looks great.

28:37.460 --> 28:40.820
Let's try this in multiplayer so we're not out of the woods yet.

28:40.850 --> 28:43.820
We need to try this on a client, right?

28:43.820 --> 28:49.340
So we're going to go ahead and I'm just going to click on it just because I can.

28:49.340 --> 28:50.900
I'm going to upgrade.

28:51.380 --> 28:52.940
Let's level up.

28:54.010 --> 28:54.640
There we go.

28:54.640 --> 28:58.150
We see that it's spend point has been activated.

28:58.150 --> 29:01.200
Let's spend a point and boom, there it is.

29:01.210 --> 29:02.530
It works.

29:02.530 --> 29:04.330
I'm going to level up again.

29:05.050 --> 29:09.850
Just so I can increase the damage from my firebolt and test that mechanic.

29:13.390 --> 29:14.610
Don't feel like dying.

29:14.620 --> 29:15.760
Okay, There we go.

29:15.760 --> 29:18.970
And I'm going to upgrade my firebolt.

29:19.330 --> 29:19.520
Ha!

29:19.600 --> 29:20.890
Can't get me over here.

29:21.610 --> 29:26.560
And let's do some damage and 39 so basically 40.

29:26.890 --> 29:29.200
So it works on clients.

29:29.200 --> 29:30.730
That is good news.

29:30.730 --> 29:36.190
That is great news because this is really, really starting to come along.

29:36.220 --> 29:37.640
I'm really happy about it.

29:37.660 --> 29:41.460
It's just so satisfying to see a nice pretty HUD working.

29:41.470 --> 29:46.380
So just going to do it one more time upgrade and boom, we see it.

29:46.390 --> 29:51.710
I just need to be able to click, equip and equip it so we'll handle those things in the videos to come.

29:51.730 --> 29:55.540
Excellent job and I'll see you in the next video.
