Welcome back.
So now we have our fire blast ability.
Now we don't start with it by default.
For that reason I'm going to add it to my start up abilities just to make this easy to test.
So I'm going to go to class defaults and I'm going to give it a startup input tag.
And that's going to be two.
And now we should be able to start with it.
If we go into blueprints character or a BP or a character, and I can search here in the details panel
for abilities.
And we have our startup abilities.
Array.
So I'm going to add to startup abilities.
I'm going to choose GA fireblast.
And with that, now we should be able to start with Fireblast.
And we see it here, so we can see it in our menu as well.
And we can activate it and it has a cost and cooldown.
Great.
So what are we going to do here in Fireblast?
Well, I'd like to blast a bunch of fireballs.
In fact, my description tells me what to do.
Launches 12 fireballs in all directions, each coming back and exploding upon return.
Now they cause zero damage because we haven't set that yet.
So we still need to remember that our fireballs are not going to cause any damage.
But what we can do is work on spawning those fireballs.
And I'd like to make an actor class that can do what we need to do.
And this class is going to be inheriting some things from Aura Projectile, because it is going to be
a projectile.
It's just going to be behaving a little bit differently.
So I'm going to go into my actor folder where I have aura projectile.
I'm going to make a new C plus plus class based on this.
It can go in the aura folder, but I'm going to call this Aura Fireball.
This will be different than the projectile file.
It's going to be different than the Firebolt.
It's going to have some additional properties to it.
So I'm going to create the class, close down the editor saving all, and I'm going to close my folders
and open Aura Fireball.
And because it's based on Aura projectile I'm going to open Aura Projectile to see what we're inheriting.
Now Aura Projectile has a few things that we're going to take advantage of.
We have a projectile movement component.
We have damage effect params.
We have a homing target scene component.
And I'm not going to make these fireballs homing projectiles.
So we're not going to use that.
But we do have beginplay.
We have an on hit.
And if we look at on hit, we see that we're spawning a system and playing a sound.
And if our looping sound component is valid, we stop it and set be hit to true.
This is a pretty useful function to have and that is protected, so we can use that in Aura Fireball.
We've also overridden destroyed and in destroyed we stop that sound component and if not be hit and
not has authority.
We call on hit.
So there's that as well.
Now on sphere overlap is something we're going to want to have our own logic for, because on sphere
overlap for these fireballs is going to be different.
The behavior that I want for the fireball is I want it to pass through things.
I don't want it to explode on impact with anything.
I want it to explode when it comes back to aura.
So aura projectiles on sphere overlap function should be virtual so that I can decide how the fireball
behaves.
So I'm going to make it a virtual function, and I'm going to override it in the protected section of
Aura Fireball.
So let's first add a public section and then a protected.
And here in the protected section I'm going to override on sphere overlap.
We're going to add override to the end here.
And with this function we can go ahead and generate a definition line.
And we're not going to call super because we don't want the same functionality as aura projectile.
We don't want to blow up.
All we want to do is pass through things and potentially cause damage to them.
And we'll get to the damage part.
But for now, we're overriding on sphere overlap and doing nothing for now.
Now, aura projectile has a sphere component.
It's set up properly already.
It has a lifespan.
That's fine too.
It has be hits, which we can use if we decide to.
And it also has an impact effect, an impact sound, a looping sound, and a looping sound component.
And where does it spawn that looping sound?
Well, it does so in Beginplay.
If we go to or a projectile dot cp and look at Beginplay, we set the lifespan.
We set replicated movement to true.
We bind to on component began overlap for the sphere.
Our on sphere overlap, and we also start that looping sound component and all that stuff sounds great.
We're going to want our own functionality in addition to this, but we also want to call this functionality.
So I'm going to override Beginplay virtual void Beginplay override.
And I'm going to generate a definition and keep my call to super.
So we do want super and Beginplay.
We don't want super in on sphere overlap okay.
So we have quite a few things here.
What we can do now is we can create a blueprint based on this.
But I'd also like to go into my fire blast spell.
So or a fire blast.
Here's the CP I'm going to open the header file two and I'm going to add to Aura Fire Blast, a class
that we can use to spawn fireballs.
So I'm going to add a private section for it.
And I'm going to call this fireball class.
It's going to be a subclass of of type A or a fireball.
I'm going to forward declare it and call it fireball class.
And we'll set this from the blueprint so it gets a uproperty.
Edit defaults only.
And we'll also have a function to spawn our fireballs, and we'll perform any algorithms that we need
to determine the behavior of those fireballs.
And that's going to be a public function.
So I'm going to make a fireball spawning function.
And I'd like this to return a 2D array of fireballs, all the fireballs that we spawn.
So I'm going to return a 2D array of a or a fireball pointers and this will be called Spawn Fireballs.
We'll capitalize B for balls.
Now I'm going to make this a you function with blueprint callable.
So it's easy to use within our ability blueprint.
And I'm going to generate a definition for this.
And for now leave it blank.
And I'm going to collapse the functions of my Get descriptions.
And with that, now that we have a fireball class, we can create a fireball blueprint and set the fireball
class in Aura Fire Blast.
So I'm going to compile and launch.
Now, of course, I can't compile and launch, can I?
I'm going to have to return something from spawn fireballs.
So for now we'll just return a T array of A or a fireball pointers and it'll be an empty array that'll
satisfy it for now.
Back to the editor.
So back in the editor, I'm going to open up fire blast I don't need or a character open anymore, and
or a fire blast is going to need a fireball class.
So we're going to make a blueprint for that in blueprints.
And we'll go to Ability system or a abilities Fire fire blast.
And we'll put the fireball here.
I'm going to make a blueprint class based on Aura Fireball.
And call this BP underscore fireball.
So the fireball is different than the fire bolt, although it has some similarities.
Right now.
The first thing I'm going to do is select my sphere and click add and add a Niagara system.
And this is going to be the fireball effect.
And the fireball effect can be if we search for fire here we have a fireball.
And if we browse to fireball it's right here next to our other projectile fire Niagara systems.
And we can open it and see what it looks like.
And it's a little bit different than the others.
The others are kind of more of a slow burning ball of fire, but fireball looks like it's a lot faster
because I plan on sending this out at a greater speed and having it come back.
So this system is a little bit more appropriate for that.
We'll see when we start spawning these.
So I'm going to close those systems and we have our fireball effect.
We also have some things to set in the details panel.
We can scroll down to Aura Projectile and we need to set an impact effect.
Now, if we search for explosion, we have two versions of it.
There's explosion one, which looks like this.
And there's explosion, which is a little bit different.
In fact, I think we changed this one a lot by hiding the sparks and the explosion here.
So now we see what it really looks like.
There's even a shine part of it.
There we go.
So here's explosion and here's explosion one I think we're already using this.
We can use the other one for fireball.
So nice fire explosion I'm going to browse to it and set it here.
It's going to be fire explosion.
Impact sound can be the same sound we're using for our fire bolt.
So I'm going to just find that.
I'm just going to go to our Firebolt in our abilities, fire Firebolt and open up Firebolt.
I'm going to scroll down and find Firebolt Impact and then select it and go back to fireball and set
it there.
I'm going to do the same for the looping sound.
It's the Firebolt hiss.
I'm going to set that as well.
So with that we have those properties set.
We can save I'm going to close those Niagara systems.
I'm going to close Firebolt and we have a fireball.
Now we're going to need to spawn some of these.
And for aura projectile movement.
I'm actually not going to use projectile movement.
That's right.
I don't want projectile movement.
I'm going to set initial speed and max speed to zero, because I want to move this thing myself.
Now.
Yes, that means we could just go ahead and make a new actor, but I'd like to inherit the other things
from Aura Projectile.
And I'm just going to take this projectile movement component and uncheck start with tick enabled and
just make it kind of a dead component that we don't use.
I'm also going to take projectile movement component and uncheck Auto activate.
So now it doesn't do anything.
And if we bring one of these in.
By browsing to it and dragging in an aura fireball.
We can press play and we'll see that it just sits there.
Now it has a lifespan, so it will explode after 15 seconds.
But that's all it does.
So really nothing too crazy.
I'm going to control this fireball by other means and we'll see how soon.
So with that we have an Aura Fireball.
GA Fire Blast can have its fireball class now set to BP Aura Fireball.
And with that, we're now ready to start spawning these things and we'll handle that next.
Great job.
I'll see you soon.