WEBVTT

00:06.880 --> 00:08.050
Welcome back.

00:08.080 --> 00:15.490
Now, our goal here is to be able to apply an infinite effect and remove that effect on end overlap

00:15.490 --> 00:16.560
if we need to.

00:16.570 --> 00:23.300
If our removal policy is set to remove on end overlap for our infinite effect.

00:23.320 --> 00:26.770
So the question is how do we do that?

00:26.800 --> 00:30.320
Well, let's go back to where we're applying effects.

00:30.340 --> 00:34.210
We have apply effect to target and apply a gameplay effect.

00:34.210 --> 00:37.360
Spec to self has a return type.

00:37.510 --> 00:41.950
It's not void, it's active gameplay effect handle.

00:42.130 --> 00:49.960
So once you've applied a gameplay effect, that gameplay effect becomes active and these apply functions

00:49.960 --> 00:52.060
return a handle to that effect.

00:52.060 --> 00:59.500
So we can always use that handle for something later, such as removing it if it's an infinite gameplay

00:59.500 --> 01:00.220
effect.

01:00.250 --> 01:03.100
So we need to store this handle now.

01:03.100 --> 01:06.100
We need to be careful about the way we do this.

01:06.130 --> 01:12.620
You see, if we're just thinking about one player character in the world running around picking up these

01:12.620 --> 01:20.510
effect actors, well then we could store the active gameplay effect that we've applied and then on and

01:20.510 --> 01:21.350
overlap.

01:21.350 --> 01:25.430
Just take that other actor and remove that active effect.

01:25.430 --> 01:29.120
But realistically, games are not that simple.

01:29.150 --> 01:33.050
We might have multiple actors overlapping.

01:33.080 --> 01:37.310
Some of them may have ability system components, some may not.

01:37.310 --> 01:46.250
And we can't just assume that target actor and overlap is the correct actor for any given effect handle.

01:46.250 --> 01:53.240
And if multiple actors are overlapping and we're setting a single effect handle variable, well then

01:53.240 --> 01:59.170
we're overwriting it and losing the effect handle that that variable stored before.

01:59.180 --> 02:01.860
In other words, this requires a bit more care.

02:01.880 --> 02:10.640
Now one approach is that as we apply a gameplay effect, if that gameplay effect is an infinite duration

02:10.640 --> 02:17.450
gameplay effect, we can store the handle, but we can also store the actor that we're applying this

02:17.450 --> 02:18.530
effect to.

02:18.560 --> 02:21.290
Essentially linking the two together.

02:21.320 --> 02:23.320
A map should come to mind.

02:23.330 --> 02:27.210
Map data structures are great for linking two values together.

02:27.230 --> 02:34.430
Now we can make two functions one for instant and duration effect application and one for infinite.

02:34.430 --> 02:41.210
But in the name of education, I'd like to show you a way to figure out whether or not this gameplay

02:41.210 --> 02:43.760
effect is infinite duration or not.

02:43.760 --> 02:49.580
In other words, check at runtime the duration policy for a given effect.

02:49.700 --> 02:56.720
I'd like to show you how to do that Now in order to check the duration policy, we have to take a look

02:56.720 --> 02:58.750
at our effect spec handle.

02:58.760 --> 03:03.260
So I'm going to take my effect spec handle.

03:03.920 --> 03:11.960
And from this handle we know that the handle has a data member so we can access that.

03:11.960 --> 03:16.490
We know that much and data is a shared pointer.

03:16.490 --> 03:26.630
To get that raw pointer we can call get on that and that returns us a pointer to gameplay effect spec.

03:26.840 --> 03:29.570
Now this is the effect spec.

03:29.600 --> 03:36.140
What we want from the effect spec is the gameplay effect itself.

03:36.140 --> 03:44.150
Now this pointer can be dereferenced and the gameplay effect itself is called def.

03:44.240 --> 03:49.100
So inside the spec handle we have data that's the gameplay effect spec.

03:49.100 --> 03:54.410
Inside the spec we have def, which is the gameplay effect.

03:54.440 --> 03:58.520
Notice it's a t object pointer of type u gameplay effect.

03:58.970 --> 04:08.330
Now this being a t object pointer means we have to call get yet again and that gives us the raw pointer

04:08.330 --> 04:14.300
which we can access to get all of these things on the gameplay effect itself.

04:14.300 --> 04:18.050
And one of those things is duration policy.

04:18.200 --> 04:26.390
Now keep in mind we're accessing the class default object properties here and we don't want to use this

04:26.390 --> 04:31.820
method to say change the duration policy at runtime, for example.

04:31.820 --> 04:33.620
No, that's not what we want to do.

04:33.620 --> 04:37.490
This is just to look and see what the policy is.

04:37.520 --> 04:44.210
And we're assuming that this policy isn't changing at runtime, but we can check it and we can see if

04:44.210 --> 04:47.180
it's equal to an E gameplay.

04:48.250 --> 04:54.550
Effect, duration type as that's what the duration policy is.

04:54.550 --> 05:00.460
It's an EA gameplay effect, duration type, and we can check to see if it's infinite or not.

05:00.460 --> 05:05.920
Now, if it is infinite, well then we know that this expression will return true.

05:05.920 --> 05:15.250
So we can create a const bool called B is infinite and set it equal to the result of this.

05:15.640 --> 05:23.830
Now, if we wanted to be able to remove duration based effects on end overlap, we could then give our

05:23.830 --> 05:29.500
duration based effect its own removal policy, just like we have for Infinite.

05:29.500 --> 05:35.770
And that just depends on what you like your effect actor to be able to do this effect actor that I'm

05:35.770 --> 05:43.150
making will only be able to remove infinite effects and they'll only be removed on end overlap.

05:43.420 --> 05:51.080
Now if it is an infinite effect, I want to store for this infinite effect somehow.

05:51.080 --> 05:52.460
And how do I store it?

05:52.460 --> 05:57.800
Well, apply gameplay effect spec to self returns an active gameplay effect handle.

05:57.800 --> 06:01.820
That's what I want to store and link up with the target actor.

06:02.240 --> 06:06.500
So the return type from apply gameplay effect spec to self.

06:06.500 --> 06:10.550
An active gameplay effect handle.

06:10.970 --> 06:20.300
I'm going to store in a local variable called active effect handle and if B is infinite is true, then

06:20.300 --> 06:20.900
I'll store it.

06:20.900 --> 06:30.080
So I'm going to say if B is infinite, then store the effect handle and I'm going to store it in a map

06:30.080 --> 06:40.640
and the map can map active gameplay effect handles and the value can be the target actor or even more

06:40.640 --> 06:43.700
handy can be an ability system component.

06:43.730 --> 06:50.150
That way, we don't have to dig into the actor to get the AC, we have the AC already, so I'd like

06:50.150 --> 06:56.390
to make a map mapping active gameplay effect handles to ability system component pointers.

06:56.390 --> 06:58.010
So let's make that map.

06:58.010 --> 07:05.930
So I'm going to say t map and the types will be f active gameplay effect handle.

07:07.070 --> 07:11.390
That's the key and the value will be you ability.

07:12.680 --> 07:20.210
System component will add the forward declaration and that will be a pointer for that type.

07:20.450 --> 07:26.630
And we'll call this active effect handles.

07:27.530 --> 07:32.450
And we know it's mapping handles to ability system components.

07:33.110 --> 07:39.050
Now we're not forward declaring this because it's not a pointer or a reference, so I'm just going to

07:39.050 --> 07:41.870
hit control shift B and compile.

07:42.540 --> 07:45.870
Just to see that undeclared identifier.

07:45.990 --> 07:48.780
And that tells me I have to include the header.

07:49.050 --> 07:52.500
I'm going to go ahead and include at the top here.

07:53.800 --> 07:58.390
Gameplay effect types dot Age.

07:59.160 --> 08:02.380
And that's going to take care of that compilation error there.

08:02.400 --> 08:11.310
So I have a map and back in the CPP file, if our gameplay effect is infinite, I want to add to my

08:11.310 --> 08:18.930
map Active effect handles the active gameplay effect handle, active effect handle and the target ability

08:18.930 --> 08:20.260
system component.

08:20.280 --> 08:25.860
So I'll take active effect handles and I can add this key value pair.

08:25.860 --> 08:35.130
It's going to be active effect handle and target ASC and I get the red squiggles so I have to come back

08:35.130 --> 08:37.560
here and check for typos.

08:37.560 --> 08:41.130
It looks like I have you ora ability system component.

08:41.130 --> 08:42.090
That's not what I want.

08:42.090 --> 08:44.670
I just want you ability system component here.

08:44.880 --> 08:48.570
Which means I forward declared the ora version.

08:48.570 --> 08:49.590
I don't want that.

08:49.590 --> 08:56.400
So I'm going to make sure I'm only forward declaring the base ability system component and that's going

08:56.400 --> 08:58.230
to get rid of my red squiggles there.

08:58.230 --> 09:00.340
So an easy mistake to make.

09:00.340 --> 09:07.450
And writer says the active effect handle can be const, we can make it const if we like be is infinite

09:07.450 --> 09:11.140
can be moved inside this if check if we want as well.

09:11.140 --> 09:15.340
I'm going to leave it out and keep it like this as a matter of style.

09:15.550 --> 09:19.600
So active effect handles now has a key value pair.

09:19.600 --> 09:22.690
When we apply an effect to a target.

09:22.720 --> 09:28.570
Now we should only be doing this if we plan on removing the effect right.

09:28.840 --> 09:35.860
If we don't plan on removing the infinite effect, then there's no need to store a handle to the effect.

09:35.860 --> 09:39.520
So we should be checking our removal policy.

09:39.520 --> 09:43.960
If it's do not remove, we should not even bother storing it.

09:43.960 --> 09:46.450
But if it's remove on an overlap, we should.

09:46.920 --> 09:55.980
So if our effect is infinite, we'll also have an end here and we'll check our Infinite Effect removal

09:55.980 --> 10:00.910
policy and see if it's equal to effect removal policy.

10:00.930 --> 10:02.780
Remove on end overlap.

10:02.790 --> 10:10.320
If that's the case, well then we'll store it and then on end overlap we'll remove it, but we'll check

10:10.320 --> 10:12.550
that policy as well.

10:12.570 --> 10:19.800
So an on overlap, we have to apply the infinite effect and on end overlap, that's where we handle

10:19.800 --> 10:20.760
removing it.

10:21.000 --> 10:23.820
So first we'll check to see if we should apply it.

10:23.850 --> 10:35.460
We'll say if infinite gameplay effect application policy double equals E effect application policy apply

10:35.460 --> 10:36.390
on overlap.

10:38.460 --> 10:42.350
And if that's the case, we'll apply effect to target.

10:42.360 --> 10:48.840
So calling apply effect to target passing in target actor and we'll pass in our infinite.

10:49.520 --> 10:59.390
Gameplay effect class and in on end overlap, we can check that policy again, but we can change this.

10:59.420 --> 11:04.490
We can see if it's apply on end overlap and we can apply the gameplay effect.

11:04.520 --> 11:09.710
But we also need to check if we should remove the gameplay effect.

11:09.710 --> 11:12.380
So we'll check its removal policy.

11:12.590 --> 11:14.240
So we'll say if.

11:15.050 --> 11:20.870
Infinite effect Removal policy equals e.

11:21.320 --> 11:23.540
Effect removal policy.

11:23.570 --> 11:25.820
Remove on end overlap.

11:26.540 --> 11:29.480
Now we've got some stuff to do, right?

11:30.120 --> 11:31.760
So what do we want to do?

11:31.770 --> 11:39.600
Well, first, we want to get the target actors ability system component because up here we're storing

11:39.600 --> 11:46.440
the active effect handle and the target ability system component that we're applying this effect to.

11:46.470 --> 11:52.050
We want to check that ability system component against our key value pairs in our map.

11:52.050 --> 11:56.580
So first we have to get our target actors ability system component.

11:56.580 --> 11:59.850
So I'm going to make a local you ability system component.

12:00.960 --> 12:11.260
Called target ASC and use the you ability system blueprint library get ability.

12:11.280 --> 12:16.950
System component passing in target actor and we'll check if that's valid.

12:16.950 --> 12:19.500
We'll say if is valid.

12:21.170 --> 12:22.280
Target ASC.

12:22.310 --> 12:25.670
That way we'll only do this if it's not pending.

12:25.670 --> 12:29.390
Kill and I'll say if not is valid return.

12:29.390 --> 12:30.440
We'll do it that way.

12:30.440 --> 12:35.840
Then we'll loop through our map and check if for each key value pair.

12:35.840 --> 12:43.670
If there is an ASC linking an active effect to the ability system component that we're dealing with

12:43.670 --> 12:44.290
here.

12:44.300 --> 12:53.840
So we'll say for I'm going to use auto, we'll call this handle pair in active effect handles.

12:54.740 --> 13:02.570
And if you don't like using auto here, the type is right here t tuple mapping f active gameplay effect

13:02.600 --> 13:05.420
handle to you ability system component.

13:05.420 --> 13:11.540
So you could just copy that if you're in writer or just hover over it in Visual Studio and see what

13:11.540 --> 13:15.500
it is and then replace auto with that same thing.

13:15.650 --> 13:23.100
Now what I'm going to do is take this pair, handle pair and see if the value which is an ability system

13:23.100 --> 13:25.920
component is equal to my target.

13:25.950 --> 13:29.400
ASC So we're going to check to see if they're equal.

13:29.400 --> 13:36.990
We're going to say if Target ASC is equal to handle pair dot value.

13:37.020 --> 13:45.270
If they're equal, then we can remove the gameplay effect and we remove it using the ability system

13:45.270 --> 13:46.500
component of the target.

13:46.500 --> 13:54.210
So we're going to say target ASC and to remove an active gameplay effect, we use the function, remove

13:54.210 --> 14:02.370
active gameplay effect and this function requires an active gameplay effect handle.

14:02.370 --> 14:03.180
How about that?

14:03.180 --> 14:03.870
We have one.

14:03.870 --> 14:05.340
It's in our handle pair.

14:05.430 --> 14:07.530
That's what this map is storing.

14:07.530 --> 14:09.600
It's our handle pair key.

14:09.630 --> 14:16.080
So we're going to say handle pair dot key here and this removes the gameplay effect.

14:16.110 --> 14:23.340
Now if we remove the gameplay effect, we should also remove this pair from the map.

14:23.460 --> 14:25.500
But there's a problem.

14:25.500 --> 14:27.690
We're looping through the map.

14:27.690 --> 14:35.460
We can't remove an element from the container we're currently looping through that's just begging for

14:35.460 --> 14:36.450
a crash.

14:36.660 --> 14:45.090
Instead, what we can do is as we remove gameplay effects, we can accumulate some sort of container

14:45.120 --> 14:50.910
of key value pairs that we'd like to remove after we're done with this for loop.

14:50.910 --> 14:58.170
In other words, we can make an array, I'm going to make a T array and it's going to be an array of

14:58.170 --> 15:00.000
the active effect handles.

15:00.000 --> 15:10.620
So it's going to be a T array of F active gameplay effect handle, and this will be called handles to

15:10.620 --> 15:11.370
remove.

15:11.910 --> 15:17.970
And if we remove a gameplay effect using the handle, we're going to add that handle to handles to remove.

15:17.970 --> 15:24.930
So we'll say handles to remove dot add and we'll add handle pair dot key.

15:25.950 --> 15:30.570
And once we're done looping through this map, we'll loop through our array.

15:30.630 --> 15:33.180
So we'll make another for loop.

15:33.330 --> 15:41.820
This one can be auto reference, we'll call it handle and we'll loop through handles to remove.

15:42.300 --> 15:43.680
And what are we going to do?

15:43.710 --> 15:51.780
We're going to remove that particular element from our map by key because the key is an active effect

15:51.780 --> 15:52.080
handle.

15:52.080 --> 15:58.440
So we're going to take active effect handles and I want to do this safely.

15:58.440 --> 16:02.610
So I'm going to do find and remove checked and we'll pass in handle.

16:02.970 --> 16:08.580
And by the way, this auto here is just an active gameplay effect handle.

16:08.580 --> 16:15.180
So if you don't want the auto there, you can explicitly state active gameplay effect handle there.

16:15.330 --> 16:24.810
And so this results in removing the active gameplay effect from that ability system component that we

16:24.810 --> 16:32.610
linked up with it when we added the key value pair of effect handles to assess here when we apply the

16:32.610 --> 16:33.360
effect.

16:33.510 --> 16:37.650
So on overlap will apply the infinite gameplay effect.

16:37.650 --> 16:43.530
If the effect application policy is apply on overlap and on end overlap.

16:43.530 --> 16:51.330
If our removal policy is remove on end overlap, then we'll check our map, see if it contains a key

16:51.330 --> 16:57.060
value pair that has an ASC that matches the ASC of the end overlap actor.

16:57.060 --> 17:04.260
If it does, we'll remove the active gameplay effect and mark that handle to be removed from our map,

17:04.260 --> 17:06.630
which we do immediately after.

17:07.200 --> 17:10.950
So back here in the editor, we need to make a couple changes, right?

17:10.950 --> 17:16.200
We have to go to our BP fire area and change some of these properties.

17:16.200 --> 17:20.480
For one, we don't have an instant gameplay effect class.

17:20.870 --> 17:25.460
So instant effect application policy can be left at do not apply.

17:25.490 --> 17:27.230
Same goes for duration.

17:27.260 --> 17:28.340
Do not apply.

17:28.370 --> 17:35.690
But we have an infinite effect and the infinite effect application policy needs to be set if we want

17:35.690 --> 17:37.070
to apply the effect.

17:37.100 --> 17:44.420
I'm going to apply on overlap and for infinite effect removal policy, I'm going to remove on end overlap

17:44.420 --> 17:46.430
and we're going to remove a single stack.

17:46.460 --> 17:51.890
Now, if we wanted to remove a single stack or all the stacks, we could create a variable and expose

17:51.890 --> 17:54.890
it for that as well if we really wanted to.

17:55.730 --> 17:56.360
All right.

17:56.360 --> 18:02.630
And now the only thing we need to do is make sure to call our blueprint callable functions on overlap

18:02.630 --> 18:03.980
and on end overlap.

18:04.130 --> 18:08.720
That means we're not going to use our apply effect to Target anymore.

18:08.840 --> 18:11.870
We're going to call on overlap.

18:13.160 --> 18:19.520
Which takes the actor, We're going to pass in other actor and we're going to take our box and get on

18:19.520 --> 18:22.460
component and overlap.

18:23.090 --> 18:26.600
And for this we're going to call our end overlap function.

18:30.990 --> 18:32.130
On and overlap.

18:32.130 --> 18:36.750
And we're going to pass in other actor here into Target actor.

18:37.260 --> 18:38.310
All right.

18:38.310 --> 18:46.800
So what we should see is our infinite effect applied when we overlap and removed on end overlap.

18:46.890 --> 18:48.630
So that's looking good.

18:48.660 --> 18:50.100
So why don't we give this a try?

18:50.100 --> 18:51.390
I'm going to press play.

18:51.870 --> 18:55.470
I'm going to overlap and there goes my health.

18:55.470 --> 18:56.250
It's going down.

18:56.250 --> 19:02.280
And as I end overlap, it's no longer going down, which is exactly what I wanted to see.

19:02.280 --> 19:07.590
I'm going to do this with show debug on I have 30 health, I'm in the fire.

19:07.590 --> 19:15.990
It's going down 2015 ten and as I leave it stays at ten and this is looking great.

19:16.020 --> 19:19.140
We can even check the stacking for this.

19:19.140 --> 19:22.230
Let's just double check our stacking policy.

19:22.260 --> 19:29.250
Looks like our stacking type is none, but we can choose to aggregate by source or target.

19:29.250 --> 19:33.580
I'm going to choose target and set a stack limit count.

19:33.610 --> 19:43.420
Let's do say three and stack expiration policy can be removed single stack and refresh duration so that

19:43.420 --> 19:46.420
way we can have up to three stacks at a time.

19:46.420 --> 19:52.450
And as we end overlap, we'll be removing those stacks.

19:52.660 --> 19:58.990
So why don't we duplicate this a few times, We'll duplicate it twice.

19:59.350 --> 20:05.350
So there's a point here where we might be overlapping with all three and I'll show debug and if we're

20:05.350 --> 20:09.790
overlapping with one we should see our health going down by five at a time.

20:09.790 --> 20:15.400
If we're overlapping with two, we should see it going down by ten at a time and with three we should

20:15.400 --> 20:17.620
see it going down by 15 at a time.

20:17.950 --> 20:19.660
So let's see if we can do that.

20:21.430 --> 20:21.820
Okay.

20:21.820 --> 20:23.590
We're going down by five.

20:24.600 --> 20:27.090
And 35.

20:27.090 --> 20:27.780
50.

20:27.780 --> 20:28.500
65.

20:28.530 --> 20:32.340
Okay, we're going down by looks like 15 at a time.

20:33.720 --> 20:37.350
And as I move away.

20:38.190 --> 20:40.350
Those stacks get removed.

20:40.380 --> 20:46.170
So it's a little hard to see with such small volumes, but we get the gist.

20:46.200 --> 20:53.790
I'm going to go ahead and increase the size of these volumes to make it a little easier to test out.

20:53.790 --> 20:59.460
I'm going to take the box here and make its volume a bit bigger for this volume here.

21:00.360 --> 21:03.120
And I'll just duplicate this.

21:07.520 --> 21:10.490
Affect actors, so I'm going to go ahead and delete the others.

21:16.730 --> 21:18.630
So we'll have this one.

21:18.650 --> 21:21.140
I'll go ahead and duplicate it.

21:22.800 --> 21:24.030
Like so.

21:24.030 --> 21:27.120
And I'll duplicate it again like this.

21:28.110 --> 21:35.400
So that way we have an area here where we'll have one stack, an area here where we'll have two and

21:35.400 --> 21:38.340
an area in the middle where we can have three stacks.

21:38.640 --> 21:40.590
So I'll turn off hidden and game.

21:45.460 --> 21:47.710
Okay, so I'll press play.

21:48.820 --> 21:52.150
I'll show debug and if I go into this area here.

21:52.960 --> 21:56.110
35, 30, 25, 20.

21:56.110 --> 21:57.910
So we're losing five at a time.

21:58.090 --> 22:06.250
Now, I expect to lose ten at a time in this area and I have -40, -50, -60 and so on.

22:06.250 --> 22:14.320
And as I go into this area, I should see -115, -131 6175.

22:14.320 --> 22:16.660
So it's as expected.

22:17.020 --> 22:18.610
Now here's the thing, though.

22:18.610 --> 22:27.610
If I have three stacks and I leave one of these volumes, all of a sudden we no longer get any changes

22:27.610 --> 22:28.380
to health.

22:28.390 --> 22:31.090
We've removed all stacks, right?

22:31.090 --> 22:34.750
And that's because removing the gameplay effect removes them all.

22:34.780 --> 22:37.810
But what if we only want to remove a single stack?

22:37.990 --> 22:44.440
Well, let's close the editor and go back to our IDE where we're calling remove active gameplay effect.

22:44.440 --> 22:53.240
If I hover over it, I see that the first input is the active effect handle, but the second is an 32

22:53.270 --> 22:54.950
called stacks to remove.

22:54.980 --> 23:01.340
Now it has a default value of negative one, and if we don't pass anything in that negative one means

23:01.340 --> 23:02.840
remove all stacks.

23:02.840 --> 23:05.840
But if we want, we could remove a single stack.

23:05.900 --> 23:11.990
So for example, I could place a comma here and we could simply remove one stack.

23:12.110 --> 23:17.660
Now we may have multiple effect actors and each has their own map, right?

23:17.660 --> 23:23.750
So each one should really just remove a single stack if we want that behavior.

23:23.750 --> 23:26.420
And now we're set up to do that.

23:26.420 --> 23:29.810
So let's hit debug and try this out.

23:30.490 --> 23:31.030
All right.

23:31.030 --> 23:39.640
I'm going to open my blueprint assets And to make testing really easy, I'm going to make my fire area

23:39.640 --> 23:42.790
modifier magnitude negative one.

23:43.300 --> 23:47.980
That way I'll know if I have one stack, two stacks or three stacks.

23:47.980 --> 23:49.750
Let's give this a try.

23:50.140 --> 23:51.940
So I'll press play.

23:52.660 --> 23:53.980
I'm going to show debug.

23:53.980 --> 23:57.280
I have 50 health going into this area.

23:57.280 --> 24:03.340
It's going down by one per second now, overlapping two of them.

24:03.340 --> 24:06.940
It's going down by two per second.

24:07.120 --> 24:11.650
Going into this one, we have our health going down by three per second.

24:11.680 --> 24:14.500
Now, if I go into the two area.

24:16.050 --> 24:22.020
And we're now going down by two per second and going into the one.

24:24.280 --> 24:26.770
We are going down by one per second.

24:26.770 --> 24:31.630
So we're only removing a single stack at a time and exiting that area.

24:31.630 --> 24:33.220
We're no longer losing health.

24:33.220 --> 24:36.610
And of course we've long since gone past zero health.

24:36.610 --> 24:40.900
We're going into the negatives which we shouldn't be able to do.

24:40.930 --> 24:46.720
We're going to learn how we can implement clamping for these effects soon enough.

24:46.720 --> 24:55.450
But for now we know that we can have multiple stacks of a single gameplay effect, and this allows us

24:55.450 --> 25:00.190
to make any number of gameplay mechanics that apply effects.

25:00.280 --> 25:01.960
So this is pretty great.

25:01.990 --> 25:13.720
Now I'm going to go ahead and just delete these fire areas because what I'd rather have is an area in

25:13.720 --> 25:18.010
which I don't start losing life unless I can see fire there, right?

25:18.040 --> 25:21.520
We just made that box visible for debug purposes.

25:21.520 --> 25:27.860
I'm going to turn off hidden in game or rather turn it back on and we can have multiple fire areas.

25:27.860 --> 25:35.600
So say I have one here and one here and one here.

25:35.600 --> 25:42.410
And that way we know that this is dangerous to be in and if we get out of it, we stop getting hurt,

25:42.440 --> 25:43.400
right?

25:43.400 --> 25:46.970
And we just happen to be able to stack these as well.

25:46.970 --> 25:55.280
And you could make a super fire area if you wanted to by making the overlap volume bigger.

25:55.310 --> 26:01.520
Let's just demonstrate that we'll take the box, we'll take the box extent and make it a little wider,

26:01.670 --> 26:08.630
maybe like this and we can have multiple fire effects so we can add a Niagara.

26:09.760 --> 26:10.990
Particle system component.

26:10.990 --> 26:12.550
We can call this one.

26:13.990 --> 26:16.930
Fire underscore two.

26:17.080 --> 26:18.850
We can move it around.

26:19.590 --> 26:21.030
Set it to fire.

26:21.060 --> 26:22.650
We'll just have to for now.

26:22.650 --> 26:23.820
I think that's enough.

26:23.820 --> 26:26.130
And I'll make this volume.

26:27.420 --> 26:28.890
Encompass the area.

26:28.890 --> 26:31.950
So let's squeeze it in like that.

26:32.160 --> 26:34.920
I'll make this fire effect right here.

26:35.280 --> 26:36.630
And this one here.

26:39.190 --> 26:40.960
Like so.

26:41.890 --> 26:42.520
There.

26:43.520 --> 26:46.910
And now we know if we step in the fire, we'll get hurt.

26:48.580 --> 26:49.540
Excellent.

26:50.840 --> 26:54.220
So our aura effect actor is quite versatile.

26:54.230 --> 26:59.690
We can use it the way we used our overlap and end overlap functions and fire area.

26:59.690 --> 27:06.500
Or we can use it like we did our health potions and just call apply effect to target directly.

27:06.500 --> 27:14.210
We have control here in blueprint and it gives more flexibility to the designer side of things.

27:14.600 --> 27:16.580
Okay, excellent job.

27:16.820 --> 27:19.670
So now I'm going to give you a side quest.

27:19.700 --> 27:24.920
Now these are optional, and I won't be giving you the solution for the side.

27:24.920 --> 27:32.720
Quest I'd like you to create arrays of each duration type and figure out how to handle that and then

27:32.720 --> 27:38.390
post your solution in the gas top down RPG channel in the Druid mechanics discord.

27:38.390 --> 27:45.230
So instead of applying a single effect, you're going to apply an array of effects and make sure you

27:45.230 --> 27:49.130
figure out how to handle removing all of those effects.

27:49.130 --> 27:55.440
And if you can manage to get that working, post that in the Discord and discuss it with other students

27:55.440 --> 27:56.400
in the course.

27:56.430 --> 28:00.150
Now these side quests again are optional.

28:00.150 --> 28:01.950
They're a little more challenging.

28:01.950 --> 28:06.330
And as I mentioned, I won't be working through the solution for them.

28:06.330 --> 28:10.920
This is more a practice exercise for you if you're up to the challenge.

28:10.920 --> 28:13.020
And if not, that's totally fine.

28:13.020 --> 28:14.700
Just continue with the course.

28:14.700 --> 28:21.780
We won't be using anything in the side quests in the course, so it's not something you have to have,

28:21.780 --> 28:29.730
but it's something that can get your brain working and get you to start thinking about how you can approach

28:29.730 --> 28:31.620
solving problems on your own.

28:31.620 --> 28:34.140
So if you're up to the challenge, tackle the side.

28:34.140 --> 28:37.410
Quest and I'll see you in the next video.
