Welcome back.
Now we have some basic functionality for our melee attackers, but our ranged attackers do not really
do anything when they're supposed to attack.
Now, if we go into AI.
Behaviour tree and open our behaviour tree, we know that if they are ranged attackers, we do get to
the ranged attack behavior tree task and if we open that we see that we call try activate abilities
by tag passing the attack tag which is just set to abilities dot attack.
So if those ranged attackers had some abilities that have that tag, they would be activated.
So what does our Slingshot goblin really need to do in its ability?
Well, it's going to launch a projectile.
It's presumably going to launch a rock, right?
Well, that's basically what our ora projectile spell does.
It launches a projectile.
It does other things, too, like play an attack montage and so on.
But really, at the base, the C plus plus class for it has things that we could use.
Let's go into ora projectile spell dot CP Now all that the C plus plus class has is a blueprint callable
spawn projectile function and it takes a projectile target location.
So on the server it's going to get the socket location using the combat interface function, get combat
socket location and it's going to search for the weapon socket.
So this ora projectile spell is really specific to the weapon socket unless of course we changed it.
So that spawn projectile could take a gameplay tag that we can pass in to get combat socket location
and get, say, a hand socket.
If we wanted our enemies to throw something from their hand, for example.
Now it sets the rotation using the projectile target location.
So if it's aiming at something, if it has a location that we pass in that's valid, it's going to aim
that projectile in that direction.
It's then going to set the spawn, transform, spawn the projectile, but using spawn actor deferred.
And then it sets a bunch of things on the effect context as well as set the gameplay effect spec based
on the damage effect class.
After that, it loops through all of its damage types in the ability and performs a lookup based on
their curve table and then sets the damage effect spec handle and finishes spawning the projectile.
This is all stuff that we could use for our slingshot enemy.
So since we have the basic spawn projectile function that we need, we can create a blueprint based
on ora projectile spell and use it for our ranged attack enemies.
So I'd like to do that.
So I'm going to go into Blueprint's ability system and already I'm starting to see a need to separate
this into Ora and enemies.
So I'm going to make a new folder called Ora and a new folder called Enemies.
Or just enemy and we'll leave data where it is.
But for gameplay abilities we have to hit react, melee attack and test gameplay ability.
These belong in enemy.
So Enemy is going to have a new folder called Abilities.
We'll go ahead and make a new folder called effects as well.
And back out into ability system gameplay abilities.
We'll take these three and we'll put them in enemy abilities.
And we'll move here and now Ora can get the fire gameplay ability.
So fire can go into Ora, which should get its own abilities folder.
So Ora gets an abilities.
We'll also make an effects folder.
So back to ability system to gameplay abilities, we'll take fire and we'll put it in Ora abilities
move here.
And now we don't need the gameplay abilities folder that's empty.
Let's go to gameplay effects and we have g damage and g hit react.
Damage is used by basically both ora and enemies, but we can place it in the ora effects folder.
That's fine.
And g hit react can go in enemy effects.
And then we have default attributes both for aura and enemy and then of course, ones that are used
by both for ones that are used by both.
We'll put those in the aura effects.
And aura has aura, primary and secondary.
Those will go in aura effects move here and now.
This aura folder is empty.
We have enemy with the enemy primary attributes for each enemy class.
We'll go ahead and move that into effects.
And we have the curve tables.
Those can also be moved into enemy effects.
And now enemy is an empty folder.
We can delete it.
And then secondary attributes enemy and secondary attributes test.
Those can go into enemy effects.
Move here and now.
Default attributes is empty and now ability system gameplay effects is empty.
We'll delete that and we'll leave the gameplay tags there.
So now ability system has aura and enemy and an enemy we can go to abilities and we can add another
gameplay ability.
So I'm going to right click and go to Blueprint class and search for Aura projectile spell.
Because this is going to be a projectile spell and we're going to call this G a underscore ranged attack.
So now we have a ranged attack gameplay ability, and this is going to be what our Slingshot goblin
is going to use.
Now it needs a projectile to spawn and it needs a damage effect class as well as damage type.
So we have quite a few things we're going to need to set for this.
We also need the ability tag set to that attack tag in order for the attack task to be able to activate
it because it's activating abilities by abilities attack.
Okay.
So we have a number of things to set here, and we're going to start in the next video by creating a
projectile class for our slingshot enemy.
So great job and I'll see you soon.