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:05,376
One problem that we still have that you may have noticed as that you can pick the accessibility multiple times now
2
00:00:05,632 --> 00:00:11,776
If you are building a game you may decide that is fine that you want to play to be able to stack abilities but for
3
00:00:12,032 --> 00:00:13,824
Purpose of this course we don't want that
4
00:00:14,080 --> 00:00:14,592
To happen
5
00:00:14,848 --> 00:00:16,384
And so we're going to prevent that from happening
6
00:00:16,640 --> 00:00:18,688
And what we're going to do essentially
7
00:00:18,944 --> 00:00:19,712
Filter out
8
00:00:20,224 --> 00:00:23,296
Upgrades that exist inside the upgrade pool
9
00:00:23,552 --> 00:00:24,576
In the upgrade
10
00:00:25,088 --> 00:00:28,160
So let's go ahead and click into the Opera managers script writer
11
00:00:28,672 --> 00:00:29,440
And
12
00:00:29,696 --> 00:00:33,792
What we need to do is essentially modify the upgrade pool to pick up
13
00:00:34,048 --> 00:00:34,816
Archie
14
00:00:35,328 --> 00:00:38,912
What we're gonna need to do as we're gonna need to specify a Mac
15
00:00:39,168 --> 00:00:40,192
Quantity for
16
00:00:40,448 --> 00:00:40,960
Turn up
17
00:00:41,216 --> 00:00:43,008
So let's before we do anything
18
00:00:43,264 --> 00:00:47,360
I'm here go to our resources directory and then to
19
00:00:47,872 --> 00:00:49,920
Let's double click on ability upgrades
20
00:00:50,176 --> 00:00:50,944
Dodgy
21
00:00:51,200 --> 00:00:52,480
Add LEDs
22
00:00:52,736 --> 00:00:55,552
Do a Max quantity above
23
00:00:55,808 --> 00:00:56,576
The name
24
00:00:56,832 --> 00:00:58,112
So we're going to do at Expo
25
00:00:58,624 --> 00:00:59,136
Bar
26
00:00:59,392 --> 00:01:00,397
Max underscore
27
00:01:00,399 --> 00:01:02,875
Subtitled by
online-courses.club
We compress knowledge for you!
28
00:01:02,876 --> 00:01:02,208
Quantity
29
00:01:03,488 --> 00:01:04,768
And that's going to be of time
30
00:01:05,792 --> 00:01:06,816
And we will set
31
00:01:07,072 --> 00:01:07,584
2
32
00:01:07,840 --> 00:01:08,864
Willie Venezia
33
00:01:09,120 --> 00:01:13,984
And what I mean is that there's an you can have an indefinite number of these up
34
00:01:14,496 --> 00:01:18,592
Ok so we have an X quantum you probably know this double click on her x
35
00:01:19,872 --> 00:01:21,920
And the max quantity is not
36
00:01:22,176 --> 00:01:25,504
Showing up and I have a feeling that this might be a good deal issue
37
00:01:25,760 --> 00:01:28,320
So what we're going to do is before we do anything
38
00:01:28,576 --> 00:01:30,368
Let's click this to a button right here
39
00:01:30,624 --> 00:01:31,136
This
40
00:01:31,392 --> 00:01:34,208
One that says managed object properties when you have over it
41
00:01:34,464 --> 00:01:35,744
Go ahead and just
42
00:01:36,000 --> 00:01:36,768
Harvey Proctor
43
00:01:37,536 --> 00:01:40,864
Ok and then let's remove the Script by clicking this
44
00:01:41,376 --> 00:01:43,168
Button at the bottom this reset but
45
00:01:43,424 --> 00:01:44,960
That's going to get rid of all the properties
46
00:01:45,216 --> 00:01:48,032
What's drag the ability dodgy back on to it
47
00:01:48,288 --> 00:01:49,824
And now we have matched
48
00:01:50,848 --> 00:01:52,384
That's probably a good elbow
49
00:01:52,896 --> 00:01:55,712
But no worries we can go back to the store button here
50
00:01:55,968 --> 00:01:57,248
Pace properties
51
00:01:57,504 --> 00:01:59,552
And everything should be more
52
00:01:59,808 --> 00:02:00,320
Restore
53
00:02:00,576 --> 00:02:02,368
And now we've got the max quantity
54
00:02:02,624 --> 00:02:06,720
This may not be a problem in the version of Google for that you're using
55
00:02:06,976 --> 00:02:10,048
I'm on release candidate to so it may still be a remaining bug
56
00:02:10,304 --> 00:02:11,072
In any case
57
00:02:11,328 --> 00:02:13,632
Where is the fix for if you end up with a problem
58
00:02:13,888 --> 00:02:15,424
And we're going to set our Max
59
00:02:15,680 --> 00:02:16,960
Be here to 14 the
60
00:02:17,472 --> 00:02:20,288
Which is basically saying we can only have one accessibility at a time
61
00:02:20,544 --> 00:02:25,152
And the sword rate is also problematic because if we let it go indefinite
62
00:02:25,408 --> 00:02:28,480
Then it could have a greater than 100% reduction
63
00:02:28,736 --> 00:02:30,528
In it's cool down time
64
00:02:30,784 --> 00:02:31,808
Which doesn't make any
65
00:02:32,064 --> 00:02:36,672
So we're going to limit these sword great let's say we can limited to
66
00:02:36,928 --> 00:02:37,696
What's the safe
67
00:02:37,952 --> 00:02:40,512
Sorry to say you can do up to 50%
68
00:02:41,024 --> 00:02:41,536
Sore
69
00:02:41,792 --> 00:02:42,304
Tagra
70
00:02:42,560 --> 00:02:45,120
So we've got there quantity defined in both are
71
00:02:45,376 --> 00:02:46,912
Axe and sword resource
72
00:02:47,424 --> 00:02:49,728
Let's go ahead and open up the upgrade manager script
73
00:02:50,752 --> 00:02:53,056
And now we need to filter out the up
74
00:02:53,312 --> 00:02:55,360
Import and this is luckily going to be
75
00:02:55,616 --> 00:02:56,128
Pretty
76
00:02:57,152 --> 00:02:59,968
So here we have the supply upgrade
77
00:03:00,480 --> 00:03:03,296
Function and this is where we going to be doing our pool
78
00:03:03,808 --> 00:03:04,320
So
79
00:03:04,576 --> 00:03:05,856
We have our upgrade
80
00:03:06,624 --> 00:03:09,696
And what would I do is really say a new plot
81
00:03:09,952 --> 00:03:11,488
And we'll say if
82
00:03:13,536 --> 00:03:15,584
Max quantity is greater than 0
83
00:03:16,096 --> 00:03:17,376
Then we want to do so
84
00:03:17,632 --> 00:03:18,400
Filtering
85
00:03:19,168 --> 00:03:20,704
So let's grab the current quantity
86
00:03:20,960 --> 00:03:22,240
By doing vodka
87
00:03:22,496 --> 00:03:23,008
Quantity
88
00:03:23,264 --> 00:03:24,032
Is equal to
89
00:03:24,544 --> 00:03:25,824
I just copy this line on
90
00:03:26,336 --> 00:03:26,848
22
91
00:03:27,360 --> 00:03:29,408
Credit upgrades upgrade.ie
92
00:03:30,176 --> 00:03:31,200
Going to say that
93
00:03:31,456 --> 00:03:34,016
So that's going to give us the current quarter the after
94
00:03:34,272 --> 00:03:34,784
Stop lying
95
00:03:35,040 --> 00:03:37,600
And then what will say is what I say
96
00:03:38,880 --> 00:03:39,392
Current
97
00:03:40,672 --> 00:03:41,440
Equal to
98
00:03:41,696 --> 00:03:44,512
So if current quantity is equal to
99
00:03:44,768 --> 00:03:48,352
Upgrade dart Max quality so this is the point at which
100
00:03:48,608 --> 00:03:49,888
We are going to want
101
00:03:50,400 --> 00:03:53,984
Remove this upgrade as an option from the
102
00:03:54,240 --> 00:03:55,264
Upgrade pool
103
00:03:55,520 --> 00:03:56,288
So the weather
104
00:03:56,544 --> 00:03:59,616
Do that is we will filter it just like we filtered
105
00:03:59,872 --> 00:04:02,176
Down here in our pick upgrades funk
106
00:04:02,688 --> 00:04:06,016
So we can do basically the same thing so I'm going to say upgrade
107
00:04:07,296 --> 00:04:07,808
Equal
108
00:04:08,320 --> 00:04:08,832
Upgrade
109
00:04:10,112 --> 00:04:11,136
War dart
110
00:04:11,392 --> 00:04:11,904
Filter
111
00:04:12,416 --> 00:04:14,720
Supply and inline function again
112
00:04:14,976 --> 00:04:15,488
Funk
113
00:04:16,000 --> 00:04:17,024
Let's say
114
00:04:17,536 --> 00:04:19,327
Google underscore upgrade
115
00:04:19,839 --> 00:04:21,375
As the argument is coming
116
00:04:21,631 --> 00:04:22,399
Inline function
117
00:04:22,655 --> 00:04:25,215
So that's our one of our pool upgrades again
118
00:04:25,471 --> 00:04:26,495
The filter function
119
00:04:26,751 --> 00:04:30,335
Works by applying the inner function for every single lol
120
00:04:30,847 --> 00:04:31,615
In the array
121
00:04:31,871 --> 00:04:34,175
And if there's a function Returns true then
122
00:04:35,455 --> 00:04:36,479
Never Returns false
123
00:04:37,247 --> 00:04:38,015
Women's heels
124
00:04:38,271 --> 00:04:39,039
And so
125
00:04:39,295 --> 00:04:40,831
We're going to be calling after
126
00:04:41,087 --> 00:04:42,367
Funk poor upgrade
127
00:04:42,623 --> 00:04:43,391
And what week
128
00:04:43,903 --> 00:04:45,695
Return true
129
00:04:45,951 --> 00:04:47,487
If the ID is not
130
00:04:47,999 --> 00:04:48,511
The current
131
00:04:49,535 --> 00:04:51,583
Right so I'm going to say return
132
00:04:52,607 --> 00:04:53,631
Upgrade
133
00:04:53,887 --> 00:04:54,655
I D
134
00:04:55,167 --> 00:04:56,703
Is not equal to
135
00:04:57,215 --> 00:05:00,543
The upgrades coming into the supply upgrade function
136
00:05:02,079 --> 00:05:07,199
Ok that updates our upgrade pool cause again the filter function Returns a new array Swift
137
00:05:07,455 --> 00:05:08,735
Override the upgrade
138
00:05:08,991 --> 00:05:12,319
And I believe that should be it so let's go ahead and
139
00:05:12,831 --> 00:05:13,599
Play a game
140
00:05:13,855 --> 00:05:16,671
And what we're going to do is we're going to see if we can
141
00:05:16,927 --> 00:05:17,951
Take the ass
142
00:05:19,743 --> 00:05:20,767
So I do the first up
143
00:05:22,303 --> 00:05:23,327
Ok I'm going to pick the
144
00:05:24,351 --> 00:05:24,863
And then
145
00:05:25,119 --> 00:05:27,167
Going to level up one more time
146
00:05:27,423 --> 00:05:28,703
Where's my new accessibility
147
00:05:28,959 --> 00:05:29,727
And see
148
00:05:32,031 --> 00:05:33,311
So I ended up with a problem
149
00:05:33,567 --> 00:05:34,847
And the problem is that
150
00:05:35,103 --> 00:05:37,663
We're gonna crash and the reason is so
151
00:05:37,919 --> 00:05:38,687
So think about
152
00:05:38,943 --> 00:05:40,991
The crash little bit a good actress
153
00:05:41,503 --> 00:05:42,015
So
154
00:05:42,271 --> 00:05:43,551
Sing For A Moment to yourself
155
00:05:43,807 --> 00:05:45,599
Why do you think work experience in a car
156
00:05:46,111 --> 00:05:47,391
What's review the code
157
00:05:47,647 --> 00:05:48,927
So what is the code DO
158
00:05:49,183 --> 00:05:53,279
Well we're filtering out some upgrades right but then we're also running pic
159
00:05:53,535 --> 00:05:54,047
Upgrades
160
00:05:54,303 --> 00:05:56,351
So think about yourself a little
161
00:05:56,607 --> 00:05:57,631
Here's Leanne
162
00:05:57,887 --> 00:05:58,911
Pick upgrades
163
00:05:59,167 --> 00:06:00,447
Always
164
00:06:00,703 --> 00:06:01,471
ASDA cheese
165
00:06:01,727 --> 00:06:02,239
2
166
00:06:02,495 --> 00:06:03,519
Because we've hardcore
167
00:06:03,775 --> 00:06:04,287
To hear
168
00:06:04,543 --> 00:06:09,151
The problem is once we filtered out the axe in since we only have 2 upgrades total
169
00:06:09,919 --> 00:06:11,199
13th zodiac
170
00:06:11,455 --> 00:06:13,503
There's only one upgrade left to choose from
171
00:06:13,759 --> 00:06:15,807
Now that would be fine x x
172
00:06:16,319 --> 00:06:20,927
Remember where filtering the upgrades as we pick them in the pick-up grades and May
173
00:06:21,439 --> 00:06:26,815
And so we're actually ending up with an empty array after it picks the first sort of
174
00:06:27,327 --> 00:06:27,839
Why
175
00:06:28,095 --> 00:06:30,911
Because it's picking a random element from the filter upgrade
176
00:06:31,423 --> 00:06:33,471
Adding that as an option
177
00:06:33,727 --> 00:06:34,495
2 hour
178
00:06:34,751 --> 00:06:37,055
You ice cream by adding it to this
179
00:06:37,311 --> 00:06:40,639
And then is re-assigning the still upgrade by removing
180
00:06:40,895 --> 00:06:41,919
That option
181
00:06:42,175 --> 00:06:42,687
From
182
00:06:43,199 --> 00:06:43,711
The
183
00:06:44,735 --> 00:06:47,039
And sold by the time we hit the second iteration
184
00:06:47,551 --> 00:06:49,599
This pic random is returning now
185
00:06:49,855 --> 00:06:51,135
Because there are no Ella
186
00:06:51,647 --> 00:06:54,207
Unfortunately the fix for this is going to be rather simple
187
00:06:54,463 --> 00:06:55,999
We just simply have to check
188
00:06:56,511 --> 00:06:58,303
Chosen upgrade
189
00:06:58,815 --> 00:06:59,839
Is equal to null
190
00:07:01,119 --> 00:07:02,143
We're going to
191
00:07:02,399 --> 00:07:02,911
Warwick
192
00:07:04,191 --> 00:07:09,567
And so what brake does is it ends the function or the for loop execution so this could be
193
00:07:10,591 --> 00:07:11,615
10000
194
00:07:13,407 --> 00:07:16,735
Chooses on Noel option on iteration 2
195
00:07:16,991 --> 00:07:19,807
It won't not do the rest of the 9th I
196
00:07:21,087 --> 00:07:22,367
And choose an upgrade
197
00:07:22,879 --> 00:07:25,439
I will only be now if they started up
198
00:07:25,695 --> 00:07:26,719
Here's my
199
00:07:26,975 --> 00:07:27,999
So if they're
200
00:07:28,255 --> 00:07:30,815
At least one element it will never be no
201
00:07:31,071 --> 00:07:31,839
But
202
00:07:32,863 --> 00:07:33,375
It can be
203
00:07:33,631 --> 00:07:35,167
So that should be the fix
204
00:07:35,423 --> 00:07:37,727
Let's Run the game again in make sure that
205
00:07:37,983 --> 00:07:38,495
Is working
206
00:07:38,751 --> 00:07:39,263
As we want
207
00:07:41,055 --> 00:07:42,079
Ok I'm going to pick my ass
208
00:07:44,383 --> 00:07:45,151
And then
209
00:07:45,663 --> 00:07:47,199
So now that I've levelled up again
210
00:07:47,711 --> 00:07:48,479
You can see the
211
00:07:48,735 --> 00:07:50,783
My only option is to increase the sword
212
00:07:51,039 --> 00:07:51,551
Now
213
00:07:51,807 --> 00:07:53,087
There is a problem here
214
00:07:53,599 --> 00:07:56,415
And we will probably address it later
215
00:07:56,671 --> 00:07:57,183
If you
216
00:07:57,439 --> 00:07:58,719
Keep playing a game until
217
00:07:58,975 --> 00:07:59,743
Required
218
00:08:00,255 --> 00:08:01,279
Sword upgrades
219
00:08:01,535 --> 00:08:02,815
Then what will happen
220
00:08:03,327 --> 00:08:03,839
Is
221
00:08:04,095 --> 00:08:07,679
The game of soft lock because there will be no options presented
222
00:08:07,935 --> 00:08:10,239
To the UI element that is pausing the sky
223
00:08:10,495 --> 00:08:12,287
We will address that later
224
00:08:12,543 --> 00:08:15,615
But for now we've got a couple of errors being printed in a console
225
00:08:16,127 --> 00:08:16,639
And
226
00:08:16,895 --> 00:08:18,943
These errors are telling us that we can't
227
00:08:19,455 --> 00:08:21,247
Values from an empty array
228
00:08:21,503 --> 00:08:24,063
So if we double click on this error in the console
229
00:08:24,319 --> 00:08:26,111
You're take us to the upgrade manager
230
00:08:26,367 --> 00:08:28,927
It looks like we just need one more
231
00:08:29,183 --> 00:08:29,695
Check
232
00:08:29,951 --> 00:08:32,767
Or I guess we should probably change this checks
233
00:08:33,023 --> 00:08:34,559
This chat technically works but
234
00:08:34,815 --> 00:08:37,631
It's printing errors to the console which means it doesn't like the way they do
235
00:08:38,143 --> 00:08:41,215
So instead of doing that what we're going to do instead as we're going to
236
00:08:41,471 --> 00:08:42,751
Write a different estate
237
00:08:43,007 --> 00:08:44,799
If filter upgrades
238
00:08:45,311 --> 00:08:45,823
Dart
239
00:08:46,079 --> 00:08:47,103
Size is
240
00:08:47,359 --> 00:08:49,407
Equal to 0 then we're going
241
00:08:50,175 --> 00:08:50,943
And we can remove
242
00:08:52,735 --> 00:08:54,271
Directions stop printing
243
00:08:54,527 --> 00:08:55,295
Clothes airer
244
00:08:55,807 --> 00:08:57,599
Ok thanks I just got my second
245
00:08:57,855 --> 00:09:00,671
Upgrade here in a minute longer seeing any errors
246
00:09:00,927 --> 00:09:01,695
Next to the console
247
00:09:01,951 --> 00:09:05,535
And that should be good now one final thing that I want to do
248
00:09:05,791 --> 00:09:11,935
Before ending this lesson is the axis or little bit too frequent so I'm going to control shift
249
00:09:12,191 --> 00:09:15,519
I'm going to open up my accessibility controller
250
00:09:15,775 --> 00:09:16,543
Right here
251
00:09:17,055 --> 00:09:17,823
And I'm going to click
252
00:09:18,079 --> 00:09:18,591
Timer
253
00:09:18,847 --> 00:09:20,639
I'm just going to up the wait time for something
254
00:09:20,895 --> 00:09:22,943
Next 3.5 which I think is a little bit
255
00:09:23,455 --> 00:09:23,967
Reason
256
00:09:24,735 --> 00:09:26,015
And then I'm going to go ahead and run it
257
00:09:26,271 --> 00:09:27,551
And let's see
258
00:09:27,807 --> 00:09:29,343
How that feels one side
259
00:09:30,367 --> 00:09:33,695
That feels a little bit less soapy to me
260
00:09:33,951 --> 00:09:35,231
Engine has plenty of room
261
00:09:35,487 --> 00:09:37,791
To improve the access efficacy
262
00:09:38,047 --> 00:09:39,071
With upgrades
16887
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.