Welcome back.
Now we have a functional summoning creature.
Our shaman.
But obviously, we have some issues with this, right?
Our shaman is clearly spawning way too many creatures.
And of course, the visual aspect of this, there might be some things we want to polish up so it looks
a little bit more attractive when they pop in rather than just appearing like that.
But for now, we need to fix this issue where we're summoning way too many minions.
We need to have some kind of a minion count, some kind of threshold.
Now we're summoning because our summon ability has its ability tag and we can see what that tag is by
going to blueprints, ability, system, enemy abilities, and we can go to summon ability.
And this ability has ability tags and we've given it abilities dot attack.
Now I'd like to have an abilities dot summon so that we can distinguish between these two because we
may wish for our shaman to be able to attack with fireballs and summon depending on the situation,
such as how many minions are currently spawned for that given shaman.
So step one is I'd like to create an abilities dot summon gameplay tag.
So let's go ahead and close our editor.
And we'll go into Ora gameplay tags.
So in the public section or a gameplay tags and we have our abilities tags right here, abilities attack.
I'm going to make another gameplay tag called Abilities underscore Summon and we'll go ahead and create
that and or a gameplay tag scope.
Let's find a tag.
We'll go ahead and copy it.
And just beneath it we're going to paste and change it to abilities summon.
The name will be abilities summon and the F string will be summon ability tag.
So that's the first thing I'd like to do.
Now I'd also like a minion count and we could subclass our aura enemy class into the different character
classes.
But I don't want to do that.
I'd like any of my characters to have a concept of minions because a character having a pet or a minion
is an ability that I think just about every character should at least have the concept of.
That way, our player controlled character could have its own pet or set of pets or minions.
So I'm going to go to character or a character based H and we're going to add to our character base
class A minion count.
So let's put this in the protected section.
We'll go all the way down to the bottom.
We'll have a multi-line comment that says Minions.
And by the way, this doesn't have to be a multi-line comment.
This is just style preference of mine for making it a little flashier, a little bit more noticeable.
And I'm going to add an int 32 called Minion Count.
Now we'll set this to zero by default, and rather than exposing it to the event graph with blueprint,
read only, for example.
Instead, what I'd like to do is make an interface function to get this minion count.
That way we don't really even need to cast to or a character or an enemy or something like that.
All we have to do is call the interface function.
So I'm going to go into Interaction combat interface and we'll make another blueprint Native event,
blueprint callable, and this will return our minion count.
So I'm going to copy and paste, get tagged montage by tag and instead of an f tag montage it's going
to return an int 32.
It's going to be called Get Minion Count and it's going to take zero input parameters and we'll go ahead
and override this in a character base up here with our other combat interface functions, we're going
to have virtual int 32 get Minion count implementation override and it'll just return minion count.
So return minion count.
Okay, so now our characters have a concept of minion count and we have a summon tag and our combat
interface has get minion count.
And this allows us to really easily get the minion count.
When we have any actor write any object that we want to check.
So I'm going to compile and launch.
Okay.
Back in the editor.
I'm going to get my summon ability back open.
And remember, our ability tag is abilities attack for this.
That's why we're seeing this get activated.
But I'm going to remove abilities, attack and instead add abilities summon.
And now this ability is its own thing.
It's not really considered a attack ability, it's a summon ability.
So I'm going to compile that.
Now, what happens when we change that ability tag?
Well, we're not going to see it activated anymore.
We're going to see that our enemy doesn't actually have the ability to summon.
I mean, it does have the summon ability, but it cannot activate it.
Nothing is activating it.
Now, let's see exactly why that is.
We know why when we go to Blueprints I behavior tree and we open enemy behavior tree.
And if we're arranged attacker which our elementalist is, we'll reach beat attack this behavior tree
task.
And if we open beat attack, then we'll see what we're doing here.
When we reach this task, we see that we're trying activate abilities by tag and we're using attack
tag and that is abilities attack.
Right?
So as long as this is abilities attack, we're not going to try activate abilities with abilities summon,
are we?
So that's something to be aware of.
Now we could come in here and check that minion count and say, well, if it's less than say, two,
then activate the summon ability.
But that doesn't have anything to do with any of the other types of enemies, right?
Beat attack is not really made for specifically the elementalist.
But here's the cool thing.
Our behavior tree is a variable that we set on the character.
If we go into our shaman, for example, and we right click on Shaman, edit Shaman and we search for
Behavior Tree, we see that we've got our behavior tree set to beat Behavior Tree.
This is set for the specific character, right?
We just all happen to be sharing the same behavior tree, all of us enemies, right?
So if we want, we can make a behavior tree specific to the shaman and call the shaman specific behavior
tree task attack.
We can make one for the shaman.
And then it can do things like check the shamans minion count, and if it's minion count is low enough,
then it should spawn more minions.
And if it's not, then it should activate the attack ability and so on.
So that's what we're going to do in the next video.
We're going to make a behavior tree specific to the shaman class and we'll do that next.
I'll see you soon.