Welcome.
Now our spell menu has quite a bit of information in it.
For one, it has offensive abilities and passive abilities, and these spell trees are going to display
information that kind of depends on the context.
For example, we may have nine different abilities, but our character may not have gotten those abilities
yet.
It may not have been granted them.
Now, the way that we get those abilities would be to level up and gain spell points and spend spell
points to unlock those abilities.
So for that reason, we need the concept of an ability status.
An ability status can be one of several states that tell us what we can do with an ability and what
we can't.
For example, when we open the spell menu, do we show a locked icon or do we actually show the ability
icon?
And if we show the ability icon, does that mean we can use it?
Can we equip it and so on?
I'd like to have four main options for ability status.
The first is locked and that's the most obvious.
Our spell menu shows the locked icon.
We can't even see what that icon is supposed to look like.
The next status is eligible.
Now, as soon as we level up, we may now meet the level requirements for some of our abilities that
were previously locked.
So each ability is going to have its own level requirement and it will remain locked until the player
has reached that level.
As soon as the player reaches that level, then any abilities that the player now meets the level requirements
for will change from the locked icon to something else.
I'd like to show the actual icon of that ability, but I still want the background to be grayed out.
So this is what the eligible status looks like.
So an eligible ability is one for which we meet the level requirement, but we have not yet spent any
spell points on it to unlock it.
As soon as it's eligible, we can then spend spell points on it.
And if we spend a spell point on it, we can unlock that ability, at which point the icon will now
show the color corresponding to that abilities icon.
At this point, the ability is now unlocked.
We have spent at least one spell point on it and we can now equip it.
Now, that doesn't mean it's equipped yet.
We are going to manually equip these abilities because we want to choose which input to assign it to.
So we can select the ability, hit the equip button and then choose the input from our equipped abilities.
Row at the bottom so that row down there is not just cosmetic, it's functional.
Now, as soon as we equip one of our abilities, it will now be in the equipped state.
That means it's assigned to one of our inputs.
And in the game, if we press those inputs, we'll activate those abilities provided we can pay their
mana costs.
So the unlocked and the equipped ability statuses will have icons that show what the actual ability
icon is supposed to look like.
In the case of Firebolt, we have this little fireball and the background is orange.
That's what we'll see in the offensive abilities spell tree.
And if it's equipped, it will also appear down in the equipped abilities row.
So because our abilities can be in one of these four statuses, we're going to need some gameplay tags
to identify that status.
Each ability is going to need a status ability tag.
We're going to need a locked ability tag, an eligible tag, an unlocked tag, and an equipped tag.
And these can change at runtime and in fact, they will.
So these belong in an ability specs dynamic ability tags, container.
So we're going to have to program the capability to add and remove these tags so that our gameplay ability
specs for our activatable abilities will always keep track of what status they're currently in.
Now for the spell menu.
As soon as we've broadcast information to it, we need to know whether or not that ability is passive
or offensive, as those are the types of abilities we're showing in our spell menu.
So we also need gameplay tags to identify an abilities type.
Is it an offensive ability, a passive ability or neither?
So we can have three different gameplay tags used to distinguish abilities.
You see, an ability may not be either offensive or passive, in which case it doesn't belong in the
spell menu at all.
These can be basic abilities like hit, react, death, and so on.
For this reason, I'd like to distinguish between those generic abilities and our offensive and passive
abilities, which I'll refer to as spells.
So our spells are abilities that we see in the spell menu, offensive and passive abilities, but are
non spells.
Those will be things like hit, react death.
We also have a listen for events ability which listens for gameplay events.
Right?
That's not a spell, it's just a passive ability that does something we need to do.
It's always going to be active and we don't need to show it in the spell menu.
So now we have a plan and we need to add some more gameplay tags to our native gameplay tags.
Singleton And we also need to make sure that as soon as we equip our startup abilities that they have
their status set to equipped.
So let's do that now.
Here's our ora gameplay tag Singleton.
We now need a few more tags.
We're going to put these tags next to our other ability tags.
We should only have one of them.
And actually we have two abilities attack and abilities summon.
And while I'm here I'm remembering that we had this effects hit react that we're using for the enemy
hit react.
We're sending a gameplay event from the attribute set.
We're sending an event with this particular tag that will trigger our enemies, hit, react and then
our enemy hit react Gameplay ability is using this effects hit react.
I'd like to make an abilities hit react and use that instead so we'll make that while we're at it.
So first I'm going to make a new gameplay tag called Abilities Hit React.
We'll separate these from the ones that have already been defined.
Now, in addition to that, we're going to need our statuses, so we're going to have an gameplay tag
called Abilities Underscore status Underscore locked.
We'll also need status eligible.
We'll need status unlocked and we'll need status equipped.
We're also going to need ability types.
So we're going to have abilities.
Type.
Underscore offensive.
Go ahead and copy that.
We'll need abilities type passive.
And abilities type None.
So we have eight new tags to make.
Let's start with hit, react and do statuses and types.
So here in the abilities, I'm going to copy this one, paste it and this will be abilities hit react.
The tag will be abilities dot hit react.
The string will say hit, react, ability.
Now we need our ability statuses.
So this will be abilities, status and we'll start at the top with eligible F name will be abilities
dot status dot eligible.
It'll say eligible status for the string and we'll copy this.
Next we'll have status equipped F name will be equipped.
F string will say equipped.
Two more statuses.
Next one is locked.
So we'll change the name and the F string.
And the last one.
Which will be unlocked.
And again, changing the name and the F string.
Now we need to do our types, so I'm going to time lapse this one.
Okay, so we have our ability types and our ability statuses.
The last thing we need to do in this video is make sure when we give our startup abilities that we set
that status to equipped.
We do this in the ability system component so we can go into ability system component, our aura version.
And search for where we're giving ability so we can control f give ability.
We're doing this and add character abilities.
Now notice what we're doing an Add character abilities.
We are adding a dynamic ability tag our startup input tag before we call give ability.
Now, what we also need to do is give the tag for its status.
And if we're giving the ability, we know that it's already going to be equipped.
So these are the equipped abilities that we start off with.
So we're going to have ability spec dot, dynamic ability tags, dot add tag, and the tag we're going
to add is going to be from for a gameplay tags.
So we'll use for a gameplay tags get and it's going to be abilities status equipped.
So the dynamic ability tags will be able to keep track of whether or not the ability is equipped and
it'll be handy to have a function that can return that status based on an ability spec.
So let's make a function for that.
I'm going to go into our ability system components and add a public function that returns a gameplay
tag that gets the status from a gameplay spec.
This can be a static function and it's going to return an gameplay tag and we'll call this get status
from spec.
So this can take in a const gameplay ability spec reference.
And it will return that status.
Let's generate the definition.
And what it's going to do is loop over the dynamic ability tags.
So we're going to have a for loop and we'll say for F gameplay tag status tag and we're looping through
the ability specs, dynamic ability tags, and we'll check to see if that ability tag matches.
We're going to say if status tag dot matches tag and we want to match not exact, we want to match abilities
dot status.
So we're going to say F gameplay tag and we're going to call request gameplay tag using the name of
abilities dot status.
So if dynamic ability tags contains a tag, at least one that starts with abilities status, we can
return that status tag.
Otherwise we'll return an empty gameplay tag.
So basically this line here.
So now we have a handy static function that can always get the status from the ability spec if we have
one.
That'll be useful in the future.
Now we have to remember that a gameplay ability should only have one status tag at a time.
It doesn't make sense for it to have the equipped status and the locked status simultaneously.
So once we set the statuses, we'll need to make sure to handle removing the old status tag before adding
the new status tag.
Now notice too, that we added some types.
We have types offensive, passive, and none for our abilities.
We'll make sure to handle that when the time comes.
But for now, this is good.
We now have an ability status that we can check.
I'm going to go ahead and compile.
Make sure we have no errors and build succeeded.
Excellent job and I'll see you in the next video.