WEBVTT

00:06.860 --> 00:08.060
Welcome back.

00:08.240 --> 00:11.690
Now we're going to need ourselves some new gameplay tags.

00:11.690 --> 00:16.700
So I'm going to go into our gameplay tags and we have three montage tags.

00:16.700 --> 00:20.900
And these are really used to identify combat sockets.

00:20.930 --> 00:23.900
They're just closely linked with montages.

00:23.900 --> 00:32.180
But now we're going to have montage tags to identify the tagged montages and combat socket tags to identify

00:32.180 --> 00:33.740
the sockets themselves.

00:33.740 --> 00:38.210
So what I'm going to do is rename montage attack weapon.

00:38.210 --> 00:43.250
I'm going to call this instead combat socket weapon.

00:43.250 --> 00:48.380
So instead of montage attack, we're just going to call it combat socket.

00:48.770 --> 00:54.410
And I'm going to replace montage attack with combat socket for all three of these.

00:54.530 --> 01:02.060
Now that means I have to check out the CPP file and replace montage attack with combat socket.

01:02.090 --> 01:08.130
I'm also going to change the name itself to combat socket weapon and we'll do that for all three of

01:08.130 --> 01:09.600
these gameplay tags.

01:10.500 --> 01:15.000
So instead of montage attack, we just have combat socket one word.

01:15.210 --> 01:19.380
Now we're using these in the base character class.

01:19.380 --> 01:25.890
So in the private folder I'm going to go to character or a character base and instead of checking for

01:25.890 --> 01:29.610
montage attack weapon, we're going to check for combat socket weapon.

01:29.610 --> 01:34.890
And instead of montage attack left hand, we'll replace that with combat socket.

01:34.890 --> 01:36.840
Same thing for right hand.

01:36.840 --> 01:44.190
And if we just quickly do a compile, we can make sure there are no other places in the code that use

01:44.190 --> 01:44.970
those tags.

01:44.970 --> 01:46.650
So we shouldn't have any errors.

01:46.680 --> 01:53.490
Now it looks like we're using it in one other spot in or a projectile spell and instead of montage attack

01:53.490 --> 01:56.850
weapon, we now need to use combat socket weapon.

01:57.400 --> 02:01.220
And looks like that is a successful compile.

02:01.240 --> 02:07.520
Now the next thing I want to do is make some gameplay tags to identify our montages.

02:07.540 --> 02:15.490
We're going to call these montage tags and really we could just make whatever montage tags we want.

02:15.520 --> 02:22.030
I'm just going to make 3 or 4 attack montage tags and I'm just going to call these montage underscore

02:22.030 --> 02:26.920
attack one and I'll have let's just say 3 or 4 of these.

02:28.420 --> 02:31.720
And these can be used to identify our montages.

02:31.720 --> 02:34.470
So attacks one through four.

02:34.480 --> 02:39.670
And in fact, we can just make the number a sub tag.

02:39.910 --> 02:45.630
We'll add an underscore there and we can define these and or a gameplay tags.

02:45.820 --> 02:54.400
CP I'll change this comment to say sockets or rather combat sockets, and I'm just going to copy the

02:54.400 --> 03:04.540
tag and the comment, paste it down here and then call this montage tags and we're going to start with

03:04.570 --> 03:13.480
Montage Attack one and this will be montage dot attack dot one.

03:13.480 --> 03:23.500
And the string will say attack one and I just need to copy this three more times and change it from

03:23.500 --> 03:25.510
1 to 2.

03:27.490 --> 03:31.180
Change the next 1 to 3 and the next 1 to 4.

03:33.160 --> 03:35.260
And now we have four montage.

03:35.290 --> 03:37.270
Attack gameplay tags.

03:37.300 --> 03:45.220
Now we're about ready to launch the editor, but before we do, I'd like to change our tag montage struct

03:45.220 --> 03:52.200
so that it has a montage tag, but also a separate tag for the combat socket associated with it.

03:52.210 --> 03:55.360
So that's going to be in our interface.

03:55.360 --> 03:59.560
So we'll go to public interaction and that's the combat interface.

03:59.590 --> 04:05.140
We have a montage tag, we're going to have another tag to identify the socket.

04:05.170 --> 04:07.900
We're going to call this socket tag.

04:08.500 --> 04:14.200
So now we have a tag to identify the socket and the montage.

04:14.230 --> 04:18.130
And with that, let's go ahead and compile and launch.

04:19.270 --> 04:19.630
Okay.

04:19.630 --> 04:22.510
So we have a number of things we're going to have to change here.

04:22.660 --> 04:31.540
For one, our melee attack is using the montage tag for what we really should be using our socket tag

04:31.540 --> 04:34.800
for, but we're also not setting that socket tag.

04:34.810 --> 04:43.000
So what we'll do first is we're going to find here in our melee attack where we're using that montage

04:43.000 --> 04:46.260
tag and instead we're going to use the socket tag.

04:46.270 --> 04:49.780
So we're waiting for a gameplay event based on that.

04:49.810 --> 04:52.930
We're getting the combat socket location based on that.

04:52.930 --> 04:57.400
That should all be using socket tag instead of montage tag.

04:57.490 --> 05:04.720
Now, the only reason we have the montage tag now is to set that in our gameplay queue parameters.

05:04.720 --> 05:07.510
That's going to be a montage tag that we set.

05:07.540 --> 05:13.810
Now we have to set that socket tag for all of our attack tag montages, don't we?

05:13.810 --> 05:17.020
And it looks like we don't even need that impact sound anymore.

05:17.020 --> 05:24.380
So what we'll do is, is we'll open all of our tagged montage arrays in our enemy blueprints.

05:24.380 --> 05:30.530
So we're going to go into Blueprints character and we're going to first start with we'll go from left

05:30.530 --> 05:30.890
to right.

05:30.890 --> 05:37.760
We'll start with BP, Google, and I'm just going to search for attack to get my attack montages.

05:37.760 --> 05:44.810
And we're going to make sure each of these has a unique montage tag and also a socket tag.

05:44.810 --> 05:51.560
So for the Google attack, I'm going to change this to montage attack one.

05:51.560 --> 05:55.190
And it looks like we only have attacks one and two.

05:55.220 --> 05:56.870
There should be four of them.

05:56.870 --> 06:03.470
So that tells me I did something wrong in our gameplay tags and sure enough we have one and two and

06:03.470 --> 06:07.910
I did not change these to three and four in the name.

06:07.910 --> 06:09.320
So that's a problem.

06:09.320 --> 06:10.700
We'll have to fix that.

06:10.700 --> 06:20.450
But this montage tag should be attack one and the socket tag should be combat socket left hand and for

06:20.450 --> 06:26.930
the next attack it should be if we click on montage tag, it is going to say that that old tag has been

06:26.930 --> 06:28.670
removed like it did up there.

06:28.820 --> 06:36.500
We're going to click okay and this will be montage attack two and socket tag is going to be combat socket

06:36.500 --> 06:37.250
right hand.

06:37.280 --> 06:42.860
Now I'm going to go ahead and save and close so that we can compile and launch again.

06:42.860 --> 06:47.900
Now that we've fixed that issue here with these two gameplay tags.

06:47.990 --> 06:50.930
So I'm going to go ahead and just run in debug mode again.

06:52.540 --> 06:53.020
Okay.

06:53.020 --> 06:53.980
Clicking open.

06:54.630 --> 06:58.470
We have our Goole open here searching for attack.

06:58.650 --> 07:02.040
We don't have an impact sound set for the Goole yet and we'll get there.

07:02.040 --> 07:02.400
For now.

07:02.400 --> 07:09.120
We're just talking about the montage and socket tags, and if we go to Montage Attack, we see that

07:09.120 --> 07:16.620
all four are there now and we have combat socket set for left and right hand for the ghoul.

07:16.830 --> 07:18.080
That looks good.

07:18.090 --> 07:24.540
I'm going to close the ghoul and go to blueprints Character and Open Goblin Slingshot.

07:24.570 --> 07:27.540
Let's open that up and search for attack.

07:27.540 --> 07:29.730
And here we're going to set the montage tag.

07:29.730 --> 07:35.700
We're going to click on it, click okay and change this to montage Attack one and change the socket

07:35.730 --> 07:37.620
tag to combat socket.

07:37.620 --> 07:42.720
And it's going to be the combat socket weapon for Goblin Slingshot, right?

07:42.720 --> 07:49.140
So we'll save that, close that and we'll go to the next one, which is Goblin Spear.

07:49.350 --> 07:56.020
We'll search for attack change the montage tag that's going to be just attack one.

07:56.020 --> 07:56.530
Really.

07:56.530 --> 08:00.640
This is just so each montage has a unique tag associated with it.

08:00.670 --> 08:05.590
Unique in a sense that it's different from all the other montages in the same array.

08:05.590 --> 08:12.940
And socket tag will be the weapon socket for Goblin Spear and we'll close that.

08:12.940 --> 08:15.280
And next we have the shaman.

08:15.280 --> 08:16.870
And for the shaman.

08:17.820 --> 08:18.810
We'll do the same thing.

08:18.810 --> 08:20.130
We'll search for attack.

08:20.160 --> 08:25.050
Change the montage tag that's going to be attack one and change the socket tag.

08:25.050 --> 08:26.250
That's going to be weapon.

08:26.610 --> 08:28.290
Compile, save.

08:28.290 --> 08:31.530
And I believe that's all of the tags.

08:31.530 --> 08:39.120
And now in melee attack if we go back to where we're getting a random tagged montage from the array

08:39.150 --> 08:45.690
and setting it, we're using the socket tag and we're waiting for a gameplay event using that socket

08:45.720 --> 08:46.110
tag.

08:46.110 --> 08:48.510
And we're getting a combat socket location.

08:48.510 --> 08:57.090
With that tag, of course, we were using a different tag, so we are going to need to go into our montages

08:57.090 --> 08:59.210
and make sure we're setting the tag.

08:59.220 --> 09:06.030
Now we could set the montage tag in the montage and use the socket tag for the combat socket.

09:06.030 --> 09:09.930
That way we're using the tags that make sense, right?

09:09.960 --> 09:15.240
So we could just take the montage tag and use that in wait gameplay event instead.

09:16.300 --> 09:17.770
And if we do that.

09:18.360 --> 09:26.430
Then we need to make sure to go into our montages and set the correct gameplay tag to the montage tag.

09:26.460 --> 09:34.950
So what we'll do is we'll go into content assets, enemies, and let's just make sure that we're sending

09:34.950 --> 09:37.860
the correct tag in our gameplay events.

09:37.860 --> 09:45.750
So we'll go to Google first, go to animations, Google Attack and select that montage event.

09:45.750 --> 09:49.950
And we have to change this tag because this tag doesn't exist anymore.

09:49.950 --> 09:59.340
And our attack el is montage attack one and it would be a pretty good idea just to double check that

09:59.340 --> 10:05.280
if we go to Blueprints Character Google, Google and search for attack.

10:06.580 --> 10:09.520
Ghoul attack is montage attack one.

10:09.550 --> 10:12.340
Ghoul attack is montage attack two.

10:12.430 --> 10:13.990
So that's correct.

10:14.020 --> 10:20.110
We can also go to the asset browser and open attack r select that and change this.

10:20.920 --> 10:26.800
To montage attack two and now we'll be sending the correct gameplay event tag.

10:27.340 --> 10:29.200
So that takes care of the ghoul.

10:29.200 --> 10:36.220
I'm going to browse to the asset and select Enemies Goblin and we'll just really quickly update this

10:36.220 --> 10:38.440
for the attacks for the Goblin.

10:38.440 --> 10:42.760
So first Slingshot, we have the slingshot attack montage.

10:43.460 --> 10:45.860
I'm going to go ahead and select that montage.

10:45.860 --> 10:46.760
Notify.

10:46.760 --> 10:54.770
And for these we just have one attack and we used montage attack one for not only the Goblin Slingshot,

10:54.770 --> 10:57.230
but also the Goblin Spear.

10:57.230 --> 10:59.240
So we'll go to that one as well.

11:00.600 --> 11:02.430
And we'll change this.

11:03.470 --> 11:04.820
It's going to be attack one.

11:05.360 --> 11:06.770
We'll save that.

11:06.800 --> 11:08.570
We'll go back to enemies.

11:08.570 --> 11:11.150
And we next have the shaman.

11:11.150 --> 11:16.310
So we're going to go to the Shaman attack montage and change this to attack one.

11:18.420 --> 11:19.650
Save that.

11:20.040 --> 11:22.440
And I believe that's all for now.

11:22.560 --> 11:27.360
So now all of our montages are sending the correct event tag.

11:27.840 --> 11:31.080
Okay, so back to melee attack.

11:31.110 --> 11:35.850
We know that we're sending the correct montage tag and waiting for that gameplay event.

11:35.880 --> 11:41.160
We also have the correct socket tag set and we're getting the combat socket for that.

11:41.340 --> 11:47.730
And then finally over here, when we create our gameplay queue parameters, we're getting our tagged

11:47.730 --> 11:48.660
montage.

11:48.690 --> 11:53.160
Getting that montage tag and setting that in aggregated source tags.

11:53.280 --> 12:00.720
And then in our gameplay queue melee impact, we're looping through those aggregated source tags.

12:00.720 --> 12:08.880
And what we can do is we can use that tag to get the correct sound to play based on that montage, which

12:08.880 --> 12:15.720
means we need some kind of easy lookup function that can take a montage tag and return from that array

12:15.720 --> 12:17.280
of attack montages.

12:17.310 --> 12:25.040
The correct either the sound or just the correct struct that corresponds to that montage tag.

12:25.060 --> 12:30.280
So I'd like to make just an easy interface function to perform that lookup.

12:30.280 --> 12:36.520
So I'm going to close saving all and go back to combat interface and we'll make a function that returns

12:36.550 --> 12:42.400
a tagged montage that takes a montage tag and we'll implement that in base character.

12:42.490 --> 12:45.640
So this will return an F tagged montage.

12:47.090 --> 12:49.400
F tagged montage.

12:50.810 --> 13:04.400
We'll call this get tagged montage by tag and we'll take a const F gameplay tag reference called montage

13:04.400 --> 13:08.480
tag and this could be Blueprint Native event Blueprint callable.

13:08.480 --> 13:12.740
And we'll go ahead and override this in or a character base.

13:14.260 --> 13:19.270
So this will be virtual F tagged montage.

13:20.080 --> 13:22.720
Get tagged montage by tag.

13:22.960 --> 13:25.060
Let's go ahead and implement this.

13:25.660 --> 13:30.430
And we'll just perform a lookup, we'll just loop through our tagged montages.

13:30.430 --> 13:39.730
So we're going to say for F tagged montage, we'll call this tagged montage and attack montages and

13:39.730 --> 13:48.460
we'll say if tagged montage dot montage tag equals montage tag.

13:49.940 --> 13:53.150
Then we'll return tagged montage.

13:53.810 --> 13:58.190
And if we reach the end, we'll return an empty tagged montage.

13:59.550 --> 14:05.460
So this way we could just call this function, pass in the tag and get the correct tagged montage.

14:05.490 --> 14:08.730
So let's go ahead and run the editor.

14:10.270 --> 14:16.720
We'll go ahead and click open, we'll go into our gameplay queue and as we loop through these tags,

14:16.720 --> 14:20.710
I'm going to call get tagged montage by tag.

14:20.920 --> 14:26.050
We're going to pass in the array element and actually this looks like a gameplay tag container.

14:26.050 --> 14:31.180
So really when we called make array, we made an array of gameplay tag containers.

14:31.210 --> 14:37.450
That's not exactly what we want to do, but what we can do to get an array of tags is just break this

14:37.450 --> 14:38.380
tag container.

14:38.380 --> 14:45.640
So if we drag off and use break gameplay tag container, then now we have an array of gameplay tag structures

14:45.640 --> 14:47.850
and we can use for each with that.

14:47.860 --> 14:52.390
Now this for each loop is for an array of gameplay tag container structures.

14:52.390 --> 14:53.590
That's not what we want.

14:53.620 --> 14:57.760
We want a for each loop for gameplay tags.

14:57.760 --> 15:00.730
So this takes a gameplay tag array now.

15:01.710 --> 15:07.830
Now looping through the gameplay tag array, we can now call get tagged montage by tag using the array

15:07.830 --> 15:09.270
element like that.

15:09.270 --> 15:14.100
And then this returns a tagged montage structure which we can break.

15:14.630 --> 15:21.800
And this contains an impact sound so we can play sound at location using this impact sound.

15:21.980 --> 15:24.320
We need a world context object for this.

15:24.350 --> 15:26.690
We can just use the effect causer.

15:28.050 --> 15:29.790
As the world context object.

15:29.790 --> 15:32.640
We could do that for spawn system at location as well.

15:33.030 --> 15:38.700
Effect causer can go into that and we can see if this works.

15:38.700 --> 15:42.000
And I like to see visual feedback as well.

15:42.000 --> 15:48.240
So I'm also going to take this for each loop, take the array element, I'm going to get a debug string

15:48.540 --> 15:57.240
and print that I just like seeing in text what exactly our gameplay tag is.

15:58.280 --> 16:01.470
And of course get tagged montage by tag.

16:01.490 --> 16:09.470
This has to be our effect causer that we pass in as this is that interface function.

16:09.470 --> 16:11.750
It needs to know which object.

16:11.750 --> 16:14.090
So we're going to pass in the effect causer for that.

16:14.090 --> 16:16.400
With all that we can press play.

16:17.440 --> 16:20.380
And looks like we're getting sounds.

16:20.380 --> 16:22.000
We're getting the correct.

16:22.600 --> 16:24.520
Montage attack.

16:24.670 --> 16:27.910
Gameplay tag which is perfect.

16:28.180 --> 16:32.950
And now we don't need this print string and this needs to be cleaned up quite a bit.

16:33.670 --> 16:36.970
Now this melee impact will work fine.

16:36.970 --> 16:43.720
We just have to keep in mind that if we did set more than one source tag here, then we'd be looping

16:43.720 --> 16:45.880
through and playing a sound for all of them.

16:45.880 --> 16:48.340
So that's just something to keep in mind here.

16:48.370 --> 16:53.830
Now we have some crisscrossing wires here, so we could make this a little bit more organized, a little

16:53.830 --> 16:54.430
bit better.

16:54.430 --> 17:00.310
So why don't we go ahead and just fix this up a little bit before we wrap up.

17:00.310 --> 17:04.240
I'm going to bring this parent call.

17:04.270 --> 17:10.000
We'll put a reroute node and we'll just put this right here so it's out of the way of everything else.

17:10.270 --> 17:17.170
I'm going to bring the gameplay parameters up here and I'd like to just promote the effect causer I

17:17.170 --> 17:17.890
think.

17:18.550 --> 17:19.840
To a variable.

17:20.500 --> 17:22.970
We'll do that for the source object as well.

17:23.050 --> 17:26.230
So let's promote this and we're going to use a local variable.

17:26.230 --> 17:31.060
So we're going to call this one effect causer.

17:34.540 --> 17:36.190
We'll set that right here.

17:38.420 --> 17:40.610
And we'll call the source object.

17:40.760 --> 17:42.140
Promote a local variable.

17:42.140 --> 17:44.300
Call this source object.

17:45.720 --> 17:47.430
And we'll set that there as well.

17:47.520 --> 17:50.370
And then we'll replace some of these nodes.

17:50.370 --> 17:54.390
So we'll use effect causer for the world context object.

17:54.420 --> 17:58.200
We're also using it here in Get blood effect.

18:02.130 --> 18:03.690
So we'll get rid of that.

18:04.170 --> 18:08.640
We can go ahead and promote location to a local variable as well.

18:10.950 --> 18:13.170
Promote to local variable.

18:13.580 --> 18:15.210
We'll call it location.

18:18.720 --> 18:21.330
So already this is starting to look a lot better.

18:23.610 --> 18:27.840
For our spawn system at location for the world context object.

18:27.840 --> 18:29.940
We're going to use effect causer here.

18:30.420 --> 18:32.040
We'll get rid of that wire.

18:32.070 --> 18:36.720
For location, we're going to use location and get rid of that wire.

18:38.470 --> 18:40.420
And for play, sound and location.

18:40.420 --> 18:41.500
Same thing.

18:41.890 --> 18:43.090
Get rid of that wire.

18:44.640 --> 18:48.030
So we're starting to get a little bit more organized.

18:51.620 --> 18:54.680
We can promote this boolean as well.

18:56.160 --> 19:00.060
This is for the return value.

19:00.120 --> 19:05.580
I'm just going to promote this as well to a local variable called RET Val.

19:08.400 --> 19:12.000
Just so we don't have that reaching across the entire blueprint.

19:14.140 --> 19:16.210
And we'll plug in Red Val here.

19:18.650 --> 19:20.390
And get rid of that reroute.

19:21.630 --> 19:22.590
There we go.

19:23.850 --> 19:25.680
So some clean up here.

19:26.220 --> 19:27.980
Okay, that's looking better.

19:27.990 --> 19:33.480
And we'll just unclamp all this here, like so.

19:35.870 --> 19:36.530
There we go.

19:36.530 --> 19:38.690
Now we don't have so many things.

19:39.280 --> 19:40.330
Crossing.

19:40.930 --> 19:47.660
Okay, so after all those changes, we just need to make sure our gameplay queue still works as expected.

19:47.680 --> 19:49.990
So I'm going to save all press play.

19:50.590 --> 19:52.840
And check this out on a client.

19:53.950 --> 19:55.540
Looks like it missed there.

19:55.540 --> 19:58.000
And it's hitting and we're getting sound.

19:58.030 --> 20:01.330
We're getting blood and on the server.

20:02.260 --> 20:03.430
It works.

20:03.640 --> 20:05.800
Everything is looking great.

20:08.100 --> 20:11.370
That's playing as listen server if we play as client.

20:12.280 --> 20:16.900
Then we got two clients here, and it's working on both clients.

20:16.930 --> 20:17.890
Perfect.

20:18.040 --> 20:20.480
Okay, I'll set that back to listen server.

20:20.500 --> 20:26.110
I'm also going to set it back to one player and we now have a working gameplay queue.

20:26.200 --> 20:29.530
So we kind of put a lot of moving parts into this.

20:29.530 --> 20:36.750
Our melee attack though is a lot more versatile as we're playing a montage using a tagged montage,

20:36.760 --> 20:42.040
we're now using a montage tag and that's what we're waiting for with our gameplay event.

20:42.040 --> 20:45.840
And we have a separate gameplay tag called socket Tag.

20:45.850 --> 20:50.620
That's what we're using for our jet combat socket location.

20:50.620 --> 20:59.140
So now those are decoupled and now we have multiple attack montages and they're identified and we're

20:59.140 --> 21:06.790
passing in a gameplay tag container that contains that montage tag for the montage.

21:06.790 --> 21:13.010
We're playing for our attack and we're receiving that in our gameplay parameters in the gameplay queue.

21:13.010 --> 21:18.920
So by the time this gameplay queue executes on the client, we're passing that along.

21:18.920 --> 21:25.880
We have that gameplay tag container aggregated source tags that contains the montage tag that we set

21:25.880 --> 21:33.200
in there and we created this nice interface function to perform the lookup to get the correct tagged

21:33.200 --> 21:36.080
montage which contains the impact sound.

21:36.080 --> 21:37.670
And we're playing that.

21:37.670 --> 21:44.450
So now we can have a different impact sound per enemy and it's not hard coded into our gameplay queue

21:44.450 --> 21:46.310
and get tagged.

21:46.310 --> 21:48.130
Montage uses effect causer.

21:48.140 --> 21:49.460
We made that a local variable.

21:49.460 --> 21:57.560
So I'm just going to quickly replace this wire and now I feel a lot better about that.

21:57.980 --> 21:58.850
Excellent job.

21:58.850 --> 22:06.170
So now we know a little bit about gameplay cues and our melee attacks are using them and it looks really

22:06.170 --> 22:08.690
good with our spear goblin.

22:08.870 --> 22:09.950
Excellent.

22:10.190 --> 22:12.890
Great job and I'll see you in the next video.
