Welcome back.
Now we're going to need ourselves some new gameplay tags.
So I'm going to go into our gameplay tags and we have three montage tags.
And these are really used to identify combat sockets.
They're just closely linked with montages.
But now we're going to have montage tags to identify the tagged montages and combat socket tags to identify
the sockets themselves.
So what I'm going to do is rename montage attack weapon.
I'm going to call this instead combat socket weapon.
So instead of montage attack, we're just going to call it combat socket.
And I'm going to replace montage attack with combat socket for all three of these.
Now that means I have to check out the CPP file and replace montage attack with combat socket.
I'm also going to change the name itself to combat socket weapon and we'll do that for all three of
these gameplay tags.
So instead of montage attack, we just have combat socket one word.
Now we're using these in the base character class.
So in the private folder I'm going to go to character or a character base and instead of checking for
montage attack weapon, we're going to check for combat socket weapon.
And instead of montage attack left hand, we'll replace that with combat socket.
Same thing for right hand.
And if we just quickly do a compile, we can make sure there are no other places in the code that use
those tags.
So we shouldn't have any errors.
Now it looks like we're using it in one other spot in or a projectile spell and instead of montage attack
weapon, we now need to use combat socket weapon.
And looks like that is a successful compile.
Now the next thing I want to do is make some gameplay tags to identify our montages.
We're going to call these montage tags and really we could just make whatever montage tags we want.
I'm just going to make 3 or 4 attack montage tags and I'm just going to call these montage underscore
attack one and I'll have let's just say 3 or 4 of these.
And these can be used to identify our montages.
So attacks one through four.
And in fact, we can just make the number a sub tag.
We'll add an underscore there and we can define these and or a gameplay tags.
CP I'll change this comment to say sockets or rather combat sockets, and I'm just going to copy the
tag and the comment, paste it down here and then call this montage tags and we're going to start with
Montage Attack one and this will be montage dot attack dot one.
And the string will say attack one and I just need to copy this three more times and change it from
1 to 2.
Change the next 1 to 3 and the next 1 to 4.
And now we have four montage.
Attack gameplay tags.
Now we're about ready to launch the editor, but before we do, I'd like to change our tag montage struct
so that it has a montage tag, but also a separate tag for the combat socket associated with it.
So that's going to be in our interface.
So we'll go to public interaction and that's the combat interface.
We have a montage tag, we're going to have another tag to identify the socket.
We're going to call this socket tag.
So now we have a tag to identify the socket and the montage.
And with that, let's go ahead and compile and launch.
Okay.
So we have a number of things we're going to have to change here.
For one, our melee attack is using the montage tag for what we really should be using our socket tag
for, but we're also not setting that socket tag.
So what we'll do first is we're going to find here in our melee attack where we're using that montage
tag and instead we're going to use the socket tag.
So we're waiting for a gameplay event based on that.
We're getting the combat socket location based on that.
That should all be using socket tag instead of montage tag.
Now, the only reason we have the montage tag now is to set that in our gameplay queue parameters.
That's going to be a montage tag that we set.
Now we have to set that socket tag for all of our attack tag montages, don't we?
And it looks like we don't even need that impact sound anymore.
So what we'll do is, is we'll open all of our tagged montage arrays in our enemy blueprints.
So we're going to go into Blueprints character and we're going to first start with we'll go from left
to right.
We'll start with BP, Google, and I'm just going to search for attack to get my attack montages.
And we're going to make sure each of these has a unique montage tag and also a socket tag.
So for the Google attack, I'm going to change this to montage attack one.
And it looks like we only have attacks one and two.
There should be four of them.
So that tells me I did something wrong in our gameplay tags and sure enough we have one and two and
I did not change these to three and four in the name.
So that's a problem.
We'll have to fix that.
But this montage tag should be attack one and the socket tag should be combat socket left hand and for
the next attack it should be if we click on montage tag, it is going to say that that old tag has been
removed like it did up there.
We're going to click okay and this will be montage attack two and socket tag is going to be combat socket
right hand.
Now I'm going to go ahead and save and close so that we can compile and launch again.
Now that we've fixed that issue here with these two gameplay tags.
So I'm going to go ahead and just run in debug mode again.
Okay.
Clicking open.
We have our Goole open here searching for attack.
We don't have an impact sound set for the Goole yet and we'll get there.
For now.
We're just talking about the montage and socket tags, and if we go to Montage Attack, we see that
all four are there now and we have combat socket set for left and right hand for the ghoul.
That looks good.
I'm going to close the ghoul and go to blueprints Character and Open Goblin Slingshot.
Let's open that up and search for attack.
And here we're going to set the montage tag.
We're going to click on it, click okay and change this to montage Attack one and change the socket
tag to combat socket.
And it's going to be the combat socket weapon for Goblin Slingshot, right?
So we'll save that, close that and we'll go to the next one, which is Goblin Spear.
We'll search for attack change the montage tag that's going to be just attack one.
Really.
This is just so each montage has a unique tag associated with it.
Unique in a sense that it's different from all the other montages in the same array.
And socket tag will be the weapon socket for Goblin Spear and we'll close that.
And next we have the shaman.
And for the shaman.
We'll do the same thing.
We'll search for attack.
Change the montage tag that's going to be attack one and change the socket tag.
That's going to be weapon.
Compile, save.
And I believe that's all of the tags.
And now in melee attack if we go back to where we're getting a random tagged montage from the array
and setting it, we're using the socket tag and we're waiting for a gameplay event using that socket
tag.
And we're getting a combat socket location.
With that tag, of course, we were using a different tag, so we are going to need to go into our montages
and make sure we're setting the tag.
Now we could set the montage tag in the montage and use the socket tag for the combat socket.
That way we're using the tags that make sense, right?
So we could just take the montage tag and use that in wait gameplay event instead.
And if we do that.
Then we need to make sure to go into our montages and set the correct gameplay tag to the montage tag.
So what we'll do is we'll go into content assets, enemies, and let's just make sure that we're sending
the correct tag in our gameplay events.
So we'll go to Google first, go to animations, Google Attack and select that montage event.
And we have to change this tag because this tag doesn't exist anymore.
And our attack el is montage attack one and it would be a pretty good idea just to double check that
if we go to Blueprints Character Google, Google and search for attack.
Ghoul attack is montage attack one.
Ghoul attack is montage attack two.
So that's correct.
We can also go to the asset browser and open attack r select that and change this.
To montage attack two and now we'll be sending the correct gameplay event tag.
So that takes care of the ghoul.
I'm going to browse to the asset and select Enemies Goblin and we'll just really quickly update this
for the attacks for the Goblin.
So first Slingshot, we have the slingshot attack montage.
I'm going to go ahead and select that montage.
Notify.
And for these we just have one attack and we used montage attack one for not only the Goblin Slingshot,
but also the Goblin Spear.
So we'll go to that one as well.
And we'll change this.
It's going to be attack one.
We'll save that.
We'll go back to enemies.
And we next have the shaman.
So we're going to go to the Shaman attack montage and change this to attack one.
Save that.
And I believe that's all for now.
So now all of our montages are sending the correct event tag.
Okay, so back to melee attack.
We know that we're sending the correct montage tag and waiting for that gameplay event.
We also have the correct socket tag set and we're getting the combat socket for that.
And then finally over here, when we create our gameplay queue parameters, we're getting our tagged
montage.
Getting that montage tag and setting that in aggregated source tags.
And then in our gameplay queue melee impact, we're looping through those aggregated source tags.
And what we can do is we can use that tag to get the correct sound to play based on that montage, which
means we need some kind of easy lookup function that can take a montage tag and return from that array
of attack montages.
The correct either the sound or just the correct struct that corresponds to that montage tag.
So I'd like to make just an easy interface function to perform that lookup.
So I'm going to close saving all and go back to combat interface and we'll make a function that returns
a tagged montage that takes a montage tag and we'll implement that in base character.
So this will return an F tagged montage.
F tagged montage.
We'll call this get tagged montage by tag and we'll take a const F gameplay tag reference called montage
tag and this could be Blueprint Native event Blueprint callable.
And we'll go ahead and override this in or a character base.
So this will be virtual F tagged montage.
Get tagged montage by tag.
Let's go ahead and implement this.
And we'll just perform a lookup, we'll just loop through our tagged montages.
So we're going to say for F tagged montage, we'll call this tagged montage and attack montages and
we'll say if tagged montage dot montage tag equals montage tag.
Then we'll return tagged montage.
And if we reach the end, we'll return an empty tagged montage.
So this way we could just call this function, pass in the tag and get the correct tagged montage.
So let's go ahead and run the editor.
We'll go ahead and click open, we'll go into our gameplay queue and as we loop through these tags,
I'm going to call get tagged montage by tag.
We're going to pass in the array element and actually this looks like a gameplay tag container.
So really when we called make array, we made an array of gameplay tag containers.
That's not exactly what we want to do, but what we can do to get an array of tags is just break this
tag container.
So if we drag off and use break gameplay tag container, then now we have an array of gameplay tag structures
and we can use for each with that.
Now this for each loop is for an array of gameplay tag container structures.
That's not what we want.
We want a for each loop for gameplay tags.
So this takes a gameplay tag array now.
Now looping through the gameplay tag array, we can now call get tagged montage by tag using the array
element like that.
And then this returns a tagged montage structure which we can break.
And this contains an impact sound so we can play sound at location using this impact sound.
We need a world context object for this.
We can just use the effect causer.
As the world context object.
We could do that for spawn system at location as well.
Effect causer can go into that and we can see if this works.
And I like to see visual feedback as well.
So I'm also going to take this for each loop, take the array element, I'm going to get a debug string
and print that I just like seeing in text what exactly our gameplay tag is.
And of course get tagged montage by tag.
This has to be our effect causer that we pass in as this is that interface function.
It needs to know which object.
So we're going to pass in the effect causer for that.
With all that we can press play.
And looks like we're getting sounds.
We're getting the correct.
Montage attack.
Gameplay tag which is perfect.
And now we don't need this print string and this needs to be cleaned up quite a bit.
Now this melee impact will work fine.
We just have to keep in mind that if we did set more than one source tag here, then we'd be looping
through and playing a sound for all of them.
So that's just something to keep in mind here.
Now we have some crisscrossing wires here, so we could make this a little bit more organized, a little
bit better.
So why don't we go ahead and just fix this up a little bit before we wrap up.
I'm going to bring this parent call.
We'll put a reroute node and we'll just put this right here so it's out of the way of everything else.
I'm going to bring the gameplay parameters up here and I'd like to just promote the effect causer I
think.
To a variable.
We'll do that for the source object as well.
So let's promote this and we're going to use a local variable.
So we're going to call this one effect causer.
We'll set that right here.
And we'll call the source object.
Promote a local variable.
Call this source object.
And we'll set that there as well.
And then we'll replace some of these nodes.
So we'll use effect causer for the world context object.
We're also using it here in Get blood effect.
So we'll get rid of that.
We can go ahead and promote location to a local variable as well.
Promote to local variable.
We'll call it location.
So already this is starting to look a lot better.
For our spawn system at location for the world context object.
We're going to use effect causer here.
We'll get rid of that wire.
For location, we're going to use location and get rid of that wire.
And for play, sound and location.
Same thing.
Get rid of that wire.
So we're starting to get a little bit more organized.
We can promote this boolean as well.
This is for the return value.
I'm just going to promote this as well to a local variable called RET Val.
Just so we don't have that reaching across the entire blueprint.
And we'll plug in Red Val here.
And get rid of that reroute.
There we go.
So some clean up here.
Okay, that's looking better.
And we'll just unclamp all this here, like so.
There we go.
Now we don't have so many things.
Crossing.
Okay, so after all those changes, we just need to make sure our gameplay queue still works as expected.
So I'm going to save all press play.
And check this out on a client.
Looks like it missed there.
And it's hitting and we're getting sound.
We're getting blood and on the server.
It works.
Everything is looking great.
That's playing as listen server if we play as client.
Then we got two clients here, and it's working on both clients.
Perfect.
Okay, I'll set that back to listen server.
I'm also going to set it back to one player and we now have a working gameplay queue.
So we kind of put a lot of moving parts into this.
Our melee attack though is a lot more versatile as we're playing a montage using a tagged montage,
we're now using a montage tag and that's what we're waiting for with our gameplay event.
And we have a separate gameplay tag called socket Tag.
That's what we're using for our jet combat socket location.
So now those are decoupled and now we have multiple attack montages and they're identified and we're
passing in a gameplay tag container that contains that montage tag for the montage.
We're playing for our attack and we're receiving that in our gameplay parameters in the gameplay queue.
So by the time this gameplay queue executes on the client, we're passing that along.
We have that gameplay tag container aggregated source tags that contains the montage tag that we set
in there and we created this nice interface function to perform the lookup to get the correct tagged
montage which contains the impact sound.
And we're playing that.
So now we can have a different impact sound per enemy and it's not hard coded into our gameplay queue
and get tagged.
Montage uses effect causer.
We made that a local variable.
So I'm just going to quickly replace this wire and now I feel a lot better about that.
Excellent job.
So now we know a little bit about gameplay cues and our melee attacks are using them and it looks really
good with our spear goblin.
Excellent.
Great job and I'll see you in the next video.