WEBVTT

00:06.850 --> 00:08.140
Welcome back.

00:08.380 --> 00:14.590
So now that we have an understanding about the order of operations of our modifiers, let's talk a little

00:14.590 --> 00:21.190
bit more about some of these settings, specifically the coefficient and these pre and post multiply

00:21.190 --> 00:22.540
additive values.

00:22.780 --> 00:30.640
You see just being able to multiply, add, subtract or divide an attribute by another attribute isn't

00:30.640 --> 00:31.540
quite enough.

00:31.900 --> 00:40.690
What if you wanted to add to your health a value equal to strength times ten or strength times 0.1 or

00:40.690 --> 00:43.840
strength times 0.1 plus 12.

00:43.870 --> 00:46.720
These are where we can do this kind of thing.

00:46.750 --> 00:49.870
Now I'm going to remove that fourth modifier there.

00:49.870 --> 00:51.280
So we just have the three.

00:51.310 --> 00:56.020
Let's talk about what happens if we start to set those coefficient values.

00:56.200 --> 01:03.220
So the three parameters we're interested in are the coefficient, the pre multiply additive value and

01:03.220 --> 01:05.920
the post multiply additive value.

01:06.280 --> 01:09.560
Let's talk about exactly how these work.

01:09.980 --> 01:12.290
Now we have a modifier.

01:12.320 --> 01:19.850
Let's say it's backed by vigor and its modifier operation is Add and Vigor has a value of nine.

01:19.850 --> 01:24.890
Now an attribute based modifier has these three parameters, right?

01:24.920 --> 01:31.700
Well, the amount added to our health is going to be affected by these three parameters as follows.

01:31.730 --> 01:34.130
Vigor has a value of nine.

01:34.160 --> 01:43.640
We first add the pre multiply additive value, then this result is multiplied by the coefficient and

01:43.640 --> 01:50.600
the result of that has the post multiply additive value added to it, which makes sense.

01:50.630 --> 01:53.750
Vigor is multiplied by a coefficient.

01:53.780 --> 02:01.940
It just happens that we can add a value to vigor before multiplying by that coefficient and then we

02:01.940 --> 02:04.310
can add a value after all that.

02:04.490 --> 02:11.480
So we can add a value before multiplying the coefficient and we can add a value after multiplying the

02:11.480 --> 02:12.500
coefficient.

02:12.530 --> 02:14.600
This gives us some flexibility.

02:14.600 --> 02:17.630
So we have this formula applied right?

02:17.630 --> 02:26.810
And let's say we have a modifier backed by health modifier op add with a coefficient of 0.1, a pre

02:26.840 --> 02:32.740
multiply additive value of two and a post multiply additive value of five.

02:32.750 --> 02:35.420
So what does this modifier return?

02:35.660 --> 02:43.040
Well, first we take the nine and add the pre multiply additive value, which is to the result of that

02:43.040 --> 02:48.250
which is 11 gets multiplied by the coefficient 0.1.

02:48.260 --> 02:52.070
So 11 times 0.1 would give us 1.1.

02:52.610 --> 02:58.240
The result of this then gets the post multiply additive value added to it.

02:58.250 --> 03:03.590
So 1.1 plus five and the result of this is 6.1.

03:03.590 --> 03:05.420
So that's how it works.

03:05.600 --> 03:13.280
So if we have these three modifier hours each with their own modifier operations and backed by different

03:13.280 --> 03:21.800
attributes, all targeting health and we give them each these parameters, then each of them will get

03:21.800 --> 03:28.550
this same formula applied and the result returned from them will be the result of this math.

03:28.910 --> 03:36.380
So let's just say that we want these coefficients and these pre and post multiply additive values for

03:36.380 --> 03:38.180
the modifiers that we have.

03:38.210 --> 03:45.350
If we do have those values and these are the results returned from those modifiers, then we should

03:45.350 --> 03:49.940
expect our health to be added to by 2.2.

03:49.970 --> 03:53.090
The result of this should be multiplied by 19.

03:53.120 --> 03:59.900
The result of this should be divided by resilience, and that should all come out to 7.26.

03:59.930 --> 04:04.760
As long as we use these parameters for each of our modifiers.

04:04.760 --> 04:07.610
So I'd like to make sure that this math checks out.

04:08.000 --> 04:16.560
So as we can see, our first modifier backed by vigor is going to need a coefficient of 0.1, a pre

04:16.610 --> 04:21.300
multiply value of three and a post multiply value of one.

04:21.320 --> 04:23.710
So let's get our first modifier.

04:23.720 --> 04:31.280
We'll expand modifier magnitude, expand attribute based and set the coefficient to 0.1.

04:31.310 --> 04:37.400
The pre multiply additive value to three and the post multiply additive value to one.

04:37.550 --> 04:45.020
Now, according to the math that I did, this should come out to 2.29 plus three is 11.

04:45.170 --> 04:48.110
11 times 0.1 is 1.1.

04:48.110 --> 04:50.960
1.1 plus one is 2.2.

04:50.990 --> 04:54.110
Feel free to double check any of this math if you like.

04:54.710 --> 04:58.250
Now for the next modifier backed by strength.

04:58.280 --> 05:03.550
We want a coefficient of 0.5, a pre value of six and a post value of 11.

05:03.560 --> 05:12.570
So let's open up that second modifier, expand our dropdowns and set the coefficient to 0.5.

05:12.600 --> 05:19.140
Set the pre multiply additive to six and the post multiply additive to 11.

05:19.140 --> 05:21.510
And we see that that should come out to 19.

05:22.020 --> 05:28.770
And for our last modifier, we'll use the values 2.10.5 and 5.7.

05:28.860 --> 05:32.760
So let's expand our dropdowns for our last modifier.

05:33.580 --> 05:42.610
And use 2.1 for the coefficient 0.5 for the pre multiply and 5.7 for the post multiply.

05:42.640 --> 05:49.420
Now as we see the result of all of this should come out to 7.26.

05:49.450 --> 05:51.100
Let's see if that's what we get.

05:51.130 --> 06:00.310
We'll press play, show, debug and overlap and there I get 7.26 just as expected.

06:00.640 --> 06:06.820
So as you can see, we have some freedom when it comes to backing our attributes by other attributes.

06:06.820 --> 06:14.710
And this is quite nice and it gives us a lot of flexibility, although it's not complete flexibility.

06:14.740 --> 06:20.130
We can't just create some arbitrarily complex calculation this way.

06:20.140 --> 06:27.670
To do that, there are other methods available to us in gas that we'll get to soon enough, but this

06:27.670 --> 06:33.280
way, at least we know we can have attributes backed by other attributes, and we're going to learn

06:33.380 --> 06:42.260
in the videos to come how we can have derived attributes which will always be derived from the values

06:42.260 --> 06:43.400
of other attributes.

06:43.400 --> 06:49.700
So when it's backing attributes change, it will change automatically and we'll see how to do that very

06:49.700 --> 06:50.500
shortly.

06:50.510 --> 06:53.480
So excellent job and I'll see you soon.
