WEBVTT

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

00:07.830 --> 00:14.730
Now we have some basic functionality for our melee attackers, but our ranged attackers do not really

00:14.730 --> 00:17.520
do anything when they're supposed to attack.

00:17.550 --> 00:19.620
Now, if we go into AI.

00:19.650 --> 00:26.070
Behaviour tree and open our behaviour tree, we know that if they are ranged attackers, we do get to

00:26.070 --> 00:32.970
the ranged attack behavior tree task and if we open that we see that we call try activate abilities

00:32.970 --> 00:39.210
by tag passing the attack tag which is just set to abilities dot attack.

00:39.390 --> 00:45.660
So if those ranged attackers had some abilities that have that tag, they would be activated.

00:45.690 --> 00:51.180
So what does our Slingshot goblin really need to do in its ability?

00:51.210 --> 00:53.460
Well, it's going to launch a projectile.

00:53.460 --> 00:56.690
It's presumably going to launch a rock, right?

00:56.700 --> 01:00.240
Well, that's basically what our ora projectile spell does.

01:00.270 --> 01:01.920
It launches a projectile.

01:01.920 --> 01:05.460
It does other things, too, like play an attack montage and so on.

01:05.460 --> 01:11.350
But really, at the base, the C plus plus class for it has things that we could use.

01:11.380 --> 01:18.670
Let's go into ora projectile spell dot CP Now all that the C plus plus class has is a blueprint callable

01:18.670 --> 01:23.410
spawn projectile function and it takes a projectile target location.

01:23.410 --> 01:32.290
So on the server it's going to get the socket location using the combat interface function, get combat

01:32.290 --> 01:36.780
socket location and it's going to search for the weapon socket.

01:36.790 --> 01:43.960
So this ora projectile spell is really specific to the weapon socket unless of course we changed it.

01:43.960 --> 01:50.230
So that spawn projectile could take a gameplay tag that we can pass in to get combat socket location

01:50.230 --> 01:52.150
and get, say, a hand socket.

01:52.150 --> 01:56.890
If we wanted our enemies to throw something from their hand, for example.

01:56.920 --> 02:02.050
Now it sets the rotation using the projectile target location.

02:02.050 --> 02:08.200
So if it's aiming at something, if it has a location that we pass in that's valid, it's going to aim

02:08.200 --> 02:10.930
that projectile in that direction.

02:10.930 --> 02:17.650
It's then going to set the spawn, transform, spawn the projectile, but using spawn actor deferred.

02:17.650 --> 02:24.310
And then it sets a bunch of things on the effect context as well as set the gameplay effect spec based

02:24.310 --> 02:26.040
on the damage effect class.

02:26.050 --> 02:33.520
After that, it loops through all of its damage types in the ability and performs a lookup based on

02:33.520 --> 02:40.650
their curve table and then sets the damage effect spec handle and finishes spawning the projectile.

02:40.660 --> 02:44.800
This is all stuff that we could use for our slingshot enemy.

02:44.920 --> 02:51.280
So since we have the basic spawn projectile function that we need, we can create a blueprint based

02:51.280 --> 02:56.110
on ora projectile spell and use it for our ranged attack enemies.

02:56.110 --> 02:57.820
So I'd like to do that.

02:58.270 --> 03:04.660
So I'm going to go into Blueprint's ability system and already I'm starting to see a need to separate

03:04.660 --> 03:07.450
this into Ora and enemies.

03:07.450 --> 03:13.690
So I'm going to make a new folder called Ora and a new folder called Enemies.

03:15.160 --> 03:19.700
Or just enemy and we'll leave data where it is.

03:19.720 --> 03:26.950
But for gameplay abilities we have to hit react, melee attack and test gameplay ability.

03:26.980 --> 03:29.730
These belong in enemy.

03:29.740 --> 03:34.960
So Enemy is going to have a new folder called Abilities.

03:34.990 --> 03:38.290
We'll go ahead and make a new folder called effects as well.

03:38.680 --> 03:43.030
And back out into ability system gameplay abilities.

03:43.030 --> 03:47.260
We'll take these three and we'll put them in enemy abilities.

03:49.090 --> 03:55.060
And we'll move here and now Ora can get the fire gameplay ability.

03:55.300 --> 04:00.640
So fire can go into Ora, which should get its own abilities folder.

04:00.640 --> 04:03.850
So Ora gets an abilities.

04:04.870 --> 04:07.060
We'll also make an effects folder.

04:07.780 --> 04:15.010
So back to ability system to gameplay abilities, we'll take fire and we'll put it in Ora abilities

04:15.460 --> 04:16.480
move here.

04:16.750 --> 04:20.860
And now we don't need the gameplay abilities folder that's empty.

04:21.010 --> 04:26.260
Let's go to gameplay effects and we have g damage and g hit react.

04:26.290 --> 04:36.130
Damage is used by basically both ora and enemies, but we can place it in the ora effects folder.

04:36.130 --> 04:37.090
That's fine.

04:37.360 --> 04:40.630
And g hit react can go in enemy effects.

04:41.190 --> 04:46.800
And then we have default attributes both for aura and enemy and then of course, ones that are used

04:46.800 --> 04:49.680
by both for ones that are used by both.

04:49.680 --> 04:52.020
We'll put those in the aura effects.

04:53.400 --> 04:57.240
And aura has aura, primary and secondary.

04:57.240 --> 05:01.200
Those will go in aura effects move here and now.

05:01.200 --> 05:03.990
This aura folder is empty.

05:04.020 --> 05:09.510
We have enemy with the enemy primary attributes for each enemy class.

05:10.430 --> 05:12.590
We'll go ahead and move that into effects.

05:12.590 --> 05:14.240
And we have the curve tables.

05:14.240 --> 05:17.270
Those can also be moved into enemy effects.

05:18.230 --> 05:20.330
And now enemy is an empty folder.

05:20.330 --> 05:21.530
We can delete it.

05:21.530 --> 05:26.210
And then secondary attributes enemy and secondary attributes test.

05:26.240 --> 05:28.190
Those can go into enemy effects.

05:28.190 --> 05:29.630
Move here and now.

05:29.660 --> 05:35.030
Default attributes is empty and now ability system gameplay effects is empty.

05:35.030 --> 05:38.150
We'll delete that and we'll leave the gameplay tags there.

05:38.420 --> 05:45.830
So now ability system has aura and enemy and an enemy we can go to abilities and we can add another

05:45.860 --> 05:47.570
gameplay ability.

05:47.690 --> 05:54.110
So I'm going to right click and go to Blueprint class and search for Aura projectile spell.

05:55.940 --> 06:03.920
Because this is going to be a projectile spell and we're going to call this G a underscore ranged attack.

06:04.550 --> 06:12.950
So now we have a ranged attack gameplay ability, and this is going to be what our Slingshot goblin

06:12.950 --> 06:14.450
is going to use.

06:14.480 --> 06:20.240
Now it needs a projectile to spawn and it needs a damage effect class as well as damage type.

06:20.240 --> 06:24.860
So we have quite a few things we're going to need to set for this.

06:24.890 --> 06:33.530
We also need the ability tag set to that attack tag in order for the attack task to be able to activate

06:33.530 --> 06:37.610
it because it's activating abilities by abilities attack.

06:38.150 --> 06:38.540
Okay.

06:38.540 --> 06:44.390
So we have a number of things to set here, and we're going to start in the next video by creating a

06:44.390 --> 06:47.640
projectile class for our slingshot enemy.

06:47.660 --> 06:50.270
So great job and I'll see you soon.
