WEBVTT

00:07.290 --> 00:08.310
Welcome back.

00:08.310 --> 00:11.730
So now we have our fire blast ability.

00:11.730 --> 00:14.310
Now we don't start with it by default.

00:14.310 --> 00:19.860
For that reason I'm going to add it to my start up abilities just to make this easy to test.

00:19.860 --> 00:26.130
So I'm going to go to class defaults and I'm going to give it a startup input tag.

00:26.130 --> 00:27.750
And that's going to be two.

00:27.870 --> 00:31.140
And now we should be able to start with it.

00:31.140 --> 00:39.120
If we go into blueprints character or a BP or a character, and I can search here in the details panel

00:39.120 --> 00:40.620
for abilities.

00:41.560 --> 00:43.960
And we have our startup abilities.

00:43.960 --> 00:44.890
Array.

00:44.890 --> 00:47.710
So I'm going to add to startup abilities.

00:48.550 --> 00:51.370
I'm going to choose GA fireblast.

00:51.910 --> 00:55.780
And with that, now we should be able to start with Fireblast.

00:55.780 --> 00:59.530
And we see it here, so we can see it in our menu as well.

00:59.530 --> 01:03.130
And we can activate it and it has a cost and cooldown.

01:03.130 --> 01:03.790
Great.

01:04.340 --> 01:07.370
So what are we going to do here in Fireblast?

01:07.400 --> 01:10.700
Well, I'd like to blast a bunch of fireballs.

01:10.700 --> 01:13.100
In fact, my description tells me what to do.

01:13.100 --> 01:19.730
Launches 12 fireballs in all directions, each coming back and exploding upon return.

01:20.090 --> 01:23.750
Now they cause zero damage because we haven't set that yet.

01:23.750 --> 01:29.030
So we still need to remember that our fireballs are not going to cause any damage.

01:29.030 --> 01:33.410
But what we can do is work on spawning those fireballs.

01:33.410 --> 01:38.990
And I'd like to make an actor class that can do what we need to do.

01:38.990 --> 01:45.080
And this class is going to be inheriting some things from Aura Projectile, because it is going to be

01:45.080 --> 01:46.100
a projectile.

01:46.100 --> 01:49.280
It's just going to be behaving a little bit differently.

01:49.460 --> 01:54.050
So I'm going to go into my actor folder where I have aura projectile.

01:54.050 --> 01:57.290
I'm going to make a new C plus plus class based on this.

01:57.290 --> 02:02.300
It can go in the aura folder, but I'm going to call this Aura Fireball.

02:02.300 --> 02:04.820
This will be different than the projectile file.

02:04.820 --> 02:07.550
It's going to be different than the Firebolt.

02:07.550 --> 02:10.610
It's going to have some additional properties to it.

02:11.120 --> 02:18.200
So I'm going to create the class, close down the editor saving all, and I'm going to close my folders

02:18.650 --> 02:20.690
and open Aura Fireball.

02:21.320 --> 02:28.040
And because it's based on Aura projectile I'm going to open Aura Projectile to see what we're inheriting.

02:28.280 --> 02:33.380
Now Aura Projectile has a few things that we're going to take advantage of.

02:33.380 --> 02:35.960
We have a projectile movement component.

02:35.990 --> 02:38.450
We have damage effect params.

02:38.450 --> 02:41.270
We have a homing target scene component.

02:41.270 --> 02:44.600
And I'm not going to make these fireballs homing projectiles.

02:44.600 --> 02:46.340
So we're not going to use that.

02:46.790 --> 02:48.320
But we do have beginplay.

02:48.320 --> 02:49.910
We have an on hit.

02:49.910 --> 02:54.890
And if we look at on hit, we see that we're spawning a system and playing a sound.

02:54.890 --> 02:59.570
And if our looping sound component is valid, we stop it and set be hit to true.

02:59.570 --> 03:05.900
This is a pretty useful function to have and that is protected, so we can use that in Aura Fireball.

03:06.140 --> 03:14.630
We've also overridden destroyed and in destroyed we stop that sound component and if not be hit and

03:14.630 --> 03:15.710
not has authority.

03:15.710 --> 03:16.970
We call on hit.

03:16.970 --> 03:18.560
So there's that as well.

03:18.590 --> 03:26.810
Now on sphere overlap is something we're going to want to have our own logic for, because on sphere

03:26.810 --> 03:29.930
overlap for these fireballs is going to be different.

03:30.110 --> 03:33.860
The behavior that I want for the fireball is I want it to pass through things.

03:33.860 --> 03:36.680
I don't want it to explode on impact with anything.

03:36.680 --> 03:39.830
I want it to explode when it comes back to aura.

03:39.830 --> 03:48.290
So aura projectiles on sphere overlap function should be virtual so that I can decide how the fireball

03:48.290 --> 03:49.100
behaves.

03:49.100 --> 03:55.160
So I'm going to make it a virtual function, and I'm going to override it in the protected section of

03:55.160 --> 03:56.240
Aura Fireball.

03:56.240 --> 04:00.560
So let's first add a public section and then a protected.

04:00.560 --> 04:05.240
And here in the protected section I'm going to override on sphere overlap.

04:05.240 --> 04:08.090
We're going to add override to the end here.

04:08.090 --> 04:12.110
And with this function we can go ahead and generate a definition line.

04:12.110 --> 04:18.320
And we're not going to call super because we don't want the same functionality as aura projectile.

04:18.320 --> 04:20.600
We don't want to blow up.

04:20.600 --> 04:25.550
All we want to do is pass through things and potentially cause damage to them.

04:25.550 --> 04:27.020
And we'll get to the damage part.

04:27.020 --> 04:32.780
But for now, we're overriding on sphere overlap and doing nothing for now.

04:33.140 --> 04:36.230
Now, aura projectile has a sphere component.

04:36.230 --> 04:38.750
It's set up properly already.

04:38.750 --> 04:40.130
It has a lifespan.

04:40.130 --> 04:41.600
That's fine too.

04:41.600 --> 04:45.830
It has be hits, which we can use if we decide to.

04:45.830 --> 04:52.400
And it also has an impact effect, an impact sound, a looping sound, and a looping sound component.

04:52.400 --> 04:55.730
And where does it spawn that looping sound?

04:55.730 --> 04:57.710
Well, it does so in Beginplay.

04:57.710 --> 05:04.400
If we go to or a projectile dot cp and look at Beginplay, we set the lifespan.

05:04.400 --> 05:06.800
We set replicated movement to true.

05:07.070 --> 05:11.150
We bind to on component began overlap for the sphere.

05:11.180 --> 05:18.350
Our on sphere overlap, and we also start that looping sound component and all that stuff sounds great.

05:18.350 --> 05:24.920
We're going to want our own functionality in addition to this, but we also want to call this functionality.

05:24.920 --> 05:30.650
So I'm going to override Beginplay virtual void Beginplay override.

05:30.650 --> 05:35.510
And I'm going to generate a definition and keep my call to super.

05:35.510 --> 05:37.700
So we do want super and Beginplay.

05:37.700 --> 05:41.630
We don't want super in on sphere overlap okay.

05:41.630 --> 05:44.360
So we have quite a few things here.

05:44.360 --> 05:48.740
What we can do now is we can create a blueprint based on this.

05:48.740 --> 05:52.250
But I'd also like to go into my fire blast spell.

05:52.250 --> 05:54.440
So or a fire blast.

05:54.440 --> 06:02.390
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

06:02.390 --> 06:04.850
that we can use to spawn fireballs.

06:04.850 --> 06:07.790
So I'm going to add a private section for it.

06:08.300 --> 06:10.940
And I'm going to call this fireball class.

06:10.940 --> 06:16.220
It's going to be a subclass of of type A or a fireball.

06:16.880 --> 06:22.100
I'm going to forward declare it and call it fireball class.

06:22.640 --> 06:26.510
And we'll set this from the blueprint so it gets a uproperty.

06:28.020 --> 06:29.700
Edit defaults only.

06:30.290 --> 06:37.160
And we'll also have a function to spawn our fireballs, and we'll perform any algorithms that we need

06:37.160 --> 06:39.920
to determine the behavior of those fireballs.

06:39.920 --> 06:42.050
And that's going to be a public function.

06:42.050 --> 06:45.770
So I'm going to make a fireball spawning function.

06:45.770 --> 06:50.810
And I'd like this to return a 2D array of fireballs, all the fireballs that we spawn.

06:50.810 --> 06:59.870
So I'm going to return a 2D array of a or a fireball pointers and this will be called Spawn Fireballs.

07:00.530 --> 07:02.690
We'll capitalize B for balls.

07:03.380 --> 07:06.920
Now I'm going to make this a you function with blueprint callable.

07:06.920 --> 07:10.220
So it's easy to use within our ability blueprint.

07:10.220 --> 07:12.860
And I'm going to generate a definition for this.

07:12.860 --> 07:14.780
And for now leave it blank.

07:14.780 --> 07:18.800
And I'm going to collapse the functions of my Get descriptions.

07:19.390 --> 07:26.140
And with that, now that we have a fireball class, we can create a fireball blueprint and set the fireball

07:26.140 --> 07:28.360
class in Aura Fire Blast.

07:28.360 --> 07:30.250
So I'm going to compile and launch.

07:31.480 --> 07:34.000
Now, of course, I can't compile and launch, can I?

07:34.000 --> 07:37.030
I'm going to have to return something from spawn fireballs.

07:37.030 --> 07:45.520
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

07:45.520 --> 07:46.900
satisfy it for now.

07:46.900 --> 07:48.430
Back to the editor.

07:50.360 --> 07:57.440
So back in the editor, I'm going to open up fire blast I don't need or a character open anymore, and

07:57.440 --> 08:01.040
or a fire blast is going to need a fireball class.

08:01.040 --> 08:04.550
So we're going to make a blueprint for that in blueprints.

08:04.550 --> 08:09.410
And we'll go to Ability system or a abilities Fire fire blast.

08:09.410 --> 08:11.330
And we'll put the fireball here.

08:11.480 --> 08:15.320
I'm going to make a blueprint class based on Aura Fireball.

08:16.980 --> 08:20.220
And call this BP underscore fireball.

08:20.220 --> 08:25.650
So the fireball is different than the fire bolt, although it has some similarities.

08:25.650 --> 08:26.940
Right now.

08:26.940 --> 08:32.160
The first thing I'm going to do is select my sphere and click add and add a Niagara system.

08:32.160 --> 08:35.850
And this is going to be the fireball effect.

08:35.850 --> 08:41.760
And the fireball effect can be if we search for fire here we have a fireball.

08:41.760 --> 08:48.960
And if we browse to fireball it's right here next to our other projectile fire Niagara systems.

08:48.960 --> 08:51.150
And we can open it and see what it looks like.

08:51.150 --> 08:53.640
And it's a little bit different than the others.

08:53.640 --> 09:01.080
The others are kind of more of a slow burning ball of fire, but fireball looks like it's a lot faster

09:01.080 --> 09:06.180
because I plan on sending this out at a greater speed and having it come back.

09:06.180 --> 09:10.260
So this system is a little bit more appropriate for that.

09:10.260 --> 09:12.960
We'll see when we start spawning these.

09:13.290 --> 09:18.000
So I'm going to close those systems and we have our fireball effect.

09:18.090 --> 09:21.780
We also have some things to set in the details panel.

09:22.320 --> 09:27.630
We can scroll down to Aura Projectile and we need to set an impact effect.

09:28.450 --> 09:32.050
Now, if we search for explosion, we have two versions of it.

09:32.080 --> 09:35.170
There's explosion one, which looks like this.

09:37.480 --> 09:41.260
And there's explosion, which is a little bit different.

09:43.470 --> 09:50.760
In fact, I think we changed this one a lot by hiding the sparks and the explosion here.

09:52.540 --> 09:54.580
So now we see what it really looks like.

09:54.580 --> 09:56.590
There's even a shine part of it.

09:57.850 --> 09:58.630
There we go.

09:58.630 --> 10:03.100
So here's explosion and here's explosion one I think we're already using this.

10:03.130 --> 10:06.130
We can use the other one for fireball.

10:06.130 --> 10:10.210
So nice fire explosion I'm going to browse to it and set it here.

10:10.780 --> 10:12.730
It's going to be fire explosion.

10:12.730 --> 10:18.040
Impact sound can be the same sound we're using for our fire bolt.

10:18.040 --> 10:20.110
So I'm going to just find that.

10:22.060 --> 10:28.120
I'm just going to go to our Firebolt in our abilities, fire Firebolt and open up Firebolt.

10:28.120 --> 10:35.290
I'm going to scroll down and find Firebolt Impact and then select it and go back to fireball and set

10:35.290 --> 10:35.980
it there.

10:36.280 --> 10:38.290
I'm going to do the same for the looping sound.

10:38.290 --> 10:40.000
It's the Firebolt hiss.

10:40.030 --> 10:41.650
I'm going to set that as well.

10:42.260 --> 10:45.050
So with that we have those properties set.

10:45.080 --> 10:48.350
We can save I'm going to close those Niagara systems.

10:48.350 --> 10:52.010
I'm going to close Firebolt and we have a fireball.

10:52.010 --> 10:55.790
Now we're going to need to spawn some of these.

10:56.390 --> 10:58.820
And for aura projectile movement.

10:58.820 --> 11:02.720
I'm actually not going to use projectile movement.

11:03.080 --> 11:03.830
That's right.

11:03.830 --> 11:06.470
I don't want projectile movement.

11:06.470 --> 11:13.040
I'm going to set initial speed and max speed to zero, because I want to move this thing myself.

11:13.280 --> 11:13.760
Now.

11:13.760 --> 11:19.010
Yes, that means we could just go ahead and make a new actor, but I'd like to inherit the other things

11:19.010 --> 11:21.230
from Aura Projectile.

11:21.230 --> 11:26.720
And I'm just going to take this projectile movement component and uncheck start with tick enabled and

11:26.720 --> 11:30.020
just make it kind of a dead component that we don't use.

11:30.320 --> 11:34.370
I'm also going to take projectile movement component and uncheck Auto activate.

11:34.370 --> 11:36.470
So now it doesn't do anything.

11:36.470 --> 11:38.450
And if we bring one of these in.

11:39.700 --> 11:43.840
By browsing to it and dragging in an aura fireball.

11:44.400 --> 11:47.670
We can press play and we'll see that it just sits there.

11:47.670 --> 11:51.810
Now it has a lifespan, so it will explode after 15 seconds.

11:51.810 --> 11:53.520
But that's all it does.

11:54.030 --> 11:57.090
So really nothing too crazy.

11:57.090 --> 12:03.420
I'm going to control this fireball by other means and we'll see how soon.

12:03.420 --> 12:06.000
So with that we have an Aura Fireball.

12:06.000 --> 12:12.780
GA Fire Blast can have its fireball class now set to BP Aura Fireball.

12:13.230 --> 12:18.630
And with that, we're now ready to start spawning these things and we'll handle that next.

12:18.720 --> 12:19.800
Great job.

12:19.830 --> 12:21.060
I'll see you soon.
