WEBVTT

00:07.450 --> 00:08.800
Welcome back.

00:08.800 --> 00:16.570
Now, if I take my one and only goblin here and bring it in and move it around and shock it, let's

00:16.570 --> 00:17.860
see what happens.

00:17.860 --> 00:22.690
I've got my number of players set to one and I'm going to stun this thing.

00:22.690 --> 00:27.460
But before I stun, actually, we actually didn't get a chance to stun there.

00:27.460 --> 00:31.630
Notice that things look a little funny and they also sound kind of funny.

00:31.630 --> 00:33.070
You probably noticed.

00:34.050 --> 00:40.080
We're applying a damage effect ten times per second, which means we're playing that hit react ten times

00:40.080 --> 00:40.920
per second.

00:40.920 --> 00:42.660
And that looks kind of funny.

00:42.990 --> 00:46.140
Now, what I like to do is just not hit react.

00:46.140 --> 00:49.110
In this case, as we're electrocuting.

00:49.110 --> 00:53.280
I don't think we really need necessarily to play that hit react.

00:53.310 --> 00:59.170
Instead, what I'd like to do is play a sort of shock loop animation.

00:59.190 --> 01:08.220
If we go to assets and enemies and goblin animations spear, we can see that there's a shock loop which

01:08.220 --> 01:14.430
looks like the goblins getting shocked, and that's going to look a lot better, I think, than simply

01:14.460 --> 01:19.380
playing this hit react ten times a second as well as playing the sound.

01:19.410 --> 01:23.050
It's a little obnoxious, so I'd like to fix that.

01:23.070 --> 01:28.920
And another thing I notice is if I shock the enemy as soon as that hit react is finished, it goes into

01:28.920 --> 01:31.860
the stunned animation a little bit abruptly.

01:31.980 --> 01:34.080
See, it kind of jerks right there.

01:34.260 --> 01:35.740
Watch this again.

01:35.760 --> 01:37.230
I'll full screen it.

01:40.460 --> 01:41.540
Right there.

01:41.540 --> 01:42.560
It kind of jumped.

01:42.590 --> 01:46.350
Now that has to do with blending out for the hit react.

01:46.370 --> 01:52.880
If we go to the hit react and set the blend out time to a higher value, say 0.3, then that's going

01:52.880 --> 01:54.890
to fix that and make it more smooth.

01:55.860 --> 01:57.600
So again hit react.

01:57.600 --> 02:00.350
And there's a smooth transition.

02:00.360 --> 02:03.030
So we can do that for the spear goblin.

02:03.030 --> 02:04.380
We can do it for the slingshot.

02:04.410 --> 02:05.880
Hit react as well.

02:06.060 --> 02:08.760
We'll set that blend out time to 0.3.

02:08.880 --> 02:13.530
And we can even do it for the other enemy types as well, such as the ghoul.

02:13.890 --> 02:18.120
We can go to the ghoul hit react to its blend out time.

02:18.120 --> 02:23.490
It looks like it's 0.25, and we can handle the other enemies as we need to.

02:23.490 --> 02:30.780
But what I'd like to do now is to give the goblin some kind of variable, to know that it's being shocked,

02:30.780 --> 02:35.850
and if it is being shocked, then we should suppress that hit react.

02:35.880 --> 02:40.080
Now, we can do this in a number of ways, but I'd like to do it very simply.

02:40.080 --> 02:46.650
I'd like to just have a variable on the enemy, or even the base character to know if we're shocked.

02:46.770 --> 02:54.660
And if we are, well, then we can go ahead and check that we can add a interface function to be able

02:54.660 --> 03:01.740
to check that, and we can even have an interface function to set it really easily.

03:01.740 --> 03:04.980
So as soon as we're say adding that.

03:05.670 --> 03:08.100
Gameplay cue for the electric beam.

03:08.100 --> 03:13.980
We could also set that victim to be in the shock loop.

03:14.010 --> 03:16.950
So that's what I'd like to do in this video.

03:17.040 --> 03:19.040
So here's what I'm going to do.

03:19.050 --> 03:22.110
I'm going to go into a character base.

03:22.200 --> 03:29.670
I'm going to close all tabs and go to the public folder into character or a character base, and just

03:29.670 --> 03:31.890
under is stunned and is burned.

03:31.920 --> 03:35.990
We're going to add another bool called be in shock loop.

03:36.000 --> 03:40.110
Now this will be false and this could be replicated as well.

03:42.850 --> 03:46.180
Now for in loop we won't be using a rep notify.

03:46.210 --> 03:49.000
For now, we'll just make it a replicated variable.

03:49.180 --> 03:53.260
No need to do anything in response to the replication.

03:53.440 --> 03:58.930
And if it's going to be replicated, we need to add it to get lifetime replicated props.

03:59.020 --> 04:00.640
So we'll add that here.

04:02.650 --> 04:05.260
And it's be in shock loop.

04:05.530 --> 04:09.040
So now that we have this, we should use.

04:09.680 --> 04:14.630
Our combat interface to add a getter and setter for it and implement that.

04:15.280 --> 04:19.150
So in the interaction folder here's combat interface.

04:19.330 --> 04:21.790
Let's add two new functions.

04:21.790 --> 04:25.600
And these can be blueprint native event blueprint callable.

04:25.750 --> 04:32.110
So first I'll have a getter bool is in shock loop.

04:33.160 --> 04:34.600
It'll be const.

04:36.900 --> 04:46.830
Blueprint native event blueprint callable and we'll have a void set in shock loop which will take a

04:46.830 --> 04:48.960
bool called be in shock.

04:49.050 --> 04:55.080
That one we can call in shock and Blueprint native event blueprint callable.

04:55.080 --> 04:57.510
And we'll go ahead and implement these.

04:57.960 --> 04:59.490
And you know what.

04:59.490 --> 05:02.640
We already have a set in shock loop don't we.

05:02.910 --> 05:04.760
We have it right here don't we.

05:04.770 --> 05:10.140
And we made that for the shock loop for aura right.

05:10.320 --> 05:15.450
So we have a source of confusion potentially because aura is in the shock loop.

05:15.450 --> 05:22.110
When casting the spell, the enemies can be in the shock loop when receiving the shock.

05:22.260 --> 05:27.960
So to avoid confusion here, I think it's best if we use different terms.

05:28.170 --> 05:35.880
I think we should call our new variable being shocked because in shock loop is ambiguous.

05:35.910 --> 05:41.100
So I'm going to call this function is being shocked.

05:41.760 --> 05:45.960
And this function set is being shocked.

05:47.820 --> 05:55.380
And we'll go back to aura character base and we'll call the function be is being shocked.

05:56.790 --> 06:00.150
And that way we won't have that ambiguity.

06:00.540 --> 06:03.780
So we'll change that and get lifetime replicated props.

06:03.780 --> 06:05.710
So we have is being shocked.

06:05.730 --> 06:07.440
I think that's more appropriate.

06:08.200 --> 06:12.580
And so our combat interface has is being shocked and set is being shocked.

06:12.610 --> 06:17.920
We can override these the implementation versions in or a character base.

06:18.070 --> 06:20.500
So we'll do that here.

06:21.130 --> 06:25.030
Virtual void is being shocked.

06:25.330 --> 06:30.280
Implementation and virtual Bool is being shocked.

06:30.280 --> 06:33.460
So we have set is being shocked and is being shocked.

06:33.490 --> 06:38.320
The implementation versions of these will generate the function definitions for these.

06:38.320 --> 06:41.650
And set is being shocked is just going to set our boolean.

06:41.650 --> 06:45.880
So be is being shocked equals be in shock.

06:46.330 --> 06:47.410
That's the setter.

06:47.410 --> 06:52.810
And then is being shocked will just return be is being shocked.

06:54.210 --> 07:02.100
And now we have an easy way to get and set that boolean, and we just need to set it when being shocked

07:02.100 --> 07:04.770
and use it in the animation blueprint.

07:04.800 --> 07:11.400
Now, in addition to that, we need to check is being shocked and the attribute set before applying

07:11.400 --> 07:12.550
that hit react.

07:12.570 --> 07:19.110
In other words, before we activate the hit react ability so we can go to ability system and attribute

07:19.110 --> 07:21.720
set and search for hit react.

07:22.840 --> 07:28.230
And right here we're trying to activate abilities by react tag.

07:28.240 --> 07:36.130
What we should do before we do that, though, is we should make sure that that character isn't being

07:36.130 --> 07:40.300
shocked because if they're being shocked, we don't need to do the hit react.

07:40.300 --> 07:40.600
Right.

07:40.600 --> 07:49.810
So we're going to check and we're going to check if props dot target character implements you combat

07:49.810 --> 07:50.800
interface.

07:52.810 --> 07:57.610
And we're going to also check we'll just have an end here.

07:58.720 --> 08:09.730
I combat interface execute is being shocked and we'll have to pass in props dot target character.

08:10.180 --> 08:14.620
So if being shocked we should not hit react.

08:14.890 --> 08:20.830
So really this should be not is being shocked if not being shocked.

08:21.350 --> 08:24.860
Then we'll have the hit react ability activated.

08:25.540 --> 08:29.290
So with that, we can go ahead and compile and launch.

08:30.610 --> 08:38.140
Okay, so we're back in the editor, and we need to take care of actually being in the pose associated

08:38.140 --> 08:45.280
with the shock loop, which means in blueprints character, we can open up enemy and we can add another

08:45.280 --> 08:46.390
state here.

08:46.390 --> 08:48.820
So we're going to add a new state.

08:48.850 --> 08:53.740
We'll drag off add state and we'll call this being shocked.

08:55.690 --> 09:01.030
And we'll have transitions to and from an end being shocked.

09:01.060 --> 09:02.890
We'll just add a sequence player.

09:05.980 --> 09:11.920
Now we need transition rules, which means we need a boolean so we can go back to the event graph.

09:12.750 --> 09:22.890
And we can get is shocked now as enemy we can simply use is shocked and get is being shocked here and

09:22.890 --> 09:24.960
we can promote that to a variable.

09:25.700 --> 09:27.350
And we can call this.

09:28.390 --> 09:32.770
Being shocked is being shocked is fine.

09:32.770 --> 09:42.280
We can set that and in main states we can use is being shocked to transition into being shocked and

09:42.310 --> 09:48.060
is being shocked with a not boolean to transition out of it.

09:49.150 --> 09:58.360
Now we just need to set those animations for each animation blueprint so we can go to daemon app daemon.

09:58.780 --> 10:04.450
We can open up asset override and find being shocked.

10:04.630 --> 10:06.790
We can search for shock.

10:08.490 --> 10:11.580
And here's a demon shock loop if you want to see it.

10:11.770 --> 10:13.500
Here's what it looks like.

10:13.530 --> 10:21.870
Now you could speed it up, if you like, by setting the rate scale to 1.25, maybe even 1.5 if you

10:21.870 --> 10:22.440
like.

10:22.650 --> 10:24.840
The demon one is a little bit slower.

10:25.320 --> 10:26.850
So there's the demon.

10:29.280 --> 10:30.690
We can go back.

10:33.220 --> 10:35.290
And open up Google.

10:36.010 --> 10:37.810
Go to asset override.

10:38.780 --> 10:40.400
For as being shocked.

10:40.430 --> 10:42.850
We can use Shock Loop for the ghoul.

10:42.860 --> 10:44.930
And here's what that looks like.

10:45.640 --> 10:48.220
So being shocked looks shocking.

10:48.490 --> 10:50.290
So we have that.

10:51.760 --> 10:54.250
We can go to our next enemy.

10:55.340 --> 10:56.690
Goblin slingshot.

10:58.590 --> 11:04.410
Go to asset override and for being shocked we can use shock loop.

11:04.410 --> 11:06.650
There's hit react shock loop spear.

11:06.660 --> 11:09.420
It should be the same as shock loop, so that's fine.

11:11.700 --> 11:14.400
And we can get the goblin spear.

11:15.810 --> 11:20.880
Go to its asset override and search for shock here.

11:22.190 --> 11:23.720
And use shock loop here.

11:26.610 --> 11:27.230
Okay.

11:27.240 --> 11:29.430
Next is our shaman.

11:30.400 --> 11:32.350
And for the shaman.

11:34.240 --> 11:40.870
We can search for shock and use Shaman Shock loop, and you can look at those if you want to see them.

11:40.870 --> 11:45.220
But we'll go ahead and just test those out, starting with Goblin Sphere.

11:45.220 --> 11:51.160
So after saving all and we do have to actually set that boolean when shocking.

11:51.160 --> 11:52.420
So we'll do that.

11:52.420 --> 11:59.380
But also keep in mind if you press play and your enemies are frozen, you just need to go in and compile

11:59.380 --> 12:02.620
those animation blueprints for all of them.

12:02.620 --> 12:07.960
So if I go to Goblin Spear and compile it, you'll see that it works again.

12:07.960 --> 12:12.070
So just make sure to go in there and compile these all.

12:12.700 --> 12:14.740
Before trying to use them.

12:17.600 --> 12:18.890
And you should be fine.

12:19.370 --> 12:23.410
Okay, so before we can test this out, we have to actually set that boolean.

12:23.420 --> 12:26.340
And we're going to do that from our electrocute ability.

12:26.360 --> 12:29.450
So let's go to abilities lightning electrocute.

12:29.540 --> 12:32.630
And when should we set that boolean.

12:32.810 --> 12:36.440
Well it should coincide with the electric beam.

12:36.440 --> 12:44.270
So if we go to spawn electric beam and look for where we're adding a gameplay cue on actor, we want

12:44.270 --> 12:50.360
to also set that boolean, but only if the first target implements interface.

12:50.360 --> 12:53.600
If that's the case, that's when we want to do it.

12:54.710 --> 13:02.270
So if the first target implements the interface, then we want to set that boolean on the mouse hit

13:02.270 --> 13:04.910
actor which will be the target.

13:04.910 --> 13:07.780
And then we want to set it on our additional targets.

13:07.790 --> 13:12.920
So before anything else we'll take the mouse hit actor or target.

13:12.920 --> 13:16.430
Because if we're in the true case here, they're the same actor.

13:17.130 --> 13:18.930
So we can take cue target.

13:21.550 --> 13:23.020
Or mouse at actor here.

13:23.020 --> 13:29.710
And what we're going to do is right click and set in shock loop.

13:31.440 --> 13:34.620
And we'll hook that in as the target and set this to true.

13:35.890 --> 13:39.430
And we'll be setting that there.

13:39.670 --> 13:44.590
And then for the additional targets, we can do this in our array.

13:44.620 --> 13:48.460
For each loop we can set in shock loop.

13:50.330 --> 13:52.070
And we can use our.

13:52.900 --> 13:54.160
Array element.

13:54.250 --> 13:57.400
I'll go ahead and just do it first.

13:58.330 --> 14:02.380
In an attempt to avoid crossing too many wires.

14:06.980 --> 14:09.020
So we'll set the array element.

14:10.230 --> 14:12.870
As the target there and set this to true.

14:13.690 --> 14:17.710
Now, when are we going to set it back to false?

14:17.740 --> 14:22.570
We need to do that when we remove the queue and we remove the queue.

14:22.690 --> 14:30.160
If you look in clear timer and end ability we go into prepare to end ability.

14:30.160 --> 14:33.160
And here is actually where we're going to remove that queue.

14:34.780 --> 14:36.730
I just see a couple of wires.

14:36.730 --> 14:37.420
There we go.

14:37.420 --> 14:43.390
So before we remove the queue, we definitely only want to do it if the first target implements the

14:43.390 --> 14:43.900
interface.

14:43.900 --> 14:47.140
If it does, here we're taking our mouse hit actor.

14:47.170 --> 14:48.970
We're removing the gameplay queue.

14:48.970 --> 14:52.840
At this point we can also set in shock loop.

14:53.740 --> 14:56.050
Passing in that mouse head actor here.

15:00.770 --> 15:02.900
Like so, and we'll set it to false.

15:06.060 --> 15:10.440
And then we do this for each actor when we're removing the shock loop.

15:10.440 --> 15:14.870
Q and it doesn't matter if we do it when we check for authority or not.

15:14.880 --> 15:19.020
It's a replicated variable regardless, but we could set it locally.

15:19.380 --> 15:21.450
So we'll go ahead and do that.

15:22.490 --> 15:23.810
We'll make some room.

15:24.760 --> 15:28.060
And we'll say set in shock loop.

15:29.060 --> 15:30.980
Using the array element here.

15:32.290 --> 15:35.050
Like so, and we'll set it back to false.

15:35.440 --> 15:37.930
And with that, we can test.

15:38.490 --> 15:41.790
So let's test out on the goblin first.

15:43.920 --> 15:44.640
Okay.

15:45.360 --> 15:48.270
Didn't work, so we need to make sure.

15:50.310 --> 15:51.530
We go to character.

15:52.050 --> 15:54.750
Enemy to the event graph.

15:56.570 --> 15:56.900
Okay.

15:56.900 --> 15:58.640
We have is being shocked.

15:59.880 --> 16:04.650
I think I might have called the wrong function we actually should be calling.

16:04.650 --> 16:06.380
Set is being shocked, right?

16:06.390 --> 16:09.350
Set is being shocked, of course.

16:09.360 --> 16:12.150
So we need to make sure we do that in every case here.

16:12.880 --> 16:14.390
Got to call the right function.

16:15.670 --> 16:18.340
So here set is being shocked.

16:19.760 --> 16:26.210
This is when we're removing it right and right here instead of set and shock loop we need to set is

16:26.240 --> 16:26.990
being shocked.

16:27.020 --> 16:30.680
We even named these different names and I still got them mixed up.

16:34.010 --> 16:35.650
Passing in the target there.

16:35.660 --> 16:41.210
And I also need to check when we're applying this in spawn electric beam.

16:41.210 --> 16:43.520
Yeah, I set in shock loop didn't I?

16:43.520 --> 16:45.680
This should be is being shocked.

16:45.680 --> 16:48.590
So set is being shocked.

16:50.750 --> 16:54.650
And before I even continue, I'm just going to look in my attribute set.

16:59.740 --> 17:01.060
Yes is being shocked.

17:01.060 --> 17:03.310
I did check the right function there.

17:03.640 --> 17:06.370
So here we're going to check in shock.

17:07.620 --> 17:12.210
Conicet is being shocked with the target not in shock loop.

17:12.210 --> 17:13.680
That's the wrong one.

17:14.400 --> 17:17.190
And then we can do this for.

17:19.200 --> 17:22.500
All the additional targets set is being shocked.

17:25.390 --> 17:27.550
Easy to get them confused.

17:28.450 --> 17:31.270
And we need to check in shock for this.

17:32.580 --> 17:34.830
Okay, now we can test this out.

17:38.060 --> 17:38.750
There we go.

17:38.750 --> 17:40.010
Now we see the shock loop.

17:40.010 --> 17:46.070
And it's not spamming that hit react sound, which just sounds awful.

17:46.400 --> 17:51.920
Now things look good and we can test all of the enemies include the Demon Ranger.

17:52.920 --> 17:54.420
The demon warrior.

17:55.710 --> 17:59.820
I'd like to make these all face forward so we can see them better.

18:01.370 --> 18:02.510
The goal.

18:06.920 --> 18:10.760
And the Goblin slingshot.

18:10.790 --> 18:12.140
We don't have that out.

18:14.190 --> 18:15.480
And the shaman.

18:21.860 --> 18:23.630
We'll bring that out as well.

18:26.440 --> 18:27.670
With that.

18:28.390 --> 18:29.680
Let's test these.

18:29.680 --> 18:33.820
We can also see how they look in the stun loop as well.

18:34.270 --> 18:37.450
So we can test out shocking all these.

18:37.630 --> 18:41.470
So first we'll try the slingshot goblin.

18:42.650 --> 18:44.480
Looks good and sounds good.

18:44.480 --> 18:45.920
Let's try the ghoul.

18:48.250 --> 18:49.180
Awesome.

18:49.210 --> 18:50.980
Let's try the shaman.

18:53.710 --> 18:54.340
Shaman.

18:54.340 --> 18:55.180
Looks good.

18:55.210 --> 18:55.810
Spear.

18:55.840 --> 18:56.620
Goblin.

18:57.940 --> 18:58.720
Excellent.

18:58.720 --> 19:00.610
And our demons.

19:01.900 --> 19:03.190
There's that one.

19:04.560 --> 19:05.940
And there's that one.

19:06.300 --> 19:08.490
Let's try on the client as well.

19:09.920 --> 19:11.570
So we're on the client.

19:13.410 --> 19:14.490
Looks great.

19:15.690 --> 19:19.500
Looks great and we'll see what it looks like on both.

19:29.240 --> 19:30.110
Excellent.

19:30.140 --> 19:30.830
Okay.

19:31.100 --> 19:35.450
So we now have shock loop animations and those are looking good.

19:36.980 --> 19:38.060
Excellent.

19:39.250 --> 19:41.970
So we have two different kinds of debuffs.

19:41.980 --> 19:43.180
We have burn.

19:45.820 --> 19:47.140
And we have stun.

19:53.540 --> 19:57.380
And enemies can be burned and stunned at the same time as well.

20:14.900 --> 20:16.580
So things are looking great.

20:16.610 --> 20:17.700
Awesome job.

20:17.720 --> 20:19.550
I'll see you in the next video.
