WEBVTT

00:06.870 --> 00:07.980
Welcome back.

00:08.340 --> 00:14.880
Now, our gay melee attack is working, at least for the spear goblin.

00:14.880 --> 00:15.570
Right.

00:15.570 --> 00:23.640
But I'd like to be able to use this melee attack for any melee enemy, and that includes enemies that

00:23.640 --> 00:33.360
may not have a combat socket location on their weapon as jet combat socket location is retrieving a

00:33.360 --> 00:36.240
socket location from the weapon specifically.

00:36.570 --> 00:41.880
But we have an asset in our startup project, which is a character that doesn't have a weapon.

00:41.880 --> 00:43.470
That's this ghoul here.

00:43.470 --> 00:47.610
And the ghoul has some animations for attacking.

00:47.610 --> 00:51.450
It has a left hand attack and it has a right hand attack.

00:51.450 --> 00:53.400
And these don't use the weapon.

00:53.400 --> 00:54.710
They use the hand.

00:54.720 --> 01:00.030
So what if we need a socket location on the mesh itself?

01:00.120 --> 01:04.920
So that's one limitation our system has that we need to account for.

01:04.920 --> 01:12.120
Now, we can't just use a melee attack on all warriors and expect them to be able to play this montage

01:12.120 --> 01:14.790
that works only for Goblin Spear.

01:14.820 --> 01:23.370
We need to retrieve that montage from the character somehow because the montage is specific to the character.

01:23.520 --> 01:30.630
So to me that means perhaps an interface function on the combat interface that we can use, or even

01:30.630 --> 01:34.680
the enemy interface for retrieving the montage.

01:34.860 --> 01:42.090
Now on top of that, though, there are more complications because, well, our ghoul has a left and

01:42.090 --> 01:43.860
a right attack.

01:43.860 --> 01:46.230
So how are we going to handle that?

01:46.260 --> 01:53.190
Do we want our ghoul to attack with the left only or attack with the right only, or perhaps attack

01:53.190 --> 01:55.290
with the left and right randomly.

01:55.440 --> 01:59.190
So we need to take that into account as well.

01:59.190 --> 02:06.990
One option is to have an array of montages to play and just pick one at random from within our attack.

02:07.020 --> 02:09.070
That's a decent approach.

02:09.280 --> 02:16.660
Now the thing is though, that we're waiting for a gameplay event that's sent from our attack montage,

02:16.930 --> 02:22.570
and our montage very much determines which socket we want.

02:22.570 --> 02:27.340
If we're playing a left hand swipe, we want the socket on the left hand.

02:27.340 --> 02:31.510
If we're playing a right hand swipe, we want a socket on the right hand.

02:31.510 --> 02:37.390
And if we're playing a montage for an enemy that has a weapon, we want the weapon socket.

02:37.720 --> 02:43.690
So in other words, the montage is directly related to whatever socket we're getting and whether that's

02:43.690 --> 02:48.490
from the mesh on the character or the mesh on its weapon if it has one.

02:48.670 --> 02:57.070
So I like the versatility to be able to pass a specific gameplay tag from the montage and based on that

02:57.070 --> 03:00.040
gameplay tag, get the correct socket.

03:00.070 --> 03:07.660
In other words, get combat socket location should take a gameplay tag as an input parameter and wait

03:07.660 --> 03:16.620
gameplay event should wait for an event that has the tag that's directly related to the montage.

03:16.630 --> 03:20.740
In other words, montage and gameplay tag need to go together.

03:20.740 --> 03:27.850
We need to link them together somehow and we need to get that information from our enemy, from its

03:27.850 --> 03:32.710
combat interface or its enemy interface, whichever we choose.

03:32.710 --> 03:39.550
So we have a number of things we want to change if we want this melee attack to be versatile enough

03:39.550 --> 03:46.150
to be used by multiple different types of enemies, including those that have weapons and those that

03:46.150 --> 03:46.870
don't.

03:47.170 --> 03:51.710
So for that reason, we're going to make several changes.

03:51.730 --> 04:01.090
For one, I now am going to want to access these event tags from within Cplusplus because get combat

04:01.090 --> 04:07.810
socket location is implemented in C plus plus, and I'm going to want to retrieve the correct socket

04:07.810 --> 04:15.070
location based on a gameplay tag and I'd like that gameplay tag to be related to the montage.

04:15.100 --> 04:22.980
I want an event montage dot attack and I want one for weapons for the left hand and for the right hand.

04:22.990 --> 04:29.440
So the first step we're going to do in this video is to add some native gameplay tags that we'll be

04:29.440 --> 04:32.260
using and linking up with our montages.

04:32.350 --> 04:38.710
And because those socket locations are so linked, we're going to change our get combat socket location

04:38.710 --> 04:39.550
function as well.

04:39.550 --> 04:41.800
But we'll get to that one thing at a time.

04:41.800 --> 04:44.590
The first thing we need are some gameplay tags.

04:44.590 --> 04:52.960
So I'm going to go into writer and into aura gameplay tags and add some new gameplay tags.

04:53.110 --> 04:55.930
So we'll have an gameplay tag here.

04:56.110 --> 05:03.760
And these gameplay tags are going to be for the socket and they're also going to be directly related

05:03.760 --> 05:05.650
to attack montages.

05:05.680 --> 05:14.560
So what we're going to do is call this montage, underscore attack, underscore weapon.

05:14.560 --> 05:16.550
So we'll have one for the weapon.

05:16.570 --> 05:19.570
We're also going to have one for the left and right hands.

05:19.570 --> 05:22.090
So I'm going to paste this two more times.

05:22.090 --> 05:27.910
Call this first one right hand and call the next one left hand.

05:29.650 --> 05:33.670
Now we need to define those in the CPP file.

05:34.030 --> 05:38.530
I'm going to go ahead and copy what we've already got down here at the bottom, including that last

05:38.530 --> 05:39.430
comment.

05:39.430 --> 05:42.870
And this is going to be a montage here.

05:42.880 --> 05:44.740
So what are our tags?

05:44.740 --> 05:48.160
Well, we're going to have montage attack weapon.

05:48.160 --> 05:54.400
So the F name will be montage dot attack dot weapon.

05:54.670 --> 05:59.770
The F string is just going to say weapon and we'll have two more.

05:59.770 --> 06:02.830
So I'm going to copy this and paste it twice.

06:04.020 --> 06:05.620
The next one will be montage.

06:05.640 --> 06:07.080
Attack right hand.

06:07.290 --> 06:08.730
We'll change the name.

06:08.730 --> 06:10.080
It'll say right hand.

06:11.100 --> 06:16.830
The F string will say right hand and the next one will be for the left hand.

06:16.830 --> 06:21.240
And we'll change this to say montage, dot attack, dot left hand.

06:21.390 --> 06:24.540
And the string will say left hand.

06:24.780 --> 06:33.540
So now there are three new types of gameplay tags and we're going to need our jet combat socket location

06:33.540 --> 06:35.210
to take a gameplay tag.

06:35.220 --> 06:36.570
We'll get to that.

06:36.570 --> 06:42.810
For now, let's just go ahead and launch and see those gameplay tags in our project settings.

06:44.270 --> 06:46.910
So we'll go ahead and open everything back up.

06:46.910 --> 06:53.060
And in project settings we can go to gameplay tags and now we have montage.

06:53.090 --> 06:54.980
There it is, attack.

06:54.980 --> 06:57.620
And we have left hand, right hand and weapon.

06:57.740 --> 07:01.340
Looks like my left hand there has a space in it.

07:01.370 --> 07:08.210
That's not what I wanted, so I'm going to go ahead and take that space out of it and that should fix

07:08.210 --> 07:09.170
that problem.

07:09.200 --> 07:13.730
Other than that, though, we have our new gameplay tags and that's great.

07:13.820 --> 07:21.140
The next thing we need to do is associate these gameplay tags with montages so that we know which montage

07:21.140 --> 07:25.160
uses which of these gameplay tags, and we'll do that next.

07:25.190 --> 07:26.330
I'll see you soon.
