Welcome back.
So we need an incoming exp meta attribute.
You're going to add this to the attribute set.
Now this is a meta attribute.
So remember, there are a lot of steps that you don't have to worry about for meta attributes.
They're not replicated and so on.
So take a look at how we handled our other meta attribute that we created.
And I'd also like you to handle changes to incoming exp.
For now, just put a log.
Now we're not going to test this as we have not yet started changing exp, but just get things set up
in the attribute set.
So set it up so that if incoming exp were to change you could see that change in the output log.
So pause the video and add the meta attribute.
Now.
Okay, so we need to go to our attributes set.
I'm going to go ahead and close all tabs and open my ability system folder, open aura, attribute set,
and we're going to add a new attribute.
Now I'm going to find my other meta attribute.
I have incoming damage.
We're going to have incoming XP so it can go right here.
I'm going to go ahead and just copy the lines for incoming damage and paste them just beneath it.
Now the category can be meta attributes, it can be blueprint read only.
It's a gameplay attribute data struct, but it's going to be incoming XP, not incoming damage.
But we can create our attribute accessors for it.
So we'll keep that line as well.
Now that's it.
We've created our meta attribute job done, except we're going to go ahead and set ourselves up to respond
to changes and that's going to be in the CPP file here in post gameplay effect execute.
We can go ahead and place an If statement to check to see if our evaluated attribute is our incoming
XP.
So I'm going to copy this.
If statement.
It's nice and small, I'm going to paste it down here at the bottom, but change my getter to get incoming
XP attribute and we'll just place a UI log here.
UI log.
We can use log ora.
We'll make it a log for now and just say incoming XP.
Percent f and we'll use get incoming XP.
Now, that reminds me, I think I had a log up here that we don't care about anymore, so I'm going
to go ahead and remove that.
And now we have our clamping for health and mana, our handling of incoming damage, and of course,
our handling of incoming exp.
Pretty soon I'm going to want to refactor my handling of different attribute changes, but for now we're
going to leave it be.
Now, with incoming meta attributes, the practice is to store that meta attribute locally and then
set its value to zero and then do with that value what you will.
So what we could do here, just to really get ourselves prepared for when we're going to use this,
is we can make a const local float called local incoming exp and set it equal to get incoming exp.
And then set our incoming exp to zero.
So set incoming exp passing in zero.
So we're zeroing it out and then what we can print is local incoming exp here.
And in fact, we'll probably place an If check to see if it's zero before doing anything serious.
But for now, we just have the log.
Now, again, we can't test this because we're never actually setting incoming XP.
That's what we're going to do in the videos to come.
But now we have our meta attribute.
We're now ready to start using it and we'll do so soon.
I'll see you in the next video.