Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,256 --> 00:00:04,864
We've got quite a chunk of work done on the visual presentation of our game
2
00:00:05,376 --> 00:00:08,960
But before we continue with that work because we still have a lot to do
3
00:00:09,216 --> 00:00:12,800
What's the add some more content in what I'm thinking we can do is add
4
00:00:13,056 --> 00:00:14,080
Couple of up
5
00:00:14,336 --> 00:00:15,872
For our existing abilities
6
00:00:16,384 --> 00:00:18,944
And what I want to do is I want to do a damage
7
00:00:19,200 --> 00:00:20,480
So I want to
8
00:00:20,992 --> 00:00:22,528
Add maybe like a
9
00:00:22,784 --> 00:00:26,880
Certain percent damage increase for the acts as well as the sword
10
00:00:27,136 --> 00:00:30,464
Now we're going to end up with a tricky situation because
11
00:00:30,976 --> 00:00:31,488
We
12
00:00:31,744 --> 00:00:32,256
Could
13
00:00:32,512 --> 00:00:33,792
Or the player weather
14
00:00:34,048 --> 00:00:36,864
Might not have the axe ability
15
00:00:37,120 --> 00:00:40,192
So we can't just blindly select
16
00:00:40,448 --> 00:00:41,984
The axe upgrade
17
00:00:42,496 --> 00:00:47,872
For the player right so we can handle all of that in this lesson and let's get started so
18
00:00:48,128 --> 00:00:49,920
The first thing you want to do is go to our
19
00:00:50,176 --> 00:00:52,480
Resources in an upgrades
20
00:00:52,736 --> 00:00:53,248
An
21
00:00:53,504 --> 00:00:56,576
We're going to just a duplicate one of these so let's say
22
00:00:56,832 --> 00:00:58,112
Duplicate the sort of
23
00:00:58,624 --> 00:01:00,397
And let's call it sorted underscore
24
00:01:00,399 --> 00:01:02,747
Subtitled by
online-courses.club
We compress knowledge for you!
25
00:01:02,748 --> 00:01:01,440
Damage
26
00:01:02,208 --> 00:01:02,976
What duplicate that
27
00:01:03,232 --> 00:01:04,768
Garden double click the sword down
28
00:01:05,280 --> 00:01:08,096
Change the ID it's very important that you change the ID
29
00:01:08,352 --> 00:01:09,120
Two sword
30
00:01:09,376 --> 00:01:09,888
Damage
31
00:01:10,400 --> 00:01:16,288
And then the max quantity let's just said that to 0 which means that we can have an unlimited number of
32
00:01:16,544 --> 00:01:17,056
Is upgrades
33
00:01:17,312 --> 00:01:20,640
Animal World change this name to sword damage
34
00:01:20,896 --> 00:01:22,944
Analisi increases sword
35
00:01:23,456 --> 00:01:24,224
Damage
36
00:01:24,480 --> 00:01:24,992
Bye
37
00:01:25,248 --> 00:01:27,552
Let's do 15% that sounds good to me
38
00:01:27,808 --> 00:01:33,696
Alright and then let's Create one for the acts as well so I'm just going to duplicate this or damaged by right-clicking duplicate
39
00:01:33,952 --> 00:01:36,768
You can also press ctrl d to duplicate cell
40
00:01:37,280 --> 00:01:38,048
Control
41
00:01:38,304 --> 00:01:41,376
And then I'm going to call this x underscore damage
42
00:01:42,144 --> 00:01:42,912
Duplicate
43
00:01:43,168 --> 00:01:47,776
Double click into your extension and replace all of the references to sword
44
00:01:48,032 --> 00:01:49,056
Axe damage
45
00:01:49,312 --> 00:01:52,384
Ask damage and again will keep the maxquant the
46
00:01:53,152 --> 00:01:54,944
And let's change this one
47
00:01:55,456 --> 00:01:57,504
To slightly lower because the axe
48
00:01:57,760 --> 00:01:59,552
Can damage multiple enemies at a time
49
00:01:59,808 --> 00:02:01,088
So we're gonna turn this down
50
00:02:01,344 --> 00:02:01,856
Tenpin
51
00:02:02,368 --> 00:02:06,208
Ok let's open up the script for upgrade Manager by clicking into
52
00:02:06,464 --> 00:02:09,536
And we have our upgrade pool up here
53
00:02:09,792 --> 00:02:12,352
Which is going to be a little bit problem at
54
00:02:12,864 --> 00:02:15,168
And why is it going to be problematic because again
55
00:02:15,424 --> 00:02:17,472
If we randomly choose
56
00:02:17,728 --> 00:02:18,752
What's the
57
00:02:19,008 --> 00:02:20,288
Damage upgrade
58
00:02:21,312 --> 00:02:23,872
We may not have the axe yet and it doesn't
59
00:02:24,128 --> 00:02:24,640
Make sense
60
00:02:24,896 --> 00:02:26,688
So what I'm going to do is I'm good
61
00:02:26,944 --> 00:02:28,224
To actually
62
00:02:28,480 --> 00:02:34,624
Use that waited a table that We Created a couple of lessons ago and we're use that for upgrade pool
63
00:02:34,880 --> 00:02:35,392
Instead
64
00:02:35,648 --> 00:02:36,928
Let's get rid of this upgrades
65
00:02:37,696 --> 00:02:42,048
Analyst create under our current upgrade let's create a upgrade
66
00:02:42,560 --> 00:02:43,072
War
67
00:02:43,328 --> 00:02:44,608
Variable a new one
68
00:02:44,864 --> 00:02:45,888
And it's going to be over
69
00:02:46,144 --> 00:02:49,472
Where did table and then we'll send it to Waiting table that
70
00:02:49,728 --> 00:02:51,008
New Lakeside
71
00:02:51,776 --> 00:02:52,800
Ok so now we've got
72
00:02:53,056 --> 00:02:55,104
A table instead of
73
00:02:55,360 --> 00:02:57,408
Our array that we export
74
00:02:57,920 --> 00:03:01,504
And we need to preload all of our upgrade
75
00:03:02,016 --> 00:03:04,064
So I'm going to go and create a new line
76
00:03:04,320 --> 00:03:06,880
I'm just going to say ok let's call it
77
00:03:07,136 --> 00:03:07,648
Ask
78
00:03:07,904 --> 00:03:09,696
Upgrade is he good to
79
00:03:09,952 --> 00:03:12,000
Reload and I'm just going to
80
00:03:13,280 --> 00:03:15,584
Preload basically all of the upgrades that we
81
00:03:16,096 --> 00:03:17,888
Solve our x upgrade is equal to
82
00:03:18,400 --> 00:03:20,704
Ask damage is equal to preload
83
00:03:20,960 --> 00:03:24,544
And then you can just start riding act damage and that will be
84
00:03:25,056 --> 00:03:30,688
Pre-loaded again make sure you're loading it from the upgrade directory don't want to accidentally load something that's not
85
00:03:30,944 --> 00:03:32,224
An upgrade resource
86
00:03:32,480 --> 00:03:34,528
Save our sword
87
00:03:35,040 --> 00:03:36,576
Is he good to preload
88
00:03:37,088 --> 00:03:37,600
And then you can
89
00:03:37,856 --> 00:03:42,208
Type sort underscore rate and select the one that is in the resources
90
00:03:42,464 --> 00:03:44,000
And then very sore
91
00:03:44,512 --> 00:03:45,024
Damage
92
00:03:45,280 --> 00:03:45,792
Is he good
93
00:03:46,304 --> 00:03:47,072
Preload
94
00:03:47,328 --> 00:03:47,840
RAS
95
00:03:48,352 --> 00:03:49,120
Or we can
96
00:03:49,376 --> 00:03:50,400
Type sword Den
97
00:03:50,656 --> 00:03:51,168
To get
98
00:03:51,424 --> 00:03:52,704
The autocomplete search
99
00:03:53,984 --> 00:03:56,544
Ok so what items do we want to add
100
00:03:58,080 --> 00:03:58,848
Sauna ready-made
101
00:03:59,104 --> 00:04:01,152
I'm gonna above this connect
102
00:04:01,664 --> 00:04:02,432
Lying here
103
00:04:02,944 --> 00:04:03,968
I'm going to say
104
00:04:04,224 --> 00:04:05,248
Upgrade pool
105
00:04:06,784 --> 00:04:07,808
IPad Air
106
00:04:08,320 --> 00:04:09,600
And we're going to put in
107
00:04:09,856 --> 00:04:10,368
The
108
00:04:11,136 --> 00:04:11,648
Ask
109
00:04:12,160 --> 00:04:14,208
And I'm going to before we go any further
110
00:04:14,464 --> 00:04:18,047
I'm going to change the naming of this a little bit so
111
00:04:18,815 --> 00:04:23,679
Instead of axe upgrade which I wrote up here and act damaging sword Greatsword damage
112
00:04:24,191 --> 00:04:30,335
I'm going to change all these to have a prefix of upgrades underscores I'm going to get rid of this underscore upgrade in the
113
00:04:31,103 --> 00:04:32,383
Online nine hair
114
00:04:32,639 --> 00:04:34,175
Then I'm going to select
115
00:04:34,431 --> 00:04:36,479
At the beginning of the acts with my cursor
116
00:04:36,735 --> 00:04:37,759
I'm going to hold up
117
00:04:38,271 --> 00:04:42,111
So hold the alt key down and then click at the beginning of each
118
00:04:42,367 --> 00:04:43,135
Variable
119
00:04:43,903 --> 00:04:46,463
And I will create a multiline cursor
120
00:04:46,719 --> 00:04:48,511
And with that everything that we type
121
00:04:48,767 --> 00:04:50,047
Is going to be
122
00:04:50,815 --> 00:04:53,375
Duplicated across all those lines and so I'm just going to
123
00:04:53,631 --> 00:04:55,679
Right upgrade underscore
124
00:04:56,703 --> 00:04:58,239
Prefix all of those like that
125
00:04:58,751 --> 00:05:00,031
Just for consistency
126
00:05:00,287 --> 00:05:02,079
Ok so with that out of the way
127
00:05:02,335 --> 00:05:03,615
Let's add an item
128
00:05:03,871 --> 00:05:05,407
What's a upgrade axe
129
00:05:06,687 --> 00:05:08,223
And then we'll say
130
00:05:08,479 --> 00:05:08,991
10
131
00:05:09,247 --> 00:05:11,039
I want to see the weight of 10 Furbies
132
00:05:11,295 --> 00:05:13,087
Channel is due upgrade Poole
133
00:05:14,623 --> 00:05:16,415
Now if you wanted to be sophisticated
134
00:05:16,671 --> 00:05:19,487
You could add another method in our wedding table
135
00:05:19,743 --> 00:05:22,815
Set alarms you to add a whole array of items with the same
136
00:05:23,071 --> 00:05:24,351
But we're not going to go that far
137
00:05:24,607 --> 00:05:26,399
So I'm going to do upgrade
138
00:05:26,655 --> 00:05:27,679
Sword red
139
00:05:28,447 --> 00:05:30,751
10 and then upgrade pool
140
00:05:31,263 --> 00:05:32,543
Start
141
00:05:32,799 --> 00:05:34,335
Upgrade sword
142
00:05:34,847 --> 00:05:35,359
Damage
143
00:05:35,615 --> 00:05:36,127
10
144
00:05:36,639 --> 00:05:40,991
For adding all the upgrades to upgrade but except for the accent
145
00:05:41,503 --> 00:05:42,783
And you'll see wireless
146
00:05:43,295 --> 00:05:43,807
Ok
147
00:05:44,063 --> 00:05:46,879
So in a reply upgrade matter what needs to happen well
148
00:05:47,391 --> 00:05:53,535
Let's think about this so when do you want the player to be able to choose the axis
149
00:05:53,791 --> 00:05:54,815
Image as an up
150
00:05:55,327 --> 00:05:59,679
Well only after we've actually received the accessibility
151
00:06:00,191 --> 00:06:02,495
So in our apply upgrade
152
00:06:02,751 --> 00:06:07,103
We can actually modify our upgrade pool at run
153
00:06:07,359 --> 00:06:08,639
While the game is running
154
00:06:08,895 --> 00:06:10,687
To update it with new ID
155
00:06:12,223 --> 00:06:16,575
And so we can write that code in the apply upgrade but I'm actually going to create a new function
156
00:06:17,087 --> 00:06:17,855
I'm going to say
157
00:06:18,367 --> 00:06:18,879
Funk
158
00:06:19,135 --> 00:06:19,903
Update
159
00:06:20,415 --> 00:06:21,183
Upgrade
160
00:06:22,207 --> 00:06:23,743
And then it were going to say
161
00:06:24,511 --> 00:06:28,863
Let's let's Create another argument or a premier account chosen upgrade
162
00:06:29,631 --> 00:06:30,399
And will
163
00:06:30,655 --> 00:06:32,447
Ability upgrades as a type of there
164
00:06:32,959 --> 00:06:34,751
And then we'll
165
00:06:35,007 --> 00:06:37,055
Start writing at this method so
166
00:06:37,311 --> 00:06:39,359
What do you want to do we want to say yes
167
00:06:40,127 --> 00:06:41,151
Chosen upgrade
168
00:06:41,407 --> 00:06:42,431
Dart ID
169
00:06:42,687 --> 00:06:43,967
Is equal to
170
00:06:44,223 --> 00:06:46,015
And what is your ACS ID
171
00:06:46,527 --> 00:06:49,855
Are exid is simply just ask so I can do ask
172
00:06:50,367 --> 00:06:54,719
And even better instead of writing a string in here I already have a reference
173
00:06:54,975 --> 00:06:56,511
To my upgrade
174
00:06:57,535 --> 00:06:58,303
Here right
175
00:06:58,559 --> 00:07:02,399
So I can say if chosen upgrade that ID is equal to upgrade
176
00:07:02,655 --> 00:07:03,423
Ask
177
00:07:03,679 --> 00:07:04,703
I D
178
00:07:04,959 --> 00:07:05,983
Then that means
179
00:07:06,239 --> 00:07:07,775
The axe has been charged
180
00:07:08,031 --> 00:07:08,543
Right
181
00:07:08,799 --> 00:07:14,431
And technically what I can do is I can even just do this and see if these resources
182
00:07:14,687 --> 00:07:15,711
Are equal to
183
00:07:15,967 --> 00:07:16,479
Each other
184
00:07:16,735 --> 00:07:18,271
So you can use any phone that you were
185
00:07:18,527 --> 00:07:20,063
I like to use ID
186
00:07:20,319 --> 00:07:21,087
Because
187
00:07:21,599 --> 00:07:23,135
There could be situations where
188
00:07:23,391 --> 00:07:24,415
You may be
189
00:07:24,671 --> 00:07:29,023
Duplicating a resource which breaks the reference right so if I did this
190
00:07:31,071 --> 00:07:32,863
If my chosen upgrade
191
00:07:33,119 --> 00:07:36,191
Ability upgrades is equal to upgrade AXA dupla
192
00:07:36,447 --> 00:07:40,543
This will always return farts why because duplicate create a new rap
193
00:07:40,799 --> 00:07:42,335
And when you compare to Reece
194
00:07:42,591 --> 00:07:44,127
Together by equality
195
00:07:44,383 --> 00:07:46,431
Are your checking if the reference is there
196
00:07:47,199 --> 00:07:52,575
Sorry I like to do this because there is a risk that somewhere in your code you might duplicate a resource for some purpose
197
00:07:52,831 --> 00:07:55,391
And then when you try to do this equality it will break
198
00:07:55,903 --> 00:07:56,415
Because
199
00:07:56,671 --> 00:07:57,183
It's
200
00:07:57,439 --> 00:07:58,719
Technically the same ref
201
00:07:59,231 --> 00:08:01,279
So that's why I like to have a secondary
202
00:08:02,047 --> 00:08:03,327
Sort of ID
203
00:08:05,631 --> 00:08:07,679
Because I want to be sure
204
00:08:08,191 --> 00:08:08,703
That
205
00:08:08,959 --> 00:08:11,519
These are the same type of resource
206
00:08:12,799 --> 00:08:14,335
So that's just my personal preference
207
00:08:14,591 --> 00:08:16,383
You can also if you wanted to
208
00:08:16,895 --> 00:08:18,943
Use this property resource pack
209
00:08:19,455 --> 00:08:20,991
And resource path
210
00:08:21,247 --> 00:08:22,015
If we click into it
211
00:08:22,271 --> 00:08:23,295
Is the path
212
00:08:23,551 --> 00:08:25,343
To The Resource on the disk
213
00:08:25,599 --> 00:08:27,647
So you can actually just compare the pair
214
00:08:28,671 --> 00:08:30,975
To see if it's the same file anyway
215
00:08:31,487 --> 00:08:36,351
That's enough on all those recorded just use the ID because we're already using an ID elsewhere
216
00:08:36,863 --> 00:08:39,423
So if our children upgrade is it go to the upgrade x
217
00:08:39,679 --> 00:08:41,983
Then what we can do as we could say upgrade cool
218
00:08:44,031 --> 00:08:45,055
Add item
219
00:08:46,335 --> 00:08:47,615
And we're going to add
220
00:08:47,871 --> 00:08:48,383
The
221
00:08:48,639 --> 00:08:50,175
Item which is upgrade
222
00:08:51,199 --> 00:08:51,711
Damage
223
00:08:51,967 --> 00:08:52,991
And we're going to add 10
224
00:08:53,759 --> 00:08:59,903
No I'm just going to make all these weight equal but feel free to change these weights according to how you want a balance the game
225
00:09:00,159 --> 00:09:01,183
Remember a great away
226
00:09:01,439 --> 00:09:02,975
It means that it will be more like
227
00:09:03,231 --> 00:09:03,743
Baby chosen
228
00:09:06,047 --> 00:09:11,167
Ok and then we have this function now which weekend extend when we have other
229
00:09:11,679 --> 00:09:12,703
That are being shown
230
00:09:13,471 --> 00:09:18,591
Ok so we still need to call this though so before we call the Amit in our apply upgrade
231
00:09:18,847 --> 00:09:20,127
Let's do update
232
00:09:21,151 --> 00:09:22,175
Upgrade pool
233
00:09:22,431 --> 00:09:24,223
Animal pass in h
234
00:09:24,735 --> 00:09:25,503
Upgrade
235
00:09:27,295 --> 00:09:31,391
There's still a bunch wrong with this code because we went from
236
00:09:32,415 --> 00:09:35,743
Standard array with a upgrade pool to a weighted table
237
00:09:35,999 --> 00:09:39,839
So you recall a couple of lessons ago we were doing some things
238
00:09:40,095 --> 00:09:43,423
With the Opera port we were filtering it and all that good stuff
239
00:09:43,679 --> 00:09:45,471
So that we didn't choose the same
240
00:09:45,727 --> 00:09:46,751
Upgrade
241
00:09:47,263 --> 00:09:50,591
And we're going to have to do the same with our waiting take
242
00:09:51,103 --> 00:09:53,151
And this actually shouldn't be
243
00:09:53,407 --> 00:09:53,919
Tudor
244
00:09:54,687 --> 00:09:56,735
Instead of this filter upgrade
245
00:09:56,991 --> 00:10:00,716
We're not going to do any of that so let's get rid of this filtered upgrades line
246
00:10:00,717 --> 00:10:03,273
Subtitled by
online-courses.club
We compress knowledge for you!
247
00:10:03,274 --> 00:10:06,207
No we don't get a bunch of errors from removing that line but that's fine for now
248
00:10:06,463 --> 00:10:07,999
So chosen opera
249
00:10:08,511 --> 00:10:13,887
We're going to instead of doing filter upgrades here so let's comment out this line because it
250
00:10:14,143 --> 00:10:17,983
A little bit annoying so go ahead control k on these two lines to come in
251
00:10:18,495 --> 00:10:20,543
And then our chosen upgrade were going to say
252
00:10:21,311 --> 00:10:22,079
Upgrade
253
00:10:22,335 --> 00:10:22,847
Poole
254
00:10:23,615 --> 00:10:24,127
Dart
255
00:10:26,431 --> 00:10:27,711
Ok and then we're going to pay
256
00:10:28,479 --> 00:10:31,807
So we actually don't need this filter down here anymore
257
00:10:32,063 --> 00:10:34,879
Because we're going to do something similar
258
00:10:35,391 --> 00:10:36,415
In our
259
00:10:36,671 --> 00:10:37,439
Upgrade
260
00:10:37,695 --> 00:10:38,207
Table
261
00:10:38,463 --> 00:10:40,255
Or awaiting table leather sole
262
00:10:40,511 --> 00:10:43,327
Click ctrl click on this pic item right here
263
00:10:43,839 --> 00:10:45,631
To go into the waiter table
264
00:10:46,143 --> 00:10:46,655
And let
265
00:10:47,167 --> 00:10:50,239
Allow ourselves to pass in in array
266
00:10:50,495 --> 00:10:51,519
Of items to
267
00:10:52,799 --> 00:10:55,615
So what I'm going to do is I'm going to say excluded
268
00:10:55,871 --> 00:10:57,663
Is it going to be of type array
269
00:10:57,919 --> 00:10:59,711
And we can't type this because
270
00:10:59,967 --> 00:11:00,479
Weed
271
00:11:00,735 --> 00:11:02,271
Have types in this
272
00:11:02,527 --> 00:11:03,807
In this classroom
273
00:11:04,319 --> 00:11:07,135
And we're going to set this by default equal to empty array
274
00:11:07,391 --> 00:11:07,903
So
275
00:11:08,159 --> 00:11:12,255
You can actually assign default values for parameters by putting an equals
276
00:11:12,511 --> 00:11:14,303
And whatever value you want
277
00:11:14,815 --> 00:11:18,655
As part of the perimeter so this means that if we don't pass in and excluded
278
00:11:18,911 --> 00:11:20,191
It's by default go
279
00:11:20,703 --> 00:11:21,215
Empty
280
00:11:21,727 --> 00:11:24,543
Alright it's all gonna have to do a little bit of manipulate
281
00:11:24,799 --> 00:11:26,079
I'm here in order for this
282
00:11:26,335 --> 00:11:27,103
The Rachel
283
00:11:27,615 --> 00:11:28,639
So we want to do
284
00:11:29,919 --> 00:11:30,943
Excluded
285
00:11:31,199 --> 00:11:32,223
Dad size
286
00:11:34,015 --> 00:11:35,295
Greater than zero
287
00:11:35,807 --> 00:11:37,599
Let's write a past right here for now
288
00:11:37,855 --> 00:11:40,927
So sense of what we're going to do is working to recalculate the weights
289
00:11:41,439 --> 00:11:44,511
And we're going to reassign the items arrive
290
00:11:45,023 --> 00:11:46,815
So let's create a new variable a call
291
00:11:48,607 --> 00:11:49,887
Adjusted items
292
00:11:50,143 --> 00:11:51,167
Is equal to
293
00:11:52,191 --> 00:11:56,031
An empty array and we can also type this the same as the items
294
00:11:56,543 --> 00:11:58,847
So let's type it as an array
295
00:12:00,639 --> 00:12:03,455
Ok and we can just assign this to start
296
00:12:03,711 --> 00:12:04,223
2
297
00:12:05,247 --> 00:12:06,015
Just like so
298
00:12:07,295 --> 00:12:10,879
And then we're going to say via adjusted weight
299
00:12:11,135 --> 00:12:12,415
Is equal to weight
300
00:12:12,671 --> 00:12:13,183
Some
301
00:12:13,439 --> 00:12:15,743
Let's be consistent with just weights
302
00:12:17,791 --> 00:12:20,607
So now with grab a separate reference to those
303
00:12:20,863 --> 00:12:23,423
Excluded size is greater than 0
304
00:12:23,679 --> 00:12:24,959
And what we're going to do
305
00:12:25,215 --> 00:12:26,239
Is we're going to say
306
00:12:26,495 --> 00:12:27,519
Adjusted
307
00:12:27,775 --> 00:12:29,567
Is equal to empty array
308
00:12:30,335 --> 00:12:31,615
So I'm going to rear sign
309
00:12:32,127 --> 00:12:33,663
I'm going to say 4
310
00:12:33,919 --> 00:12:34,943
In
311
00:12:35,455 --> 00:12:36,479
Are we going to say
312
00:12:36,735 --> 00:12:37,759
If I do
313
00:12:38,783 --> 00:12:40,831
And then a key of item in qu
314
00:12:41,599 --> 00:12:42,367
In
315
00:12:42,879 --> 00:12:43,903
Exclude
316
00:12:46,207 --> 00:12:48,511
Then what we want to do is we want to
317
00:12:50,815 --> 00:12:52,351
Otherwise what we're going to do
318
00:12:52,863 --> 00:12:54,655
Is ringing to say adjusted items
319
00:12:55,167 --> 00:12:55,935
Dr pen
320
00:12:57,215 --> 00:12:57,727
Adam
321
00:12:58,239 --> 00:12:59,775
And then adjusted weights
322
00:13:01,823 --> 00:13:02,847
Was equals
323
00:13:04,895 --> 00:13:06,687
Adam and then in quotes
324
00:13:06,943 --> 00:13:07,455
Wait
325
00:13:07,967 --> 00:13:11,295
Ok and then we need to make sure that under this adjusted items line
326
00:13:11,551 --> 00:13:12,319
Me to say
327
00:13:12,575 --> 00:13:13,087
Justin Waite
328
00:13:13,343 --> 00:13:14,623
Sum is equal to
329
00:13:15,647 --> 00:13:16,671
Right so what is this
330
00:13:17,183 --> 00:13:22,815
So we're iterating over each item in our internal items a race of this one up here that store
331
00:13:23,071 --> 00:13:25,119
So it raining all over there
332
00:13:25,375 --> 00:13:27,167
We're getting the adjective
333
00:13:27,423 --> 00:13:30,239
The guitar variants that stored at the key item
334
00:13:30,495 --> 00:13:36,639
And chatting if that item is nearly excluded and this is basically a shorthand way of saying
335
00:13:36,895 --> 00:13:38,943
Iterate over the exclude array
336
00:13:39,455 --> 00:13:42,271
To check if this item is inside
337
00:13:43,551 --> 00:13:44,063
We are
338
00:13:45,087 --> 00:13:46,111
And now I continually
339
00:13:46,367 --> 00:13:47,647
Is it different than bread
340
00:13:48,159 --> 00:13:50,719
Break will stop the execution of
341
00:13:50,975 --> 00:13:51,743
The four
342
00:13:51,999 --> 00:13:53,023
Overall
343
00:13:53,279 --> 00:13:54,303
Continue
344
00:13:54,559 --> 00:13:55,071
Will
345
00:13:55,327 --> 00:13:57,887
Stop the execution of this specific
346
00:13:58,399 --> 00:14:01,727
So continue essentially means OK Google next item in the
347
00:14:02,239 --> 00:14:08,383
If the item is not in our exploration what we're doing is work adding that to the adjusted out
348
00:14:08,639 --> 00:14:13,247
So this is our new right and then we are also adding the new weights
349
00:14:14,015 --> 00:14:15,295
To that adjusted weights
350
00:14:16,575 --> 00:14:17,343
And soul
351
00:14:17,599 --> 00:14:23,743
In our chosen week now and in this blackout here we need to change what numbers are being
352
00:14:23,999 --> 00:14:25,023
So this week some here
353
00:14:25,279 --> 00:14:27,071
Needs to be adjusted weights on
354
00:14:28,095 --> 00:14:31,167
And then for item in this has to be adjusted
355
00:14:33,471 --> 00:14:37,823
This is basically going to have this is not gonna change if I exclude eraser
356
00:14:38,079 --> 00:14:41,407
Because we're signing the adjusted items to the reference
357
00:14:41,663 --> 00:14:42,943
Of this I am the real
358
00:14:43,199 --> 00:14:46,271
And there were also a signing the adjusted weight some to the
359
00:14:46,527 --> 00:14:47,039
Toroid
360
00:14:48,063 --> 00:14:52,159
So and then we're just essentially recalculating it if the excluding Ray
361
00:14:52,415 --> 00:14:52,927
Present
362
00:14:53,951 --> 00:14:56,767
A word about this is that this is not the most
363
00:14:57,279 --> 00:15:01,119
Performance code is going to be perfectly fine for our use cases
364
00:15:01,631 --> 00:15:02,143
But
365
00:15:03,167 --> 00:15:04,447
For example you have
366
00:15:04,959 --> 00:15:07,007
Let's save 500 upgrades
367
00:15:07,519 --> 00:15:09,311
And you pass in
368
00:15:09,567 --> 00:15:11,359
And excluded ray of 200
369
00:15:11,871 --> 00:15:13,407
You are going to
370
00:15:13,663 --> 00:15:16,223
Perhaps see some mothers what issues because
371
00:15:16,735 --> 00:15:20,063
You'll be iterating over this loop 500 times
372
00:15:20,319 --> 00:15:22,367
But then you'll be iterating over this
373
00:15:22,623 --> 00:15:23,391
200
374
00:15:23,903 --> 00:15:26,463
So you're doing a loop of 200
375
00:15:26,719 --> 00:15:30,559
Within a loop of 500 and you can see that can stack up pretty well now
376
00:15:30,815 --> 00:15:33,631
That's a very specific Circumstance and we're not going to be
377
00:15:34,911 --> 00:15:37,983
You can probably safely do a couple hundred
378
00:15:38,239 --> 00:15:40,799
Upgrades and as long as you're excluded
379
00:15:41,055 --> 00:15:43,103
Doesn't grow any larger than life
380
00:15:43,615 --> 00:15:46,175
We are 4 or maybe even 10
381
00:15:46,687 --> 00:15:47,967
It should be fine so
382
00:15:48,223 --> 00:15:51,039
The point is this is the quickest and easiest way
383
00:15:51,295 --> 00:15:52,575
To get this algorithm
384
00:15:52,831 --> 00:15:53,855
To pick items to work
385
00:15:54,111 --> 00:15:56,671
And it will work with relatively small
386
00:15:56,927 --> 00:15:57,695
Erase
387
00:15:57,951 --> 00:15:59,231
But just be aware
388
00:15:59,487 --> 00:15:59,999
That
389
00:16:00,255 --> 00:16:02,559
This can present performance problems
390
00:16:02,815 --> 00:16:04,863
If you're arrays are pretty
391
00:16:05,631 --> 00:16:07,679
But I think we'll be ok
392
00:16:07,935 --> 00:16:09,215
With what we've got here
393
00:16:09,471 --> 00:16:12,799
Answer now what we can do as we can go back to her upgrade manager
394
00:16:13,311 --> 00:16:14,847
And we got these chosen upgrade
395
00:16:15,103 --> 00:16:17,407
We can just feed that back into
396
00:16:17,663 --> 00:16:21,247
Upgrades for pick item right so we can say chosen
397
00:16:21,759 --> 00:16:22,527
Upgrades
398
00:16:23,039 --> 00:16:28,927
So keeping track your children upgrades and then were feeding a back into pick item as our excluder resource
399
00:16:29,183 --> 00:16:31,487
Don't pick any upgrades I have already been
400
00:16:32,511 --> 00:16:34,303
And then we can get rid of this
401
00:16:34,559 --> 00:16:35,327
Silted up
402
00:16:35,583 --> 00:16:36,095
Here
403
00:16:37,119 --> 00:16:38,143
And we
404
00:16:38,399 --> 00:16:40,959
Just need to fix this check here so
405
00:16:41,215 --> 00:16:47,359
Let's just make this cheque effectively the same as what we have so we don't have a filter upgrade anymore so why is this
406
00:16:47,871 --> 00:16:49,151
This is essentially here
407
00:16:49,407 --> 00:16:51,455
We is there are no options
408
00:16:51,967 --> 00:16:52,735
To pick any
409
00:16:52,991 --> 00:16:53,503
Right
410
00:16:53,759 --> 00:16:58,111
And how can we check that well it's very simple we can just take the upgrade pool
411
00:16:58,623 --> 00:16:59,903
Items
412
00:17:00,415 --> 00:17:02,719
Because that's are a right here right
413
00:17:02,975 --> 00:17:06,559
Upgrade product items that size is equal to 0
414
00:17:06,815 --> 00:17:08,863
But our chosen upgrades
415
00:17:09,119 --> 00:17:09,631
Start
416
00:17:09,887 --> 00:17:10,399
Size
417
00:17:10,911 --> 00:17:14,495
Right so central what was saying is if the exclude array
418
00:17:14,751 --> 00:17:16,287
Is equal in size
419
00:17:16,799 --> 00:17:17,311
2
420
00:17:17,823 --> 00:17:20,383
The overall items around the upgrade pool
421
00:17:20,639 --> 00:17:22,431
Then what that means is that
422
00:17:22,687 --> 00:17:27,807
They are all of the items in the pool are going to be excluded and it's going to be a pool of 0
423
00:17:28,063 --> 00:17:30,111
Write the table is going to contain 0 valid
424
00:17:30,623 --> 00:17:32,671
This is effectively the same chat
425
00:17:32,927 --> 00:17:33,439
There
426
00:17:33,695 --> 00:17:38,815
So let's just do a quick check to make sure that are upgrades are still working fine
427
00:17:39,327 --> 00:17:41,887
Alright so we've got sore damage and sort quick
428
00:17:42,399 --> 00:17:43,935
I can pick up the sword quickness
429
00:17:47,007 --> 00:17:50,847
Ok so when I chose the axe I got a crash and that's because we're still
430
00:17:51,103 --> 00:17:53,919
Treating the upgrade as if it was
431
00:17:54,175 --> 00:17:54,687
A
432
00:17:54,943 --> 00:17:57,247
An array but it's actually still waiting
433
00:17:57,503 --> 00:17:58,527
So I'm going to start again
434
00:17:58,783 --> 00:18:01,599
They should be fairly easy to deal with basically what we're saying is
435
00:18:02,111 --> 00:18:02,879
Once the
436
00:18:03,391 --> 00:18:08,255
Quantities equal to the mass quantity we want to remove the item from the upgrade pool
437
00:18:08,511 --> 00:18:11,839
So what I'm going to do is I'm going to go back to my weight in table
438
00:18:12,095 --> 00:18:15,423
And I'm going to create a function called remove item
439
00:18:16,703 --> 00:18:17,727
Underscore item
440
00:18:18,239 --> 00:18:21,311
And we are going to pass in the light
441
00:18:22,335 --> 00:18:24,639
To do as we're going to say
442
00:18:24,895 --> 00:18:26,687
Items for items array
443
00:18:26,943 --> 00:18:27,967
Is it good to
444
00:18:28,223 --> 00:18:29,759
Items.for
445
00:18:30,271 --> 00:18:31,551
In a passing the filter funk
446
00:18:32,063 --> 00:18:32,575
And
447
00:18:32,831 --> 00:18:33,855
Were going to say
448
00:18:34,111 --> 00:18:34,623
Funk
449
00:18:36,415 --> 00:18:36,927
Colin
450
00:18:37,439 --> 00:18:39,231
Item and then the key
451
00:18:39,999 --> 00:18:41,023
I know this
452
00:18:41,279 --> 00:18:41,791
Confuse
453
00:18:42,047 --> 00:18:43,839
But so the ski right here
454
00:18:45,375 --> 00:18:46,399
Is equal to
455
00:18:47,423 --> 00:18:49,983
Let's let's rename this parameter item to remove
456
00:18:51,775 --> 00:18:52,799
Just so it's more clear
457
00:18:53,055 --> 00:18:55,103
So we're going to remove item item to remove
458
00:18:55,615 --> 00:19:00,223
We're going to set the items array equal to a filter version of the items array
459
00:19:00,479 --> 00:19:00,991
Where
460
00:19:01,247 --> 00:19:02,015
The item
461
00:19:02,271 --> 00:19:04,063
Is not equal to
462
00:19:04,575 --> 00:19:05,087
The item
463
00:19:07,135 --> 00:19:07,903
And we need to
464
00:19:08,159 --> 00:19:08,927
Return this
465
00:19:09,183 --> 00:19:14,815
Return the object that exist at the key item within the current item that were looking at
466
00:19:15,327 --> 00:19:16,095
And and
467
00:19:16,351 --> 00:19:18,655
It's not equal to the item to
468
00:19:19,167 --> 00:19:22,751
CL saying give us all of the
469
00:19:23,263 --> 00:19:27,615
Items in the items array that are not equal to the item to array
470
00:19:27,871 --> 00:19:30,687
And we need to recalculate your weight some so
471
00:19:30,943 --> 00:19:34,527
Let's say wait so many people 20 and then we'll write a quick
472
00:19:35,039 --> 00:19:36,831
For loop for item in
473
00:19:38,111 --> 00:19:39,903
We're going to say wait some
474
00:19:40,415 --> 00:19:41,695
Equals item
475
00:19:41,951 --> 00:19:42,463
Wait
476
00:19:42,719 --> 00:19:43,231
Some
477
00:19:43,743 --> 00:19:45,279
Or sorry this is just wait here
478
00:19:45,535 --> 00:19:47,327
So I am and then the key
479
00:19:47,583 --> 00:19:49,375
Wait because that's what an addiction
480
00:19:49,631 --> 00:19:53,727
Remove the item for the list or rather the proper way of saying this is
481
00:19:53,983 --> 00:19:55,519
Get all of the items
482
00:19:55,775 --> 00:19:59,871
In the items array that are not equal to the item to remove
483
00:20:00,127 --> 00:20:05,247
And then set the weights under 0 iterate over all of those new filter items
484
00:20:05,759 --> 00:20:08,063
Adding up the weights into the weights
485
00:20:08,575 --> 00:20:10,367
So now when we go
486
00:20:10,623 --> 00:20:11,647
Back 2 hour
487
00:20:12,159 --> 00:20:12,927
Upgrade manager
488
00:20:13,439 --> 00:20:17,535
You can see that now instead of doing the filter here in our upgrade pool
489
00:20:17,791 --> 00:20:19,839
So in the supply upgrade method
490
00:20:20,095 --> 00:20:23,167
We were filtering it instead we can do upgrades Poole
491
00:20:24,703 --> 00:20:25,727
Remove item
492
00:20:26,495 --> 00:20:29,567
And we're going to remove the item that is this up
493
00:20:34,431 --> 00:20:37,759
Ok and so that should probably remove the axe from our pool
494
00:20:38,271 --> 00:20:40,319
Let's go to our basic anime scene
495
00:20:40,575 --> 00:20:44,927
Let's turn up the volume drop to one sort of I'll drop presenter 21
496
00:20:45,183 --> 00:20:46,719
So that we can test it proper
497
00:20:47,231 --> 00:20:48,255
Came in and pick the axe
498
00:20:49,279 --> 00:20:52,863
No errors this time and I shouldn't be able to pick the axe
499
00:20:53,375 --> 00:20:54,143
In the future
500
00:20:56,447 --> 00:20:57,983
Ok all looks good
501
00:20:58,239 --> 00:21:01,823
There's one more thing to do in that is to make the damage work
502
00:21:02,335 --> 00:21:05,663
So let's open up our sword ability controller
503
00:21:05,919 --> 00:21:07,455
And will open up Dad's
504
00:21:07,967 --> 00:21:10,527
And you can see that are on ability opera
505
00:21:10,783 --> 00:21:14,111
Added this is where we want to listen for upgrades and we're going to get
506
00:21:14,367 --> 00:21:19,488
All upgrades sent here now we have this built with the assumption that the sword rate is the only one
507
00:21:19,744 --> 00:21:20,256
Can happen
508
00:21:20,512 --> 00:21:21,280
What I can
509
00:21:21,536 --> 00:21:22,816
Affective disorder
510
00:21:23,072 --> 00:21:25,120
Are we actually have a new one sword down
511
00:21:26,144 --> 00:21:26,656
And so
512
00:21:26,912 --> 00:21:31,776
What we can do is before I go any further I'm going to rename this to base damage
513
00:21:32,288 --> 00:21:33,056
Just like so
514
00:21:33,568 --> 00:21:34,848
And then I'm going to say
515
00:21:35,104 --> 00:21:37,408
Create a new variable via additional
516
00:21:37,664 --> 00:21:38,432
Damage
517
00:21:38,688 --> 00:21:39,200
Percent
518
00:21:39,456 --> 00:21:44,320
What's that one and why resetting at 1 because when we multiplied base damage by additional day
519
00:21:44,576 --> 00:21:45,088
Percent
520
00:21:45,344 --> 00:21:46,368
That will return 5
521
00:21:46,624 --> 00:21:50,464
And then we can just increment this number to increase the Malta
522
00:21:51,744 --> 00:21:52,256
So
523
00:21:52,512 --> 00:21:58,400
Back down to the bottom of the strip we need to replace this with base underscore damage so sore instance
524
00:21:58,656 --> 00:22:00,192
Hitbox component that damage
525
00:22:00,448 --> 00:22:01,984
Is it going to be snowing which time
526
00:22:02,240 --> 00:22:04,288
The additional damage percent
527
00:22:04,800 --> 00:22:05,568
CC Alex
528
00:22:06,080 --> 00:22:08,640
And then our own ability upgrade added functions
529
00:22:08,896 --> 00:22:10,432
I'm going to remove this return
530
00:22:11,968 --> 00:22:15,808
And then I'm going to indent all three of these lines underneath
531
00:22:16,320 --> 00:22:18,112
Ok and I'm going to change this
532
00:22:18,368 --> 00:22:18,880
Check
533
00:22:19,136 --> 00:22:20,928
This operator to IKEA
534
00:22:21,184 --> 00:22:23,232
So if I break ideas equal disorder
535
00:22:23,488 --> 00:22:24,512
Do all of these things
536
00:22:25,024 --> 00:22:26,816
Then we can do an Elsa
537
00:22:27,072 --> 00:22:27,584
So
538
00:22:27,840 --> 00:22:30,656
An Elsa fingered all is done with l
539
00:22:30,912 --> 00:22:32,192
Glif
540
00:22:32,448 --> 00:22:33,728
And this is basically saying
541
00:22:33,984 --> 00:22:35,520
Only moved to this black
542
00:22:35,776 --> 00:22:39,104
If this block fails so if this evaluation is false
543
00:22:39,360 --> 00:22:41,408
Then move on to this evaluate
544
00:22:41,920 --> 00:22:43,200
So I can say hello
545
00:22:43,456 --> 00:22:43,968
Upgrade
546
00:22:45,504 --> 00:22:46,528
Is equal to
547
00:22:47,040 --> 00:22:49,344
Sword underscore damage
548
00:22:49,856 --> 00:22:52,672
Which is what our ID is right here
549
00:22:54,464 --> 00:22:55,744
And then what do you want to do in here
550
00:22:56,000 --> 00:22:57,024
Additional
551
00:22:57,280 --> 00:22:59,584
Damage percent plus equals
552
00:22:59,840 --> 00:23:00,608
And what do we say
553
00:23:00,864 --> 00:23:01,632
Lights 15%
554
00:23:01,888 --> 00:23:02,400
So weird
555
00:23:02,656 --> 00:23:03,680
Plus .1
556
00:23:04,448 --> 00:23:04,960
Ok
557
00:23:05,472 --> 00:23:10,080
So that is our sword damage increase let's do the same change for
558
00:23:10,336 --> 00:23:10,848
Ask
559
00:23:11,360 --> 00:23:12,896
And I'm going to
560
00:23:13,408 --> 00:23:15,456
Cheat a little bit I'm going to copy this
561
00:23:15,712 --> 00:23:18,016
Honour building upgrade Adams function right here
562
00:23:18,784 --> 00:23:19,552
And
563
00:23:19,808 --> 00:23:24,928
I think I should be fine so I'm going to open up these sort of sorry the accessibility controllers
564
00:23:26,720 --> 00:23:28,768
We need to go ahead and paste
565
00:23:29,024 --> 00:23:31,072
So disorder building upgrades added
566
00:23:31,328 --> 00:23:37,216
Graco back to my sword ability controller script copy this game event line from the ready method
567
00:23:37,472 --> 00:23:39,008
Just because I'm lazy and I
568
00:23:40,544 --> 00:23:42,336
And Pace that in the ready method
569
00:23:42,592 --> 00:23:43,104
The axis
570
00:23:43,360 --> 00:23:44,128
You controller
571
00:23:44,384 --> 00:23:47,200
We can get rid of the second a lift black hair
572
00:23:47,968 --> 00:23:49,248
And we can
573
00:23:49,504 --> 00:23:53,088
Basically get rid of its now I'm in a ride pass on here cos I'm realising
574
00:23:53,600 --> 00:23:56,928
We implemented the Sword of odour control damage slightly wrong
575
00:23:57,184 --> 00:23:59,232
Instead of just simply adding
576
00:23:59,488 --> 00:24:00,256
10%
577
00:24:00,512 --> 00:24:02,048
In the Army building upgrade
578
00:24:02,560 --> 00:24:03,328
We want to read
579
00:24:03,584 --> 00:24:04,864
The credit upgrade quant
580
00:24:05,888 --> 00:24:07,424
Right so we want to say
581
00:24:07,680 --> 00:24:09,216
Additional damage percent
582
00:24:09,728 --> 00:24:10,752
Is equal to
583
00:24:11,008 --> 00:24:11,520
1
584
00:24:11,776 --> 00:24:12,544
Plus
585
00:24:12,800 --> 00:24:15,104
And then let's remove the point 15
586
00:24:15,360 --> 00:24:16,384
In parentheses
587
00:24:16,640 --> 00:24:19,968
Credit upgrades sword underscore damage
588
00:24:21,504 --> 00:24:25,088
Quantity and then multiply that by .15
589
00:24:25,600 --> 00:24:28,672
And the reason why we want to use this instead of doing a straight edition
590
00:24:29,184 --> 00:24:29,952
We were doing
591
00:24:30,208 --> 00:24:32,512
Is because you can imagine a situation
592
00:24:33,024 --> 00:24:34,816
We change the quantity
593
00:24:35,328 --> 00:24:36,096
More than one
594
00:24:36,352 --> 00:24:38,400
Right so we say oh and 2 instead of 1
595
00:24:38,656 --> 00:24:40,960
Well this would be incorrect then if it was only a
596
00:24:41,472 --> 00:24:42,752
15% of 30
597
00:24:43,008 --> 00:24:45,056
So we're going to read the current up
598
00:24:45,312 --> 00:24:48,128
And then make sure to change this key to sword Dam
599
00:24:48,640 --> 00:24:50,176
Write this needs to be the same
600
00:24:50,432 --> 00:24:51,968
I just need to be reference in this order
601
00:24:52,480 --> 00:24:52,992
Alnwick
602
00:24:53,504 --> 00:24:54,016
X
603
00:24:54,272 --> 00:24:54,784
Point
604
00:24:56,064 --> 00:24:58,368
So now let's go back to the accessibility
605
00:24:58,624 --> 00:24:59,392
And we have
606
00:24:59,904 --> 00:25:00,928
Damn
607
00:25:02,208 --> 00:25:06,304
So let's change this pop grade ideal line 2 x underscore damage
608
00:25:06,816 --> 00:25:08,352
And we can do the same thing so we'll see
609
00:25:08,864 --> 00:25:11,680
Up online 50-in a change that variable
610
00:25:11,936 --> 00:25:12,704
The base damage
611
00:25:13,216 --> 00:25:14,752
Never going to create another variable
612
00:25:15,008 --> 00:25:15,776
Additional data
613
00:25:17,056 --> 00:25:18,080
Equals 1
614
00:25:18,592 --> 00:25:22,432
Ok then would change the line 26 down here on timer timeout
615
00:25:23,968 --> 00:25:24,480
Damn
616
00:25:24,992 --> 00:25:25,504
X
617
00:25:26,016 --> 00:25:26,784
Additional
618
00:25:27,552 --> 00:25:28,576
Damage percent
619
00:25:28,832 --> 00:25:29,344
Ok
620
00:25:29,600 --> 00:25:30,112
And then
621
00:25:30,368 --> 00:25:31,904
In here we're going to say
622
00:25:32,672 --> 00:25:34,720
Instead of writing pass will do additional
623
00:25:35,232 --> 00:25:37,280
Damage percent is equal to 1 plus
624
00:25:37,536 --> 00:25:38,560
In parentheses
625
00:25:39,072 --> 00:25:40,096
Current upgrade
626
00:25:40,352 --> 00:25:41,632
Kid with
627
00:25:42,144 --> 00:25:43,936
Ask undiscord damage
628
00:25:44,704 --> 00:25:45,216
And then
629
00:25:46,240 --> 00:25:46,752
Quant
630
00:25:47,520 --> 00:25:50,848
And I multiply this by I believe it was 10% right
631
00:25:51,104 --> 00:25:52,384
Search open up her act
632
00:25:52,640 --> 00:25:53,152
Yeah
633
00:25:53,408 --> 00:25:54,176
Set someone x
634
00:25:55,456 --> 00:25:55,968
Ok
635
00:25:56,224 --> 00:25:57,760
Let's see if he's upgrade work
636
00:25:58,016 --> 00:26:00,576
And the beautiful thing about this is we have floating number
637
00:26:00,832 --> 00:26:02,112
And so we should be able to see
638
00:26:02,624 --> 00:26:03,648
Does flooring number
639
00:26:03,904 --> 00:26:04,672
Affecting the day
640
00:26:05,184 --> 00:26:08,768
Wireless did axe damage in we should see a number greater than 10
641
00:26:10,304 --> 00:26:11,328
There we go
642
00:26:11,840 --> 00:26:14,656
Now if I select a sword damage what you'll notice is that
643
00:26:14,912 --> 00:26:16,704
We're going to start seeing decimal
644
00:26:16,960 --> 00:26:19,264
And we don't necessarily want
645
00:26:19,520 --> 00:26:20,032
That
646
00:26:20,288 --> 00:26:23,104
To be shown at least not to that degree
647
00:26:23,616 --> 00:26:24,896
So we need a form
648
00:26:25,152 --> 00:26:27,200
That text when responding the
649
00:26:27,456 --> 00:26:28,224
Next dimension
650
00:26:28,992 --> 00:26:31,040
And this will be the final thing that we need to do for this lesson
651
00:26:31,296 --> 00:26:33,856
I'm going to go and open up the herb box component
652
00:26:34,112 --> 00:26:36,928
Which is responsible for formatting the string
653
00:26:37,184 --> 00:26:40,512
And we need to format this properly according to
654
00:26:41,536 --> 00:26:45,376
Actual value of the number and sort is it a little bit tricky and
655
00:26:45,632 --> 00:26:49,472
There are formatting string documents that I'm going to look
656
00:26:49,984 --> 00:26:51,008
For this lesson
657
00:26:51,520 --> 00:26:54,336
So you can take a look at the mess and Resources
658
00:26:54,848 --> 00:26:57,408
To read the documentation about string formatting
659
00:26:57,664 --> 00:27:02,528
But basically the way that we can format decimal places is we can do that so I'm going to say
660
00:27:03,040 --> 00:27:03,552
Bar
661
00:27:03,808 --> 00:27:04,320
Former
662
00:27:04,576 --> 00:27:05,600
Underscore string
663
00:27:05,856 --> 00:27:07,392
Is equal to in quotes
664
00:27:07,648 --> 00:27:08,160
Percent
665
00:27:08,672 --> 00:27:09,184
0
666
00:27:10,208 --> 00:27:10,720
1
667
00:27:11,744 --> 00:27:14,560
Ok so this may be a little bit confusing
668
00:27:15,072 --> 00:27:17,120
But essentially what is the saying is
669
00:27:17,632 --> 00:27:20,704
Add no padding so just make the string as long as it used to
670
00:27:21,216 --> 00:27:23,008
And format to 1 decimal
671
00:27:23,520 --> 00:27:24,800
That's what the saying is
672
00:27:25,056 --> 00:27:26,848
Fminside at 6
673
00:27:27,872 --> 00:27:29,664
In the way that we use this is we can do
674
00:27:30,176 --> 00:27:32,224
Instead of doing the string or remove that
675
00:27:32,736 --> 00:27:33,248
Will do
676
00:27:33,760 --> 00:27:35,296
Format underscore string
677
00:27:35,808 --> 00:27:37,088
NN percent
678
00:27:37,856 --> 00:27:39,904
Hitbox component bad day
679
00:27:41,184 --> 00:27:44,256
So now we run that what's going to happen if you're going to start seeing
680
00:27:44,768 --> 00:27:45,792
.0
681
00:27:46,048 --> 00:27:49,120
So it's one decimal place but we don't want that to happen
682
00:27:49,632 --> 00:27:50,400
Or
683
00:27:51,680 --> 00:27:56,288
We only want that to happen if there's actually a decimal number
684
00:27:56,544 --> 00:27:58,848
Like 5.8 like that showing up right there
685
00:27:59,104 --> 00:28:01,664
So the way that we're going to do this is this is why
686
00:28:01,920 --> 00:28:02,944
We store
687
00:28:03,200 --> 00:28:04,480
Format string in a bit
688
00:28:04,992 --> 00:28:05,504
So
689
00:28:05,760 --> 00:28:07,040
In her basket
690
00:28:07,296 --> 00:28:10,112
Script let's write an if statement if round
691
00:28:11,392 --> 00:28:14,464
And then we're going to take that hit box component that damage
692
00:28:16,768 --> 00:28:18,304
Is that number round
693
00:28:18,816 --> 00:28:19,584
Is equal to
694
00:28:20,096 --> 00:28:21,888
Beatbox component that damage
695
00:28:22,400 --> 00:28:24,192
Then we're going to say our format string
696
00:28:24,704 --> 00:28:25,728
Is equal to
697
00:28:25,984 --> 00:28:29,568
We're going to make it the same string except we are going to
698
00:28:30,592 --> 00:28:31,872
2
699
00:28:32,128 --> 00:28:32,640
0
700
00:28:32,896 --> 00:28:34,432
So what actually saying is
701
00:28:34,688 --> 00:28:35,968
If the rounded
702
00:28:36,224 --> 00:28:41,088
Value of the number is equal to the number of cells that must mean that it's a whole integer
703
00:28:41,344 --> 00:28:41,856
Right
704
00:28:42,112 --> 00:28:48,256
And so we're just going to set the format string 0.0 and what this essentially does to is this tells us to round
705
00:28:48,512 --> 00:28:49,024
Number
706
00:28:49,280 --> 00:28:49,792
Well
707
00:28:51,072 --> 00:28:53,376
0 decimal places that's what rounding
708
00:28:54,400 --> 00:28:57,472
By the way was one decimal place it rounds to that
709
00:28:57,728 --> 00:28:58,240
What is right
710
00:28:58,496 --> 00:28:59,008
So
711
00:28:59,264 --> 00:29:02,848
That's basically it's a real sign in the format string to have 0 decimal places
712
00:29:03,104 --> 00:29:03,616
And now
713
00:29:03,872 --> 00:29:04,384
When you
714
00:29:04,640 --> 00:29:05,152
The game
715
00:29:05,408 --> 00:29:07,968
It will only show the decimals
716
00:29:08,224 --> 00:29:10,528
Phone numbers that actually have decimal digit
717
00:29:11,040 --> 00:29:12,064
That was a long left
718
00:29:13,344 --> 00:29:15,136
Got a lot done
719
00:29:15,392 --> 00:29:21,536
Our wedding table is now much more powerful than it was and we have plenty of room to add even more can't
720
00:29:22,304 --> 00:29:25,120
I will say that if you don't like the look of the decimals
721
00:29:25,376 --> 00:29:29,216
You can just set your format string to this is 0.0
722
00:29:29,728 --> 00:29:30,240
Value
723
00:29:30,496 --> 00:29:33,824
If you just want a round all the numbers and you don't care about being act
724
00:29:34,336 --> 00:29:38,688
So another option is you can be fab all of the damage numbers and
725
00:29:39,200 --> 00:29:40,992
The health of all the entity
726
00:29:41,248 --> 00:29:42,272
To the point where
727
00:29:42,528 --> 00:29:44,320
You don't need to be super specific
728
00:29:44,576 --> 00:29:48,928
Encourage you to play with any of the numbers play with the drop raids that helps the damage
729
00:29:49,184 --> 00:29:51,488
Those are super important to match me
730
00:29:51,744 --> 00:29:54,048
Make it feel how you want to feel bad
731
00:29:54,304 --> 00:29:56,096
This is how you can format string
732
00:29:56,608 --> 00:29:57,632
To display
733
00:29:57,888 --> 00:29:58,400
Properly
734
00:29:58,656 --> 00:29:59,680
Alright and
735
00:29:59,936 --> 00:30:00,448
We've got
736
00:30:00,704 --> 00:30:01,984
Two new upgrades done
49167
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.