WEBVTT

00:07.380 --> 00:08.400
Welcome back.

00:08.400 --> 00:15.630
So we're ready to tie all this together on the C plus plus side we've gotten all of our steps implemented.

00:15.630 --> 00:18.510
I'm going to go ahead and just leave these steps here.

00:18.510 --> 00:22.860
Just because this is kind of explaining the pipeline for radial damage.

00:22.860 --> 00:24.780
And I think it's nice and informative.

00:24.780 --> 00:30.270
So I'm going to leave it there and we're going to go ahead and launch the editor okay.

00:30.270 --> 00:31.440
So we're back in the editor.

00:31.440 --> 00:33.240
We're going to open up Arcane Shards.

00:33.240 --> 00:38.760
I'm done with my animation montage, I'm done with my gameplay queue.

00:38.760 --> 00:41.520
And here's my Arcane Shards ability.

00:41.520 --> 00:46.950
So what I want to do in arcane shards is I want to cause radial damage, which means we're going to

00:46.950 --> 00:50.670
need to make sure our class defaults are all set up.

00:50.790 --> 00:52.530
We have a damage effect class.

00:52.530 --> 00:53.370
That's good.

00:53.370 --> 00:56.010
We also need to set damage.

00:56.010 --> 00:59.460
So if we use a curve table, we can use CT damage.

00:59.460 --> 01:02.400
But that means we have to go into CT damage.

01:03.120 --> 01:06.180
And we need to add a curve for this spell.

01:06.180 --> 01:07.650
So let's add one.

01:07.650 --> 01:08.910
Rename the curve.

01:08.910 --> 01:13.290
We'll call it abilities Dot Arcane shards.

01:13.620 --> 01:17.640
We'll add two points two keys one two.

01:17.670 --> 01:20.100
The first one will be at level one.

01:20.100 --> 01:22.650
And I'll just make it ten damage.

01:22.650 --> 01:24.570
And then the second one.

01:25.790 --> 01:27.830
Will be at level 40.

01:28.520 --> 01:32.990
We'll just make 40 kind of the de facto max.

01:33.110 --> 01:37.220
And at 40, we'll give it, oh 100.

01:37.550 --> 01:38.960
Now that's too low.

01:38.960 --> 01:40.160
Let's do 200.

01:40.190 --> 01:43.790
Okay I'm going to go ahead and make these an auto curve.

01:43.910 --> 01:46.850
And I'm going to make the curve look like this.

01:47.980 --> 01:53.170
But I'm going to go to normalize view mode so I can see really what that curve looks like.

01:53.170 --> 01:54.850
And I'll have a falloff like this.

01:54.850 --> 01:56.620
Okay, great.

01:56.620 --> 02:04.420
Now we have a curve back in arcane shards we can select the curve arcane shards like so perfect.

02:04.420 --> 02:08.140
Now I'm going to set debuff Chance to zero.

02:08.170 --> 02:14.230
We don't have an arcane debuff associated with this damage type, so for the moment I'm just going to

02:14.230 --> 02:15.310
set it to zero.

02:15.340 --> 02:19.060
We don't need debuff damage or frequency or duration.

02:19.450 --> 02:19.870
Now.

02:19.870 --> 02:21.250
Death impulse magnitude.

02:21.250 --> 02:22.690
We've been using a thousand.

02:22.690 --> 02:27.310
It looks like for most of our spells I say most, but I mean Firebolt.

02:27.310 --> 02:29.020
That's been a bit too high.

02:29.050 --> 02:31.570
So I'm going to set this down to about 200.

02:31.570 --> 02:32.560
Knockback.

02:32.560 --> 02:34.090
I would like knockback.

02:34.090 --> 02:35.710
I'd like some knockback for this.

02:35.710 --> 02:40.720
I'm going to leave it at 1000 and knockback chance is going to be 100%.

02:40.720 --> 02:44.110
I'd like this spell to always knock back.

02:44.110 --> 02:45.760
It has knockback.

02:45.760 --> 02:47.740
Now is radial damage.

02:47.740 --> 02:49.000
Yes please.

02:49.000 --> 02:52.060
And radial damage inner and outer radius.

02:52.060 --> 02:55.390
Well that's something we're going to want to experiment with isn't it.

02:55.390 --> 02:59.290
And we can experiment with some debug spheres.

02:59.290 --> 03:05.260
What I'm going to do is instead of just drawing a debug sphere like we were doing before, I'm going

03:05.260 --> 03:06.520
to draw two of them.

03:07.190 --> 03:09.800
One for the inner and one for the outer radius.

03:09.800 --> 03:12.830
So I'm just going to make some room here.

03:18.590 --> 03:21.650
And we'll do the first one and it'll be white.

03:22.010 --> 03:24.680
We'll make it kind of a light pinkish, actually.

03:24.680 --> 03:30.110
And for the radius I'm going to use radial damage.

03:30.110 --> 03:35.210
You know what my radial damage inner radius is not blueprint read only.

03:35.570 --> 03:37.160
I'm just going to quickly change that.

03:38.310 --> 03:40.140
Closing down, saving all.

03:40.140 --> 03:48.060
I'm going to go into public ability system abilities or a damage gameplay ability, and I'm going to

03:48.060 --> 03:52.530
make these radial damage inner and outer radius blueprint read only.

04:06.230 --> 04:09.800
And I'll go ahead and start debugging again.

04:11.090 --> 04:15.020
Okay, so took a second to recompile, but worth it.

04:15.020 --> 04:21.320
I'm going to close down CT damage and zoom in on draw debug sphere, and I'm going to draw the inner

04:21.320 --> 04:22.310
and outer radii.

04:22.310 --> 04:28.250
So I'm going to say radial damage inner radius I'm going to get that.

04:28.870 --> 04:31.480
And that'll be my radius.

04:31.480 --> 04:35.350
And it's going to be at the shard spawn location.

04:35.350 --> 04:39.940
And I'm also going to draw a debug sphere at the outer radius.

04:41.120 --> 04:43.340
So I'm going to use radial damage.

04:43.340 --> 04:44.660
Outer radius.

04:46.070 --> 04:48.830
For this one and same location.

04:49.850 --> 04:52.640
And the outer is going to be slightly more red.

04:56.090 --> 04:59.990
And we'll hook this up and we'll just see how it looks.

05:06.050 --> 05:07.280
And you know what?

05:07.280 --> 05:11.510
I'm just going to set this to one player so it's faster to load.

05:14.330 --> 05:18.650
Okay, I didn't get any debug spheres and of course I didn't.

05:18.650 --> 05:22.790
My radial damage parameters are zero, so I'm going to set these.

05:23.950 --> 05:24.400
Okay.

05:24.400 --> 05:26.410
We're going to experiment a little bit here.

05:26.410 --> 05:29.050
So radial damage inner radius.

05:30.050 --> 05:34.280
I'm going to put it pretty small, like 25 and outer radius.

05:34.280 --> 05:37.340
I'm going to try to 50 and we'll see how that looks.

05:37.340 --> 05:42.740
Actually I'll try 300 and we'll do 50 for enter.

05:42.740 --> 05:44.270
Let's see how this looks.

05:49.790 --> 05:52.370
Okay, that's kind of cool.

05:52.430 --> 05:53.570
Um, it's a little big.

05:53.570 --> 05:57.200
I'm going to put it down just a tad.

05:57.200 --> 05:58.580
So 300 is too much.

05:58.580 --> 05:59.900
Let's try 200.

06:00.290 --> 06:02.780
I don't even think I saw the inner radius.

06:03.810 --> 06:06.390
I might need to make that a little bit more of a dramatic color.

06:06.390 --> 06:07.320
We'll make it blue.

06:08.050 --> 06:09.580
All right, so let's do that.

06:11.650 --> 06:12.640
Okay.

06:12.640 --> 06:14.410
That's looking pretty good.

06:21.110 --> 06:29.300
So if we're on the outer edges of those spheres, then we, being the victims of this spell, will get

06:29.300 --> 06:31.160
less damage and max damage.

06:31.160 --> 06:35.540
If inside that, I think the inner sphere could be just a little bigger.

06:36.140 --> 06:38.360
Maybe 85 is okay.

06:39.430 --> 06:43.540
And the outer can be probably a little lower.

06:43.540 --> 06:44.350
180.

06:52.220 --> 06:52.670
No.

06:52.670 --> 06:58.670
I think my inner can go back to 50 and my outer can come back to 200.

06:59.120 --> 07:00.590
I think I like that.

07:04.290 --> 07:12.390
Okay, so now that we have these spheres figured out, we know that we have some pretty decent radial

07:12.390 --> 07:16.410
damage settings so we can actually try to cause damage.

07:17.370 --> 07:22.920
So what I'd like to do is I'd like to create some damage effect params.

07:22.920 --> 07:27.300
So make damage effect params from class defaults.

07:27.780 --> 07:31.260
The target actor is going to be the avatar.

07:35.650 --> 07:42.520
And then we're going to call apply damage effect on our ability system blueprint library.

07:43.910 --> 07:45.200
So with that.

07:45.860 --> 07:50.330
We should now be causing damage and it should actually be radial.

07:50.840 --> 07:58.610
And so in order to test radial damage, I'm going to set the num points down to one.

08:00.670 --> 08:08.050
And that way I'll have more fine tuned control and I can see how much damage I cause to this poor goblin.

08:09.470 --> 08:11.570
And luckily I have this circle.

08:11.570 --> 08:13.820
And if I just do it over to the side.

08:14.180 --> 08:16.310
Oh, I got some damage myself.

08:16.310 --> 08:20.720
It looks like even though I have zero damage, I still got some knockback.

08:23.270 --> 08:23.720
Okay?

08:23.720 --> 08:25.370
So it's not affecting the enemy.

08:25.370 --> 08:26.660
It's affecting me.

08:28.450 --> 08:32.320
That means I'm using source or target incorrectly somewhere.

08:39.130 --> 08:39.700
Oh, right.

08:39.700 --> 08:40.390
Of course.

08:40.390 --> 08:42.550
Target actor is not me.

08:42.580 --> 08:47.230
Target actor is who we want to apply the damage to, right?

08:47.950 --> 08:48.910
Of course.

08:49.580 --> 08:56.480
So that means we need to do this to everything within the radius.

08:58.890 --> 09:00.750
We have a way to do that, don't we?

09:01.290 --> 09:05.460
We have get live players within radius.

09:05.460 --> 09:06.540
Perfect.

09:06.960 --> 09:10.830
Now get live players within radius needs a world context object.

09:10.830 --> 09:13.080
For that we can use get avatar.

09:14.330 --> 09:17.330
So we'll pass in the avatar actor from actor info.

09:17.360 --> 09:23.390
We can even use an array of actors to ignore, which I'd like to just pass in my avatar.

09:23.390 --> 09:24.290
Straight in.

09:24.290 --> 09:26.390
I want to ignore my avatar.

09:27.010 --> 09:34.210
Now the radius is going to be my radial damage outer radius, because no point in going bigger than

09:34.210 --> 09:34.930
that.

09:34.960 --> 09:37.690
Nothing would even get damaged.

09:38.050 --> 09:42.790
And then my shard spawn location can go into Sphere origin.

09:42.790 --> 09:46.930
We're going to need to do some cleanup here, but just getting this working.

09:47.590 --> 09:53.050
We're going to apply the damage effect and then increment the count, right.

09:53.140 --> 09:57.010
So we need to apply the damage effect to everything in this array.

09:57.190 --> 10:04.300
I'm going to go ahead and promote this to a variable called overlapping players.

10:05.840 --> 10:08.150
And I'm going to go ahead and loop over it.

10:10.430 --> 10:12.620
So we'll do a for each loop.

10:17.370 --> 10:21.270
And for the loop body, we're going to apply the damage effect.

10:21.270 --> 10:23.760
We'll make params for each of these.

10:23.760 --> 10:26.850
So the array element is going to be the target actor.

10:27.540 --> 10:29.190
And we'll apply the damage effect.

10:29.190 --> 10:34.890
And only when the loop has completed will we resume and increment our count.

10:34.890 --> 10:36.900
So this is for each shard.

10:36.900 --> 10:39.930
It's going to damage everything that's overlapping with it.

10:39.930 --> 10:43.440
Oh boy I don't like these overlapping nodes.

10:43.440 --> 10:45.330
Okay, we'll fix it though.

10:46.380 --> 10:52.500
Now, at this point, we've almost tied everything all together and we're almost ready to test.

10:52.530 --> 11:00.270
There's just one little detail that we need to take care of, and that's setting the damage origin.

11:00.270 --> 11:02.160
We're never actually setting that.

11:02.160 --> 11:07.830
We need to set that in our damage effect params and make damage effect params.

11:07.830 --> 11:08.970
Can't really do that.

11:08.970 --> 11:12.300
It doesn't know yet what the damage origin should be.

11:14.100 --> 11:16.950
Now we could take this.

11:16.950 --> 11:18.240
Break it.

11:19.320 --> 11:22.740
Expand it, and then we can make a new one.

11:22.740 --> 11:27.480
From one of these we can say make damage effect params.

11:27.750 --> 11:33.660
Expand it and then we could set the damage origin right here the radial damage origin.

11:33.660 --> 11:38.730
And then for all these others we can drag them across and connect them.

11:38.730 --> 11:40.500
But that sounds like a nightmare.

11:40.500 --> 11:42.120
I don't really want to do that.

11:42.120 --> 11:46.440
I'm not interested and just dragging that many nodes together.

11:46.470 --> 11:52.140
Although what I'm about to do to avoid it is probably going to take the same amount of time after compiling

11:52.140 --> 11:56.400
in C plus plus, but instead of having to do this.

11:57.020 --> 12:02.900
Just like we have a target actor input and to make damage effect params from class defaults, we can

12:02.900 --> 12:08.120
simply pass in a radial damage origin here and just take care of it that way.

12:08.150 --> 12:11.450
That's the way that I'd rather go about this.

12:11.450 --> 12:16.190
So I'm just going to go back into the C plus plus side.

12:16.190 --> 12:23.330
We're going to go into aura damage gameplay ability and our function make damage effect.

12:23.330 --> 12:35.300
Params from class defaults can take in a const f vector reference called in radial damage origin, and

12:35.300 --> 12:42.410
we'll set it equal to f vector zero vector by default, so we don't have to pass it in.

12:42.800 --> 12:46.220
Now we do need to add this to the function definition.

12:48.610 --> 12:49.630
Right here.

12:49.840 --> 12:56.950
And we can take our params and we can set it so we have radial damage origin here.

12:57.370 --> 13:01.600
And we're not going to set it to our member variable.

13:01.930 --> 13:06.040
In fact this doesn't really need to be a member variable does it.

13:06.040 --> 13:09.760
So we're going to take that in radial damage origin.

13:09.760 --> 13:12.190
We're going to set radial damage origin here.

13:12.190 --> 13:19.480
And we never actually need a radial damage origin member variable in this class actually.

13:19.480 --> 13:24.820
So we can actually remove radial damage origin from the gameplay ability itself.

13:27.060 --> 13:28.500
Never used.

13:30.210 --> 13:34.620
We need to provide that radial damage origin when we make the params.

13:34.620 --> 13:37.980
So with this change let's go ahead and compile.

13:38.430 --> 13:39.750
And with that.

13:40.360 --> 13:45.430
We'll get back into our ability and this is now broken.

13:45.430 --> 13:49.570
So we're going to have to right click on it, refresh nodes.

13:49.570 --> 13:53.350
And if we're using this in other abilities it's going to be broken there too.

13:53.350 --> 13:55.480
So we'll just be prepared for that.

13:55.480 --> 14:01.270
But for in radial damage origin that's going to be our shard spawn location.

14:01.270 --> 14:04.660
So we can pass that in straight into it.

14:04.660 --> 14:08.950
And now we have our radial damage effect params.

14:08.950 --> 14:12.610
So let's test this out and then we'll come back and clean up these nodes.

14:14.310 --> 14:15.360
We'll go ahead and press play.

14:15.360 --> 14:19.410
And of course, we do have errors now because we changed those functions.

14:19.410 --> 14:21.630
Let's first start with electrocute.

14:24.980 --> 14:29.780
And let's find that error going into apply damage.

14:29.780 --> 14:32.090
Nope, it's not in that function.

14:32.270 --> 14:34.190
It might be in prepare to end ability.

14:34.190 --> 14:35.000
Here it is.

14:35.480 --> 14:38.990
So we're calling make damage effect params from class defaults.

14:38.990 --> 14:43.190
We can right click and we can refresh the nodes.

14:43.190 --> 14:44.690
And that's going to fix it.

14:44.990 --> 14:47.840
And we'll do it on both cases here.

14:49.860 --> 14:51.570
Okay by ref params.

14:51.570 --> 14:56.820
Expect a valid input to operate on and since we don't have one to pass in.

14:58.390 --> 15:00.670
I'm going to go ahead and pass it in by value.

15:00.670 --> 15:05.440
So this will just be enough vector not even a const reference.

15:05.770 --> 15:07.090
We'll have an f vector.

15:07.090 --> 15:08.770
Radial damage origin.

15:11.540 --> 15:12.560
Like that.

15:13.550 --> 15:15.050
So let's try this again.

15:15.050 --> 15:18.020
And that should get rid of all the errors anyway.

15:19.050 --> 15:19.620
Okay.

15:19.620 --> 15:21.960
So let's go ahead and press play.

15:21.960 --> 15:23.940
And yes, that takes care of it.

15:24.690 --> 15:28.140
And just going to make sure we're all ready.

15:28.140 --> 15:29.010
We're all set.

15:29.010 --> 15:31.680
We got the spawn location there.

15:31.680 --> 15:33.270
Let's go ahead and press play.

15:34.030 --> 15:35.380
And.

15:36.310 --> 15:37.450
There's our circle.

15:37.450 --> 15:42.130
So I'm going to try getting that enemy right at the edge of the circle.

15:42.900 --> 15:44.790
So moving it in closer.

15:49.330 --> 15:50.920
We're about to hit it.

15:52.240 --> 15:52.960
There we go.

15:52.960 --> 15:53.410
It blocked.

15:53.410 --> 15:53.560
What?

15:53.560 --> 15:55.060
It got one damage.

15:55.480 --> 15:57.220
That was two damage.

15:58.130 --> 15:59.660
That was a critical hit.

16:00.170 --> 16:02.480
Okay, so block is one damage.

16:07.620 --> 16:08.430
One damage.

16:08.430 --> 16:09.870
I'm going to go right in the middle.

16:10.630 --> 16:12.340
That was six damage.

16:14.370 --> 16:14.760
Six.

16:14.760 --> 16:15.900
Damage in the middle.

16:18.120 --> 16:21.360
We get blocks, but two damage right there.

16:21.540 --> 16:28.050
I think what I'm going to do is set the duration for these debug spheres to be a little bit less.

16:28.050 --> 16:29.400
Let's do two seconds.

16:39.030 --> 16:39.390
Okay.

16:39.390 --> 16:41.820
So right in the middle we get six damage.

16:42.500 --> 16:44.180
And at the edge.

16:44.360 --> 16:47.840
If it's not a critical hit, it's about three.

16:48.660 --> 16:49.890
Two.

16:51.770 --> 16:53.060
That was two.

16:54.350 --> 16:55.790
And we got a critical hit.

16:59.750 --> 17:06.260
So it'd be nice to be able to turn off certain damage mechanics just for testing purposes.

17:06.260 --> 17:08.960
I might think about doing that, but.

17:10.080 --> 17:11.490
At the very edge I'm seeing.

17:11.490 --> 17:13.680
I'm getting one damage and in the middle.

17:15.420 --> 17:16.560
That was a critical.

17:16.560 --> 17:17.340
But.

17:18.060 --> 17:18.840
In the middle.

17:18.840 --> 17:20.430
We should get more.

17:20.430 --> 17:21.630
We get six in the middle.

17:21.630 --> 17:22.590
Okay.

17:24.870 --> 17:26.820
Now I'm just going to double check my data.

17:26.850 --> 17:29.280
I'm going to go to CT damage.

17:30.290 --> 17:32.000
Arcane shards.

17:32.360 --> 17:36.710
Okay, so at 0.3 is my first key.

17:36.710 --> 17:39.350
That should be level one and it should be at ten.

17:39.350 --> 17:44.720
So I want a base damage of ten at level one for my arcane shards.

17:45.330 --> 17:47.550
Not sure how that happened, but.

17:48.270 --> 17:50.550
Okay, so that was for damage.

17:52.920 --> 17:54.660
Getting one at the edge.

17:55.630 --> 17:59.410
And I got about nine there in the middle, so that's looking good.

17:59.410 --> 18:04.480
We're definitely getting a fall off, so I'm really happy with that.

18:04.900 --> 18:06.520
Now we can clean up our nodes.

18:06.520 --> 18:11.620
But before we do, I want to bring your attention to one more thing in C plus plus.

18:11.620 --> 18:14.320
And that's in our exit calc damage.

18:14.800 --> 18:21.520
You see, in our Exit calc damage, we're looping over all the damage types, which means every time

18:21.520 --> 18:23.230
we check is radial damage.

18:23.230 --> 18:30.700
If it is radial damage, then for each damage type, we're binding our lambda to the delegate and we're

18:30.700 --> 18:37.330
calling apply radial damage with falloff even though that damage type value is zero.

18:37.330 --> 18:43.000
So really, there's no point in doing all this if that damage type value is zero.

18:43.000 --> 18:49.660
In other words, after we set our damage type value based on our set by color magnitude, we should

18:49.660 --> 18:51.220
check to see if it's zero.

18:51.220 --> 18:58.690
If damage type value is zero, we can even do less than or equal to zero.

18:59.920 --> 19:03.370
There's no point in doing the rest of this iteration of the for loop.

19:03.370 --> 19:04.840
We can continue.

19:05.440 --> 19:12.190
So continue is going to skip all the rest of the stuff inside this for loop and do the next iteration.

19:12.640 --> 19:16.240
So that's one thing I'd like to do is just continue.

19:16.240 --> 19:18.880
If we have zero damage there.

19:19.680 --> 19:24.930
So with that, we've got a little bit of an optimization done there.

19:26.530 --> 19:31.300
Okay, so we're back in the editor, and before we clean up our nodes, after I made that C plus plus

19:31.300 --> 19:35.500
change, I want to make sure that I'm still getting radial damage with the falloff.

19:36.220 --> 19:37.960
Okay, so I got two damage there.

19:37.960 --> 19:39.550
Let's do it in the middle here.

19:40.200 --> 19:46.890
And I got nine damage there and neither were a block or a crit, so I know I have radial damage with

19:46.890 --> 19:47.760
a falloff.

19:48.430 --> 19:49.420
Perfect.

19:49.840 --> 19:52.510
Okay, so the shards are looking good.

19:52.510 --> 19:57.940
I don't need my debug spheres here anymore, so I'm going to go ahead and just remove my draw debug

19:57.940 --> 19:58.810
spheres.

20:01.510 --> 20:02.530
Don't need them.

20:02.530 --> 20:05.830
And I think this could use some serious cleanup.

20:07.970 --> 20:13.160
We really don't want too much stuff getting out of control here.

20:13.160 --> 20:20.480
So after we set the timer, we're hiding the magic circle and spawning our first shard.

20:21.990 --> 20:23.670
This can get a comment.

20:24.420 --> 20:28.920
Start timer and spawn first shard.

20:34.060 --> 20:37.210
I'm going to have a little bit of a more greenish green.

20:38.930 --> 20:40.760
And move that up into here.

20:49.050 --> 20:56.490
Now, after we do that, we implement spawn shard, which is called in our timer over and over again.

20:56.940 --> 21:00.780
So we're storing our shard spawn location.

21:00.780 --> 21:02.340
This can be a function.

21:03.440 --> 21:08.030
We can call this store shard spawn location.

21:12.550 --> 21:14.530
Now we're getting our avatar actor.

21:14.530 --> 21:20.980
We're making an array from it, and that's passed in to get live players within radius as the array

21:20.980 --> 21:28.750
of actors to ignore our sphere origin is our shard spawn location, which doesn't need to be an output,

21:28.750 --> 21:29.140
actually.

21:29.140 --> 21:31.420
So I'm going to control Z a couple times.

21:35.330 --> 21:37.850
And I don't really need this to be an output.

21:37.850 --> 21:40.070
It's just shard spawn location.

21:40.070 --> 21:41.990
We can just pass that in.

21:42.890 --> 21:44.900
Shard spawn location there.

21:46.370 --> 21:48.350
And then I can collapse this.

21:49.620 --> 21:53.610
To store shard spawn location.

21:58.790 --> 22:05.150
So we get it from our ground points based on our count getting its world location there.

22:07.650 --> 22:08.550
Okay.

22:08.550 --> 22:13.500
After that we call get live players within radius here.

22:13.770 --> 22:22.950
And what we can actually do is we can make this a function as well to store our overlapping players.

22:23.710 --> 22:30.010
So we're seeing how many players are overlapping with our damage outer radius.

22:30.010 --> 22:36.370
So really this is collecting all of the damaged players or players to damage.

22:37.040 --> 22:41.360
So overlapping players could be called players to damage.

22:43.340 --> 22:48.380
I like that name better because it's a little bit more descriptive, and then rather than plugging it

22:48.380 --> 22:54.950
straight from the set into the for loop, we can take players to damage the array variable and plug

22:54.950 --> 22:55.550
that in.

22:55.550 --> 22:57.140
And then this can be a function.

22:57.140 --> 23:02.960
We can collapse it and we can say store players to damage.

23:07.350 --> 23:10.110
After that, we're performing our loop.

23:12.370 --> 23:17.350
And we're just applying a damage effect on this array element.

23:17.350 --> 23:25.990
So we could make this a function, cause damage to player or cause damage to actor at shard spawn location.

23:25.990 --> 23:28.000
So let's just collapse this.

23:29.310 --> 23:33.840
And call this radial damage to player.

23:34.940 --> 23:35.990
That's better.

23:36.700 --> 23:38.650
We'll move this up here.

23:40.060 --> 23:42.730
And then last we increment the count.

23:45.440 --> 23:47.690
And then we execute a gameplay cue.

23:47.690 --> 23:52.100
So let's go ahead and move this down to here.

23:53.610 --> 23:55.230
Increment that count.

23:56.260 --> 23:59.080
And then here we're making gameplay parameters.

23:59.080 --> 24:00.970
We can collapse this down.

24:01.840 --> 24:03.160
Like so.

24:05.030 --> 24:06.860
And here we can bring it in.

24:09.460 --> 24:11.050
Make this look a little bit.

24:11.800 --> 24:13.180
Less messy.

24:22.170 --> 24:28.560
And after all this, in the false case here, we clear the timer.

24:28.560 --> 24:30.000
We set a delay.

24:30.000 --> 24:34.950
Really we're going to need to do a commit, implement ability, cost and cooldown.

24:34.950 --> 24:35.400
Right.

24:35.400 --> 24:38.970
But we destroy the point collection and end the ability.

24:38.970 --> 24:42.720
So right there this is something we could comment but.

24:43.460 --> 24:46.190
I'm going to leave it as is because we're going to change it.

24:46.220 --> 24:51.650
We need to figure out how we're going to do cost and cooldown for this ability.

24:52.390 --> 24:54.850
But now this ability is looking a lot better.

24:56.020 --> 24:57.640
So we start the ability.

24:57.640 --> 24:59.650
We show the magic circle.

25:00.010 --> 25:01.660
We wait for an input press.

25:01.660 --> 25:05.170
Once we get it, we get the target data under the mouse.

25:05.170 --> 25:07.330
We store the mouse hit location.

25:07.980 --> 25:09.240
After that.

25:09.590 --> 25:15.500
We spawn our point collection at the mouse hit location, store that in a variable we call get ground

25:15.500 --> 25:16.310
points.

25:16.310 --> 25:22.250
Passing in the point collection, the mouse hit location and the number of points and a random float

25:22.250 --> 25:25.520
for the rotation, and we store our ground points.

25:26.910 --> 25:31.710
We update the facing target for the montage, we play the montage and wait.

25:31.830 --> 25:33.900
We wait for a gameplay event.

25:34.960 --> 25:40.300
Once that event Arcane Shards is received, then we start our timer on looping.

25:40.300 --> 25:47.320
We store that timer, we hide the magic circle, and we spawn our first shard while we wait for this

25:47.320 --> 25:55.240
timer to go off and spawn the next one only if the count is less than num points, we store the shard

25:55.240 --> 25:56.140
spawn location.

25:56.140 --> 25:57.970
We store the players to damage.

25:57.970 --> 26:01.840
We loop over players to damage and cause radial damage to them.

26:01.840 --> 26:10.270
We increment the count and then we execute a gameplay queue with params on the owner using our shard

26:10.270 --> 26:11.650
spawn location.

26:12.810 --> 26:17.730
Once the count is greater than or equal to num points, we've spawned enough shards.

26:17.730 --> 26:18.990
We clear the timer.

26:18.990 --> 26:23.310
After 0.2 seconds, we destroy our point collection and we end the ability.

26:25.240 --> 26:27.370
So we have our arcane shards.

26:27.370 --> 26:29.530
All we need to do is implement a couple things.

26:29.530 --> 26:31.540
Cost and cooldown for one.

26:31.900 --> 26:35.530
We can't just be casting this willy nilly without paying for it.

26:36.240 --> 26:37.680
But it's looking good.

26:44.430 --> 26:45.990
Now note to self.

26:46.530 --> 26:49.920
I may want to increase the gravity force.

26:50.620 --> 26:55.270
As my characters are kind of flying through the air a little bit too slow.

26:55.270 --> 26:57.040
It's a little too realistic.

26:59.890 --> 27:01.870
But otherwise our abilities.

27:01.870 --> 27:03.160
Looking nice.

27:03.160 --> 27:04.480
Really nice.

27:06.150 --> 27:07.230
Excellent.

27:07.410 --> 27:10.230
Awesome job and I'll see you in the next video.
