Welcome.
Now we're just about done with this section, but that doesn't mean we're done with gameplay effects.
There's still a lot to learn and we're going to learn more about them as we incorporate them with the
other elements of gas.
But one last thing I'd like to touch on before we move on from this section is the fact that we've been
using these scalable floats.
Let's go back to one of our gameplay effects.
I'm going to go into our potion folder, into Potion Heal and scroll down to our modifiers where we
have one that changes health by adding and our magnitude calculation type is scalable float.
Now so far we've just hard coded a single value in here, and that may seem that that's all that scalable
float is good for.
But we have this curve table dropdown now.
Yes.
When we click it and expand it, it's empty.
But that's just because we have to make our own curve tables to use here.
And that's what this video is all about.
We're going to make a curve table for our potion heal.
You see, gameplay effects have the concept of level.
Lots of gas elements have the concept of level abilities have levels, gameplay effects have levels.
So the curve table gives us the option to scale our magnitude by some value based on the effects level.
So let's make our curve table.
We're going to go into the potion folder.
We'll just make it right here and we can go to miscellaneous and there it is, Curve Table.
We're going to choose curve table and we can use linear, constant cubic.
And this is just the mathematical function that our curve is going to take on.
For now, let's try linear.
I'm going to create the curve table and I'm going to call this C t for curve table potion, Heal and
Open Up Potion Heal Now.
A curve table is quite simple.
It's sort of like an Excel spreadsheet.
In fact, right up here, there's two different options.
We have the graph view and if we click on that, we can see what the curve looks like as a graph, but
there's nothing there yet.
We still have to make the curve.
But going back to this view, it's more like a spreadsheet.
Now if we click on this triangle here, we see that there's a column and the column has the value one
and it also has a float associated with it.
Now let's just say that when our potion Heal Effect is level one, we want to heal by, say, five.
Okay, let's add another row.
And for two, let's say make this 7.5.
We'll add another one for three.
We'll make it ten for level four.
We'll make it 15 for level five, we'll make it 20.
Level six will make it 30.
Level seven will make it 45.
Eight will make it 60.
Level nine will make it 85.
Ten will make it 100.
Okay, So we basically have this really simple spreadsheet, right?
Well, let's go back into Graph view and select the curve.
Now look at what we've made.
Our curve looks like this, and it's kind of almost an exponential increase.
It's linear, but we chose the values.
So in between, each value is linear.
Right.
So this gives us a curve that we can use for our potion heal.
And if we go back to Potion, Heal and go to the scalable float magnitude, we can use the curve table,
we can open the dropdown and there's a potion heal now.
Now here for scalable float magnitude, we can select a curve because a curve table can have multiple
curves.
As you can see, we can add a new curve by hitting the plus curve icon there.
But so far this just has one curve.
We can rename the curve, for example, we can call this healing curve.
Let's save that.
And back here in the gameplay effect, when we go to select the Curve, there's our healing curve.
We're going to select our healing curve.
Now we can preview the value that we would get right here based on the level and we can go all the way
up to level ten because that's how far our curve goes for healing curve.
So at ten.
The reason we're getting 2500 and if we go back down to one, we're getting 125 is because this value
that we put right here is scaled by the value on the curve for that level.
So at level one, our curve has the value five, So it's taking 25 at level one and multiplying by that
curve value five So if we want these literal values here, then we'd have to stick a one right here.
And then at level one, we have five.
At level two, we get 7.5.
Basically those numbers that we put into our curve.
So that's what this little preview slider is good for.
So we know that our potion is applying our instant gameplay effect at level one, right?
So we can press play and we should be able to pick up a health potion and we'll see an increase of five
for our health.
So our health is at 50 picking it up now it's at 55, right?
Pretty simple, but what if we'd like our health potions to have their own sort of concept of a level?
What if we want our effect actor to have a level itself and then it'll apply all of its gameplay effects
at that level?
Now you could have multiple levels one for each duration type.
There's no end to the complexity.
You can make these things, but I'm going to just say that our Effect actor has its own level.
We'll call it an actor level, and that's a variable that I'd like to add to the effect actor in C plus
plus.
So I'm going to save all close out of the editor and go back to my effect.
Actor I'm going to open up the actor folder and Ora effect.
Actor And I'm going to add a new variable.
Now these are all protected and I think the actor level can also be protected.
So I'm going to stick it down here at the bottom.
It's going to be a float.
So I'm going to call this float actor level.
And I'd like it to be added anywhere.
Blueprint Read only category Applied Effects.
So we're sharing that new property.
Okay, now I'll give it a default value of one point F, so if we want we can have non discrete values
like 1.5 for example, and that makes it more versatile.
Now our actor level should be used when applying a gameplay effect, so control o or alt o will open
our effect.
Actor wkRP and we can go to apply effect to Target where we're applying our effect and we're applying
the gameplay effect spec, right?
And when we called make outgoing spec, we passed in a level here, right?
And level is a float perfect instead of just hard coding one we're now going to pass in the actor level.
Now we can go into the blueprint and change the level and make our potion or whatever type of effect.
Actor more or less powerful based on the level.
Perfect.
Let's hit debug and we'll change the levels of some of our potions and see how they work.
Okay, I'm going to click open.
That's just going to bring up my potion Heal curve table and I'm actually going to open my BP health
potion.
Let's get that open and let's see if we can find that actor level.
Here it is.
And it's set to one.
You know what?
That's fine.
I'd like to drag in a couple of these next to each other, each at different levels.
So the default value is one.
So that's going to be at one.
I'm going to copy one and this one I'm going to set its actor level.
Let's set that to two.
Let's copy another one.
We'll set this 1 to 3 and why not?
This fourth one can be 4.75 because these don't have to be integers.
So let's test this out.
I'm going to press play.
I'm going to show debug ability system.
I'm at 50 Health, I'm going to pick one up and I get five more.
So I'm at 55 picking up another one.
Oh, look at that.
I'm at 6250.
I got 7.5 added picking up another one.
I'm at 7250.
Looks like I got ten added.
Now this one I'm going to pick up and I'm at 91.25.
So because this one has a level of, what was it, 4.75, then if we take a look at our curve for healing
curve and find 4.75, it's somewhere right here between these two vertical lines.
Then we're here, which is about 18.5 or so on the curve.
So it's going to get this interpolated value between these two points.
That's how we can have values in between the discrete numbers, which is pretty cool if you ask me.
Now, here's the cool thing.
We know that our potion Heal Curve table can have multiple curves, right?
Well, why can't we just use one curve table for all of our potions?
So that's kind of what I'd like to do.
And that means I'd like to rename my potion Heal Curve table to just KT potion, and then we can use
it for any potion effects we want.
And I'd like to have a curve in here for mana.
I'd like to have a mana curve and that's going to be your quest.
I'd like you to make the mana curve.
Go ahead and add it to our KT potion curve table and you're going to choose values for the levels one
through ten.
You can go higher if you like, but make at least that much of the curve and use it in our gameplay
effect potion mana.
And after that, drag some in the level, change the actor level for those potions and play test, pause
the video and make your mana curve now.
Okay.
So all we need to do is add a new curve to our curve table.
So I'm going to click plus curve and this new curve we can rename and I'm going to call this man a curve.
Okay, so we just need to decide what values we should have, at what levels.
I like to go to the spreadsheet view here, and as you can see now, we have an additional row here
for man a curve, and it's using the same columns, so something to be aware of.
Now at level one, I'd like to get, say, 2.5 mana.
At level two, we'll make it five at level three, let's make it 8.5.
These are just arbitrary.
At level four, 12.75 at level five we'll make it 18.
Six will make it 26 at level seven will make it 38.
Level eight will make it 65.
Nine can be 85 and ten can be 120.
That escalated quickly.
Let's go back to Graph View and take a look at the mana curve and we can scroll out and we can also
right click and move around and scroll to zoom in.
Now looking at them from this point of view is nice because we can see sort of irregularities.
If we wanted a more smooth curve, we can adjust.
I can move this point down by clicking and dragging on it until it's looking a little bit more smooth.
We can only drag it up or down.
We can't go left and right, and that can make our curve look a little bit more like something like
a mathematical equation if we want and we can select between the two curves and change them if we want
to do that.
So that's just kind of a nice thing we can do and we can always go back to the spreadsheet view and
see what those values look like.
Okay, so we have Man a curve.
I'm going to go into my gameplay effect potion mana, scroll down to the modifier and for my scalable
float I'm going to change it from 30 to 1 and then use a curve table KT potion and select the curve
from it.
We're going to use mana curve and we can use the slider to see what it looks like at various levels.
Great.
So now that we've taken care of that, we can test our mana potion at various levels.
I'm going to take this one.
I know it's level one, but I'm going to copy it and change its actor level to two, not 23, but two.
I'm going to copy it again.
Put this one at say four and copy it again.
And this one can be 6.78 and we can play test.
So showing the debug my mana is at ten now it's at 12.5, 17.5, 30.25 and 50.
And that's because it probably went above 50.
But then thanks to pre attribute change and the attribute set we have been clamping, So if it goes
above that maximum, it gets clamped.
So we're good and safe there.
We don't have to worry about going above.
All right, excellent.
So now we know about curve tables and how they can store multiple curves and we can use the curve tables
in gameplay effects for our scalable floats.
And now the word scalable makes more sense, doesn't it?
Scalable float.
It's scaled by the curve table based on the gameplay effects level.
So scalable float is a lot better than just hard coding a constant value, isn't it?
It's actually quite nice because we can make our gameplay effects data driven and thanks to these handy
curve tables we can see the trends for those data driven values which is actually quite awesome.
Okay, excellent job in this section and I'll see you in the next one.