Welcome back.
Now, when we press play and we look at our spells, we can see that we have one spell equipped.
Now, one of the things that I want to do is when I level up, I want to see what other spells I'm eligible
to spend points on.
And so that means as soon as I do level up, as in like I'm doing here.
I should be able to open my spells menu and any abilities that have that level requirement equal to
the level that I've just reached should now show as eligible.
We shouldn't see a locked icon for those.
We should see what the icon for that ability is supposed to be.
Now, for that reason, we need the concept of a level requirement for our spells, and I'd like to
keep that in my data asset.
So in content blueprint's ability system data, I have my ability info data asset and I'd like to be
able to set the level requirement for a given ability here.
That way, every time we level up we can check the level requirements for these abilities and grant
those abilities to the player.
If that player now meets those level requirements.
Now, Aura isn't going to have all of her abilities right away.
She only starts with those abilities in her start up abilities array.
So as we add more abilities that she will not start with our ability system component needs to know
what class of ability to grant.
So ability information should also contain a class that the ability system component can retrieve and
then give that ability to aura and set its ability status.
So we're going to add two things to our ability info struct, a gameplay ability class and a level requirement
set and both will be exposed to our data asset.
So let's close the editor.
We'll close all tabs and let's go into our public folder into ability system data and ability info.
Our ability info struct is going to now have a level requirement.
So we're going to add that.
It'll be an int 32, we'll call it level requirement.
It's going to be edit defaults only blueprint read only.
So we'll go ahead and give it that new property.
In addition to that, we need a subclass of this will be for the game play ability, which means we're
going to need to forward declare that class class you gameplay ability.
So let's add this subclass of t subclass of you gameplay ability and this is going to be the ability
itself.
We can just call it ability and this too will get added defaults only and we'll make it blueprint read
only.
So now that we have this level requirement and the gameplay ability class itself, our ability system
component is going to need to know when we level up and when it does, it needs to access ability info.
So we need a nice central place where we can put one of these ability infos that our ability system
component can get it from.
And I'd like to add that to the game mode as that's a nice central place that only exists on the server.
So let's go into the game folder to or a game mode base and we'll add a new object pointer here.
It's going to be T object pointer of type you ability info.
We're going to go ahead and forward declare it and call this ability info.
We'll make it edit defaults only and the category can be just ability info.
Now it exists on the game mode.
I'd like it to be easily obtainable.
I'd like a nice function that can get it in our ability system library.
So let's go to our ability system library.
Now we have already one function that returns a data asset.
It's called get character class info.
We're going to model this new function after this one, so I'm going to copy and paste it and call this
one get ability info.
Its type that it returns will be you ability info.
We'll go ahead and forward declare it.
It'll take a world context object.
Let's go ahead and generate the definition and it's going to be similar to get character class info.
I'm going to copy the contents of that function and paste it here because we do want our A game mode
base.
We're going to get that and check to see if it's Null first.
And if it's not null, we'll get our aura game mode and return the ability info on it.
Now both of these can be made const.
So while I'm at it here, I'll go ahead and make them both const and now we have Git ability info,
which is a very easy to use function.
It exists on our ability system library and we can use that.
Now we can go ahead and just compile and launch the editor and set the level requirement for the one
ability we have in our data asset as well as set the ability info on the game mode.
Okay, I'm going to click open and get that ability info back up.
Now, level requirement is going to have a value of one for our firebolt, which doesn't really matter
because it's one of the startup abilities, but now it's level requirement is set.
And by the way, that's zero because we're not setting it.
We'll get an error if we don't.
So I'm going to set that to a default value of one in C plus plus.
So that's one thing that we need to do.
I'm going to save that.
And the next thing is to go into our blueprints game folder, open our blueprint for the game mode and
set its ability info data asset.
Now we can always access it at least on the server where the game mode exists.
Okay, so we're almost done.
But now that we have a level requirement, we're going to want to check it every time we level up and
then change the icons here.
But to do that, we need other abilities.
We need at least one more ability.
Now, this middle column is going to be for lightning abilities.
So I think I'm going to create a placeholder ability that can go right here for our next ability that
I'd like to show.
Once we become eligible, I'd like to show the eligible icon for it in the next column.
So let's go ahead and make a new gameplay ability.
I'm going to go to Blueprints, Ability System, Aura abilities and make a new folder here called Lightning
and we'll make our first lightning ability.
Let's right click, make a new blueprint and we're going to base this on Aura gameplay ability.
And we'll call this G a underscore and let's choose a cool name for it.
Electrocute.
Electrocute is going to be just a basic gameplay ability.
In fact, we can just print a string for now that says electrocute activated and we can simply use a
delay.
For one second and in the ability.
We'll definitely be making this a real ability.
For now, it's just a placeholder.
But now we actually have a gameplay ability.
Aside from Firebolt.
Now in class defaults, we're going to need a gameplay tag to identify this ability as we only have
abilities.
Fire firebolt and of course attack.
I'm going to want abilities lightning electrocute to add to that and then we can add it to our data
asset.
So let's go ahead and close the editor and add a new gameplay tag in or a gameplay tags.
Let's find our abilities.
Here they are.
Here's my fire Firebolt.
I'm just going to copy and paste it and change this one to abilities Lightning underscore electrocute.
So we'll go ahead and define this gameplay tag.
I'm going to find Firebolts.
That's the cooldown tag.
Here's the ability tag.
I'll copy this one.
And just beneath it we'll paste it.
But this will be abilities lightning electrocute so its tag will be abilities.
Dot lightning dot electrocute.
And the comment will say electrocute ability tag.
Now that we have this tag, we'll compile and go back to the editor.
Okay, so let's go ahead and get everything open again for Electrocutes ability tags.
We're going to add a tag Abilities Lightning Electrocute.
So just like our other ability abilities, fire Firebolt and the Firebolt ability tags contains abilities.
Fire Firebolt.
That's what we use to identify that ability.
Now electrocute is identified with abilities.
Lightning electrocute.
Let's go ahead and save that.
And now here in ability info, we can set up our new ability electrocute.
By the way, aside from level requirement, we also have the ability itself.
Again, Firebolt is one of the start up abilities, so it doesn't matter much, but we can set that
gameplay ability to firebolt there.
And now let's add a new element to ability information.
This will be the next element and we can set its ability tag.
It's going to be abilities, lightning electrocute.
It doesn't have a cooldown tag yet, but we can set its icon now if we search for shock and choose that
we have this texture and if you open it, you'll see that it looks like a lightning bolt.
We're going to use that.
And for the background material, let's actually see what other flowing materials we have by browsing
to fire skill.
BG Here we have an my shock skill.
BG I'm going to select it and choose that one.
And for the level requirement for electrocute, I'm going to set it to two and for the ability I'm going
to set it to a electrocute.
And now our ability info has info for this ability.
Now that means we can go to our offensive spell tree in blueprints ui spell menu.
Offensive spell tree and assign our new electrocute tag to one of these spell globes and it's going
to go into the bottom most globe in the second column.
So here I'm going to search for its ability tag and set that ability tag to lightning electrocute.
So now that one has the electrocute tag.
Okay, so now our abilities have the concept of a level requirement, and every time we level up, we're
going to expect our offensive spell tree to update itself.
And as soon as we meet the level requirements for any of those other abilities in our ability info,
I want to be able to first of all give that ability to aura and then set its status so that we can see
what the icon is supposed to look like.
So we have a few more steps to go, but we're making good progress and we'll continue with this in the
next video.
I'll see you soon.