WEBVTT

00:06.820 --> 00:07.810
Welcome.

00:08.140 --> 00:11.890
Now our spell menu has quite a bit of information in it.

00:11.920 --> 00:18.010
For one, it has offensive abilities and passive abilities, and these spell trees are going to display

00:18.010 --> 00:21.760
information that kind of depends on the context.

00:21.940 --> 00:28.990
For example, we may have nine different abilities, but our character may not have gotten those abilities

00:28.990 --> 00:29.430
yet.

00:29.440 --> 00:31.390
It may not have been granted them.

00:32.000 --> 00:39.320
Now, the way that we get those abilities would be to level up and gain spell points and spend spell

00:39.320 --> 00:41.370
points to unlock those abilities.

00:41.390 --> 00:46.490
So for that reason, we need the concept of an ability status.

00:46.850 --> 00:53.690
An ability status can be one of several states that tell us what we can do with an ability and what

00:53.690 --> 00:54.650
we can't.

00:54.860 --> 01:01.160
For example, when we open the spell menu, do we show a locked icon or do we actually show the ability

01:01.160 --> 01:02.050
icon?

01:02.060 --> 01:05.210
And if we show the ability icon, does that mean we can use it?

01:05.210 --> 01:07.400
Can we equip it and so on?

01:07.760 --> 01:12.260
I'd like to have four main options for ability status.

01:12.590 --> 01:16.100
The first is locked and that's the most obvious.

01:16.130 --> 01:18.770
Our spell menu shows the locked icon.

01:18.770 --> 01:22.130
We can't even see what that icon is supposed to look like.

01:22.340 --> 01:24.920
The next status is eligible.

01:25.310 --> 01:32.700
Now, as soon as we level up, we may now meet the level requirements for some of our abilities that

01:32.700 --> 01:34.380
were previously locked.

01:34.530 --> 01:41.070
So each ability is going to have its own level requirement and it will remain locked until the player

01:41.070 --> 01:42.700
has reached that level.

01:42.750 --> 01:50.100
As soon as the player reaches that level, then any abilities that the player now meets the level requirements

01:50.100 --> 01:55.350
for will change from the locked icon to something else.

01:55.380 --> 02:02.070
I'd like to show the actual icon of that ability, but I still want the background to be grayed out.

02:02.430 --> 02:05.370
So this is what the eligible status looks like.

02:06.210 --> 02:13.980
So an eligible ability is one for which we meet the level requirement, but we have not yet spent any

02:13.980 --> 02:16.530
spell points on it to unlock it.

02:16.770 --> 02:21.120
As soon as it's eligible, we can then spend spell points on it.

02:21.120 --> 02:27.720
And if we spend a spell point on it, we can unlock that ability, at which point the icon will now

02:27.720 --> 02:32.160
show the color corresponding to that abilities icon.

02:32.520 --> 02:35.250
At this point, the ability is now unlocked.

02:35.280 --> 02:40.320
We have spent at least one spell point on it and we can now equip it.

02:40.470 --> 02:43.050
Now, that doesn't mean it's equipped yet.

02:43.080 --> 02:50.100
We are going to manually equip these abilities because we want to choose which input to assign it to.

02:50.700 --> 02:56.880
So we can select the ability, hit the equip button and then choose the input from our equipped abilities.

02:56.880 --> 03:02.460
Row at the bottom so that row down there is not just cosmetic, it's functional.

03:02.730 --> 03:07.980
Now, as soon as we equip one of our abilities, it will now be in the equipped state.

03:08.010 --> 03:11.130
That means it's assigned to one of our inputs.

03:11.130 --> 03:16.650
And in the game, if we press those inputs, we'll activate those abilities provided we can pay their

03:16.650 --> 03:17.850
mana costs.

03:18.540 --> 03:25.650
So the unlocked and the equipped ability statuses will have icons that show what the actual ability

03:25.650 --> 03:27.450
icon is supposed to look like.

03:27.660 --> 03:32.910
In the case of Firebolt, we have this little fireball and the background is orange.

03:33.720 --> 03:36.810
That's what we'll see in the offensive abilities spell tree.

03:36.810 --> 03:41.940
And if it's equipped, it will also appear down in the equipped abilities row.

03:42.150 --> 03:49.680
So because our abilities can be in one of these four statuses, we're going to need some gameplay tags

03:49.680 --> 03:51.780
to identify that status.

03:51.810 --> 03:55.530
Each ability is going to need a status ability tag.

03:55.800 --> 04:04.020
We're going to need a locked ability tag, an eligible tag, an unlocked tag, and an equipped tag.

04:04.900 --> 04:08.180
And these can change at runtime and in fact, they will.

04:08.200 --> 04:13.030
So these belong in an ability specs dynamic ability tags, container.

04:13.060 --> 04:19.600
So we're going to have to program the capability to add and remove these tags so that our gameplay ability

04:19.630 --> 04:26.590
specs for our activatable abilities will always keep track of what status they're currently in.

04:27.170 --> 04:28.880
Now for the spell menu.

04:29.120 --> 04:35.960
As soon as we've broadcast information to it, we need to know whether or not that ability is passive

04:35.960 --> 04:42.710
or offensive, as those are the types of abilities we're showing in our spell menu.

04:42.980 --> 04:47.970
So we also need gameplay tags to identify an abilities type.

04:47.990 --> 04:52.580
Is it an offensive ability, a passive ability or neither?

04:52.670 --> 04:57.380
So we can have three different gameplay tags used to distinguish abilities.

04:57.410 --> 05:03.560
You see, an ability may not be either offensive or passive, in which case it doesn't belong in the

05:03.560 --> 05:04.850
spell menu at all.

05:04.880 --> 05:09.620
These can be basic abilities like hit, react, death, and so on.

05:09.650 --> 05:17.150
For this reason, I'd like to distinguish between those generic abilities and our offensive and passive

05:17.150 --> 05:20.240
abilities, which I'll refer to as spells.

05:20.360 --> 05:28.050
So our spells are abilities that we see in the spell menu, offensive and passive abilities, but are

05:28.080 --> 05:29.520
non spells.

05:29.550 --> 05:33.510
Those will be things like hit, react death.

05:33.540 --> 05:39.630
We also have a listen for events ability which listens for gameplay events.

05:39.630 --> 05:40.190
Right?

05:40.200 --> 05:44.790
That's not a spell, it's just a passive ability that does something we need to do.

05:44.820 --> 05:49.500
It's always going to be active and we don't need to show it in the spell menu.

05:50.250 --> 05:56.490
So now we have a plan and we need to add some more gameplay tags to our native gameplay tags.

05:56.490 --> 06:03.180
Singleton And we also need to make sure that as soon as we equip our startup abilities that they have

06:03.180 --> 06:05.100
their status set to equipped.

06:05.550 --> 06:07.170
So let's do that now.

06:07.770 --> 06:10.390
Here's our ora gameplay tag Singleton.

06:10.410 --> 06:12.990
We now need a few more tags.

06:13.350 --> 06:17.510
We're going to put these tags next to our other ability tags.

06:17.520 --> 06:19.290
We should only have one of them.

06:19.290 --> 06:24.120
And actually we have two abilities attack and abilities summon.

06:24.420 --> 06:29.730
And while I'm here I'm remembering that we had this effects hit react that we're using for the enemy

06:29.730 --> 06:30.660
hit react.

06:30.690 --> 06:33.840
We're sending a gameplay event from the attribute set.

06:33.870 --> 06:39.960
We're sending an event with this particular tag that will trigger our enemies, hit, react and then

06:39.960 --> 06:44.630
our enemy hit react Gameplay ability is using this effects hit react.

06:44.640 --> 06:50.100
I'd like to make an abilities hit react and use that instead so we'll make that while we're at it.

06:50.780 --> 06:57.890
So first I'm going to make a new gameplay tag called Abilities Hit React.

06:58.940 --> 07:02.420
We'll separate these from the ones that have already been defined.

07:02.660 --> 07:08.450
Now, in addition to that, we're going to need our statuses, so we're going to have an gameplay tag

07:10.370 --> 07:16.310
called Abilities Underscore status Underscore locked.

07:18.480 --> 07:21.210
We'll also need status eligible.

07:22.440 --> 07:28.740
We'll need status unlocked and we'll need status equipped.

07:30.540 --> 07:32.970
We're also going to need ability types.

07:32.970 --> 07:34.800
So we're going to have abilities.

07:37.360 --> 07:38.110
Type.

07:38.770 --> 07:40.390
Underscore offensive.

07:42.100 --> 07:43.540
Go ahead and copy that.

07:44.020 --> 07:46.510
We'll need abilities type passive.

07:48.580 --> 07:50.710
And abilities type None.

07:51.160 --> 07:54.020
So we have eight new tags to make.

07:54.040 --> 07:57.520
Let's start with hit, react and do statuses and types.

07:57.820 --> 08:04.900
So here in the abilities, I'm going to copy this one, paste it and this will be abilities hit react.

08:06.580 --> 08:09.280
The tag will be abilities dot hit react.

08:10.460 --> 08:14.000
The string will say hit, react, ability.

08:14.450 --> 08:16.940
Now we need our ability statuses.

08:19.440 --> 08:26.850
So this will be abilities, status and we'll start at the top with eligible F name will be abilities

08:26.850 --> 08:29.940
dot status dot eligible.

08:33.520 --> 08:38.620
It'll say eligible status for the string and we'll copy this.

08:40.390 --> 08:46.390
Next we'll have status equipped F name will be equipped.

08:46.870 --> 08:48.490
F string will say equipped.

08:49.300 --> 08:51.130
Two more statuses.

08:51.960 --> 08:55.650
Next one is locked.

08:57.120 --> 09:00.270
So we'll change the name and the F string.

09:01.150 --> 09:02.620
And the last one.

09:04.870 --> 09:07.210
Which will be unlocked.

09:08.260 --> 09:11.410
And again, changing the name and the F string.

09:11.440 --> 09:14.890
Now we need to do our types, so I'm going to time lapse this one.

09:34.480 --> 09:38.530
Okay, so we have our ability types and our ability statuses.

09:39.180 --> 09:45.030
The last thing we need to do in this video is make sure when we give our startup abilities that we set

09:45.030 --> 09:46.920
that status to equipped.

09:47.040 --> 09:54.180
We do this in the ability system component so we can go into ability system component, our aura version.

09:55.950 --> 10:00.930
And search for where we're giving ability so we can control f give ability.

10:01.350 --> 10:04.020
We're doing this and add character abilities.

10:04.200 --> 10:07.020
Now notice what we're doing an Add character abilities.

10:07.020 --> 10:14.160
We are adding a dynamic ability tag our startup input tag before we call give ability.

10:14.850 --> 10:19.410
Now, what we also need to do is give the tag for its status.

10:19.410 --> 10:23.400
And if we're giving the ability, we know that it's already going to be equipped.

10:23.400 --> 10:26.400
So these are the equipped abilities that we start off with.

10:26.430 --> 10:34.590
So we're going to have ability spec dot, dynamic ability tags, dot add tag, and the tag we're going

10:34.590 --> 10:39.000
to add is going to be from for a gameplay tags.

10:39.420 --> 10:47.580
So we'll use for a gameplay tags get and it's going to be abilities status equipped.

10:48.480 --> 10:55.890
So the dynamic ability tags will be able to keep track of whether or not the ability is equipped and

10:55.890 --> 11:01.680
it'll be handy to have a function that can return that status based on an ability spec.

11:02.320 --> 11:04.510
So let's make a function for that.

11:04.540 --> 11:10.930
I'm going to go into our ability system components and add a public function that returns a gameplay

11:10.930 --> 11:14.860
tag that gets the status from a gameplay spec.

11:14.890 --> 11:21.580
This can be a static function and it's going to return an gameplay tag and we'll call this get status

11:21.580 --> 11:22.750
from spec.

11:23.140 --> 11:27.850
So this can take in a const gameplay ability spec reference.

11:29.630 --> 11:31.550
And it will return that status.

11:31.580 --> 11:33.530
Let's generate the definition.

11:33.530 --> 11:38.260
And what it's going to do is loop over the dynamic ability tags.

11:38.270 --> 11:47.630
So we're going to have a for loop and we'll say for F gameplay tag status tag and we're looping through

11:47.630 --> 11:54.860
the ability specs, dynamic ability tags, and we'll check to see if that ability tag matches.

11:54.860 --> 12:03.110
We're going to say if status tag dot matches tag and we want to match not exact, we want to match abilities

12:03.110 --> 12:04.010
dot status.

12:04.010 --> 12:13.190
So we're going to say F gameplay tag and we're going to call request gameplay tag using the name of

12:13.190 --> 12:15.950
abilities dot status.

12:18.470 --> 12:25.430
So if dynamic ability tags contains a tag, at least one that starts with abilities status, we can

12:25.430 --> 12:27.050
return that status tag.

12:30.250 --> 12:33.360
Otherwise we'll return an empty gameplay tag.

12:33.370 --> 12:35.500
So basically this line here.

12:35.920 --> 12:42.730
So now we have a handy static function that can always get the status from the ability spec if we have

12:42.730 --> 12:43.190
one.

12:43.210 --> 12:45.100
That'll be useful in the future.

12:45.220 --> 12:51.100
Now we have to remember that a gameplay ability should only have one status tag at a time.

12:51.100 --> 12:57.310
It doesn't make sense for it to have the equipped status and the locked status simultaneously.

12:57.430 --> 13:04.900
So once we set the statuses, we'll need to make sure to handle removing the old status tag before adding

13:04.900 --> 13:06.280
the new status tag.

13:06.960 --> 13:10.770
Now notice too, that we added some types.

13:10.770 --> 13:15.660
We have types offensive, passive, and none for our abilities.

13:15.690 --> 13:18.690
We'll make sure to handle that when the time comes.

13:18.690 --> 13:20.640
But for now, this is good.

13:20.640 --> 13:24.030
We now have an ability status that we can check.

13:25.050 --> 13:26.440
I'm going to go ahead and compile.

13:26.460 --> 13:30.000
Make sure we have no errors and build succeeded.

13:30.150 --> 13:32.880
Excellent job and I'll see you in the next video.
