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
Now that we have another Enemy we need to make this enemy able to spawn as the game
2
00:00:05,632 --> 00:00:06,144
Progressive
3
00:00:06,656 --> 00:00:11,008
Now this is going to be a little bit advanced were going to
4
00:00:11,520 --> 00:00:13,312
Create a loot table
5
00:00:13,568 --> 00:00:14,080
Which
6
00:00:14,336 --> 00:00:14,848
Is 9
7
00:00:15,104 --> 00:00:19,968
Going to be used for loot essentially what working a create is a weighted random
8
00:00:20,224 --> 00:00:20,736
Table
9
00:00:20,992 --> 00:00:23,040
And we're going to be able to do is
10
00:00:23,552 --> 00:00:26,112
Control how likely it is
11
00:00:26,368 --> 00:00:29,184
That's something we'll be picked a randomly from a list
12
00:00:29,696 --> 00:00:34,560
And the reason we're going to do that is because let's say that we go our enemy managers
13
00:00:35,072 --> 00:00:38,656
Let's say that we simply export in a rave pack scenes
14
00:00:38,912 --> 00:00:39,424
And said
15
00:00:39,680 --> 00:00:44,032
Just pick a random scene from this array and use that as the enemy
16
00:00:44,288 --> 00:00:49,920
The problem is that if we get two adding three or four or five enemies
17
00:00:50,176 --> 00:00:50,688
To the game
18
00:00:50,944 --> 00:00:53,504
They're all going to have an equal chance
19
00:00:54,016 --> 00:00:55,040
Of being Pig
20
00:00:55,552 --> 00:00:56,320
And that
21
00:00:56,832 --> 00:01:00,141
May not be in the best interests of the balance of the game
22
00:01:00,143 --> 00:01:02,491
Subtitled by
online-courses.club
We compress knowledge for you!
23
00:01:02,492 --> 00:01:01,952
You may want to spawn
24
00:01:02,208 --> 00:01:06,560
Less of the weakest anime as the game goes on in Moor of the stronger one
25
00:01:06,816 --> 00:01:11,168
Right so we can control that by creating a weighted table or a loot table
26
00:01:11,424 --> 00:01:14,240
And again not necessarily used for Luke just you
27
00:01:14,496 --> 00:01:15,008
The tube
28
00:01:15,264 --> 00:01:17,568
Values and have more control over
29
00:01:17,824 --> 00:01:18,592
The random
30
00:01:19,104 --> 00:01:24,992
So we're going to create a script that is going to represent our awaited table and then we're going to
31
00:01:25,248 --> 00:01:26,016
Use that
32
00:01:26,272 --> 00:01:27,552
For our enemy man
33
00:01:28,320 --> 00:01:32,416
So let's go ahead and create a new folder under the rest
34
00:01:32,672 --> 00:01:34,208
Route here in the filesystem
35
00:01:34,720 --> 00:01:37,024
How to create a new folder Liscard scripts
36
00:01:38,048 --> 00:01:40,864
And under scripts let's create a new script
37
00:01:41,120 --> 00:01:42,656
And let's call this script
38
00:01:42,912 --> 00:01:43,680
Waiting
39
00:01:44,448 --> 00:01:45,216
Underscore
40
00:01:45,472 --> 00:01:46,240
Table
41
00:01:46,496 --> 00:01:47,008
GD
42
00:01:47,520 --> 00:01:51,616
Create a let's go ahead and double click waiting table that gd200
43
00:01:51,872 --> 00:01:55,712
We don't need to extend anything so let's get rid of this line and replace it with
44
00:01:55,968 --> 00:01:57,760
Class underscore name
45
00:01:58,272 --> 00:01:58,784
Waiting
46
00:01:59,040 --> 00:01:59,552
Table
47
00:01:59,808 --> 00:02:00,576
Impact
48
00:02:01,088 --> 00:02:01,856
It's just like that
49
00:02:02,112 --> 00:02:06,720
Ok we're going to need a variable which is going to represent our internal array
50
00:02:06,976 --> 00:02:10,048
And so we're gonna save our items and this is going to be a ray
51
00:02:10,304 --> 00:02:11,072
Of time
52
00:02:12,352 --> 00:02:14,656
An array of objects
53
00:02:15,168 --> 00:02:15,936
Piers Morgan
54
00:02:16,704 --> 00:02:18,240
Let's create a function
55
00:02:18,496 --> 00:02:19,008
Call
56
00:02:19,264 --> 00:02:20,800
Add underscore
57
00:02:22,336 --> 00:02:22,848
Ok
58
00:02:23,104 --> 00:02:27,968
Then we're going to take the first argument is our item in the second argument is going to be our way
59
00:02:28,224 --> 00:02:29,248
Which is an integer
60
00:02:29,760 --> 00:02:32,320
And how this is going to work as we're going to
61
00:02:32,576 --> 00:02:34,368
Take that items array
62
00:02:34,624 --> 00:02:35,392
We're going to
63
00:02:35,904 --> 00:02:36,672
A pen
64
00:02:36,928 --> 00:02:38,976
A new dictionary item
65
00:02:39,232 --> 00:02:41,536
And we're going to call this idea
66
00:02:42,048 --> 00:02:43,072
I don't like snow
67
00:02:43,328 --> 00:02:44,352
And wait
68
00:02:46,912 --> 00:02:47,424
Wait
69
00:02:47,680 --> 00:02:48,704
Like cell
70
00:02:49,472 --> 00:02:52,544
Summer adding in object a dictionary
71
00:02:52,800 --> 00:02:54,080
With the key item
72
00:02:54,336 --> 00:02:57,408
That represents our item in this can be any type that we were
73
00:02:57,920 --> 00:03:00,224
Sonar case where can I use it for Pat Simms
74
00:03:00,736 --> 00:03:03,040
This is just going to be a connect
75
00:03:04,576 --> 00:03:10,720
And then wait is going to be an integer always now before I go any further this items could potentially been also
76
00:03:10,976 --> 00:03:12,768
Just going to initialise items
77
00:03:13,024 --> 00:03:13,536
Up here
78
00:03:13,792 --> 00:03:14,560
To be an MP
79
00:03:16,608 --> 00:03:19,680
Alright son now is create a function called pick underscore
80
00:03:19,936 --> 00:03:20,448
Adam
81
00:03:21,472 --> 00:03:25,568
This is where the bulk of our logic about picking items is going to go
82
00:03:25,824 --> 00:03:29,408
The way it works is you iterate over every element in the array
83
00:03:29,664 --> 00:03:33,760
You keep track of the sum of the weights as you iterate
84
00:03:34,016 --> 00:03:36,832
And then you'll see if a random integer that you pick
85
00:03:37,344 --> 00:03:39,648
Is less than or equal to the sum
86
00:03:40,672 --> 00:03:42,208
Memes that you should pick that up
87
00:03:42,464 --> 00:03:45,024
So I'm going to go over that again as write this
88
00:03:45,280 --> 00:03:48,608
That's the basic idea so you essentially keep a running total of all the way
89
00:03:48,864 --> 00:03:49,376
Calculate
90
00:03:49,632 --> 00:03:50,656
Until
91
00:03:50,912 --> 00:03:51,680
You meet
92
00:03:51,936 --> 00:03:53,472
Or exceed
93
00:03:53,728 --> 00:03:56,544
The weight that is randomly chosen at the beginning
94
00:03:56,800 --> 00:03:57,568
Solicitor
95
00:03:58,080 --> 00:03:58,592
Bar
96
00:03:58,848 --> 00:03:59,616
Chosen
97
00:04:00,128 --> 00:04:01,152
Underscore wait
98
00:04:01,664 --> 00:04:02,688
Is equal to
99
00:04:03,200 --> 00:04:08,576
We want to do randai Range which generate a random integer between a given range
100
00:04:08,832 --> 00:04:10,112
And this is
101
00:04:10,368 --> 00:04:11,392
Inclusive
102
00:04:11,648 --> 00:04:13,184
So what that means is that
103
00:04:13,696 --> 00:04:16,000
Wearing a supply one as the first one
104
00:04:16,256 --> 00:04:19,583
Anna last weight is going to be our wait some
105
00:04:19,839 --> 00:04:20,607
So wait
106
00:04:20,863 --> 00:04:21,887
Underscore some
107
00:04:22,399 --> 00:04:24,447
And this is inclusive of this is 100
108
00:04:24,703 --> 00:04:25,215
Then
109
00:04:25,471 --> 00:04:28,543
It will pick anywhere between 1 and 1
110
00:04:29,055 --> 00:04:30,079
Which includes one
111
00:04:30,591 --> 00:04:31,615
No we don't have the sweets
112
00:04:32,127 --> 00:04:36,223
White because we need to keep track of that so I could top underneath items array
113
00:04:36,479 --> 00:04:38,271
Let's create a white sun
114
00:04:39,295 --> 00:04:40,831
And initialised to zero
115
00:04:41,599 --> 00:04:43,391
And then whenever we call ad
116
00:04:43,903 --> 00:04:45,439
Let's incremental weights
117
00:04:45,695 --> 00:04:46,463
So wait
118
00:04:46,719 --> 00:04:47,487
Some
119
00:04:47,743 --> 00:04:49,023
Plus equals
120
00:04:49,279 --> 00:04:49,791
The way
121
00:04:50,047 --> 00:04:51,327
That were passing in
122
00:04:51,839 --> 00:04:56,447
So now we calculate your weight some this will stay in sync with the with all the weight
123
00:04:56,703 --> 00:04:57,215
We've added
124
00:04:57,471 --> 00:04:58,239
For each
125
00:04:58,495 --> 00:04:59,519
So again
126
00:04:59,775 --> 00:05:01,823
Each item has an individual with
127
00:05:02,079 --> 00:05:03,103
But we're keeping track
128
00:05:03,359 --> 00:05:05,151
The Torah wait because that's what we're going to
129
00:05:05,407 --> 00:05:05,919
To pick
130
00:05:06,175 --> 00:05:08,479
The random Range store picking between 1 and 1
131
00:05:08,991 --> 00:05:11,807
Now we need to keep track of a
132
00:05:12,063 --> 00:05:12,831
Iteration
133
00:05:13,087 --> 00:05:13,599
Some
134
00:05:14,111 --> 00:05:17,951
So let's create a variable interaction some and initialised that 20
135
00:05:18,463 --> 00:05:19,743
And then we're going to do for work
136
00:05:20,255 --> 00:05:21,279
For item
137
00:05:21,535 --> 00:05:22,815
In item
138
00:05:23,327 --> 00:05:25,375
So this is going to iterate over this array
139
00:05:25,631 --> 00:05:29,215
Pulling out each one of these dictionary objects in Division
140
00:05:29,727 --> 00:05:33,567
And what we're going to do is work going to increment our generation some
141
00:05:33,823 --> 00:05:35,871
Buy items that way
142
00:05:37,151 --> 00:05:37,919
Just like so
143
00:05:38,175 --> 00:05:38,943
And then
144
00:05:39,199 --> 00:05:40,735
What we're going to do is we're going to check
145
00:05:40,991 --> 00:05:42,271
Chosen
146
00:05:42,783 --> 00:05:44,831
Is less than or equal to
147
00:05:45,087 --> 00:05:46,623
That iterations
148
00:05:47,135 --> 00:05:48,415
The NED memes that we've
149
00:05:48,671 --> 00:05:50,975
Landed on the item that we should return
150
00:05:51,231 --> 00:05:51,999
In this case
151
00:05:52,511 --> 00:05:53,791
I'm going to return
152
00:05:54,047 --> 00:05:54,815
Item
153
00:05:55,071 --> 00:05:57,887
Dot I know that's a little bit confusing
154
00:05:58,143 --> 00:06:01,983
This item right here represents this dictionary object
155
00:06:02,239 --> 00:06:04,543
And then this item represents that
156
00:06:05,823 --> 00:06:06,591
Now I believe
157
00:06:06,847 --> 00:06:10,175
This is actually incorrect so this is the way that you would reference
158
00:06:10,431 --> 00:06:11,967
Properties within an object
159
00:06:12,479 --> 00:06:15,807
But this is not the same type of undertakers addiction
160
00:06:16,063 --> 00:06:17,343
So we actually need to
161
00:06:17,599 --> 00:06:19,391
Used to reference the keys with
162
00:06:19,647 --> 00:06:21,183
Brackets like so
163
00:06:21,439 --> 00:06:22,207
And then
164
00:06:23,231 --> 00:06:24,255
In quote wait
165
00:06:24,511 --> 00:06:25,791
So this is how
166
00:06:26,303 --> 00:06:27,839
We should reference that dictionary
167
00:06:29,119 --> 00:06:32,703
So now we've got our pick item so again
168
00:06:32,959 --> 00:06:37,311
Or basically just choosing a weight that is between 1 and wait some inclusive
169
00:06:37,567 --> 00:06:43,711
Keeping track of the current iteration some by adding each individual wait as we iterate over
170
00:06:43,967 --> 00:06:44,479
Adam
171
00:06:44,991 --> 00:06:47,551
But if I chosen wait that we chose
172
00:06:47,807 --> 00:06:50,111
Here is Leicester equal to our Generation song
173
00:06:50,367 --> 00:06:52,927
Just going to stop and return that
174
00:06:53,439 --> 00:06:54,463
So you can imagine
175
00:06:54,719 --> 00:06:55,999
What should we have one either
176
00:06:56,255 --> 00:06:56,767
Which is
177
00:06:57,023 --> 00:06:58,303
Has a weight of 10
178
00:06:58,559 --> 00:07:01,119
If we choose let's a five
179
00:07:01,375 --> 00:07:02,143
Azhar chosen
180
00:07:02,399 --> 00:07:02,911
Then
181
00:07:03,423 --> 00:07:05,471
This is going to return true and return at item
182
00:07:05,727 --> 00:07:08,287
If we choose 11 then there's I am knocking
183
00:07:08,799 --> 00:07:11,615
Play we had a second item in addition to
184
00:07:11,871 --> 00:07:12,639
Weight of 10
185
00:07:12,895 --> 00:07:14,175
The had a weight of a hundred
186
00:07:14,687 --> 00:07:16,735
So our total weight is 110
187
00:07:16,991 --> 00:07:20,831
And if we shows 11 in that scenario then we would choose the item
188
00:07:21,087 --> 00:07:22,111
Dad has the way
189
00:07:22,879 --> 00:07:23,647
How to make
190
00:07:23,903 --> 00:07:25,951
Should make more sense as we
191
00:07:26,207 --> 00:07:26,719
Continue
192
00:07:27,487 --> 00:07:29,279
So that are away today table
193
00:07:29,535 --> 00:07:30,559
Now how do I use
194
00:07:31,071 --> 00:07:34,399
What's open a bar enemy manager script from the main here
195
00:07:34,655 --> 00:07:37,215
And we have our basic enemies
196
00:07:37,727 --> 00:07:38,239
Here
197
00:07:38,495 --> 00:07:40,543
What I'm going to do is I am going to
198
00:07:41,055 --> 00:07:42,591
Create another export variable
199
00:07:43,615 --> 00:07:45,407
Cold wizard anime scene
200
00:07:46,687 --> 00:07:48,223
And it's going to be uptight packs
201
00:07:49,503 --> 00:07:53,087
No I'm going to click into the enemy manager scene with this button here
202
00:07:53,343 --> 00:07:54,367
To go to the scene
203
00:07:54,623 --> 00:07:57,183
Where I can drag over the wizard anime scene
204
00:07:57,439 --> 00:07:59,487
Here so I'm going to search for my file system
205
00:07:59,743 --> 00:08:00,767
4 wizard
206
00:08:01,279 --> 00:08:01,791
Scene
207
00:08:02,303 --> 00:08:03,583
And I'm just going to go ahead and drag
208
00:08:04,863 --> 00:08:07,167
Ok so going back to the enemy manager
209
00:08:07,679 --> 00:08:08,703
We have these to see
210
00:08:09,215 --> 00:08:11,007
Now what do we want to Akon
211
00:08:11,519 --> 00:08:12,287
We want
212
00:08:13,567 --> 00:08:16,383
To start spawning after some
213
00:08:16,639 --> 00:08:17,151
Time
214
00:08:17,407 --> 00:08:20,223
So using our loot table how can we do
215
00:08:20,479 --> 00:08:22,015
Or are waiting tables
216
00:08:22,527 --> 00:08:25,087
So what I'm going to do is I'm going to create a new weighted table
217
00:08:25,343 --> 00:08:25,855
Bye
218
00:08:26,111 --> 00:08:27,903
Create a new variable I'm going so far
219
00:08:28,159 --> 00:08:28,927
Waiting
220
00:08:29,439 --> 00:08:29,951
Table
221
00:08:30,207 --> 00:08:32,255
Actually let's call it enemy table
222
00:08:32,767 --> 00:08:33,535
Is equal to
223
00:08:34,047 --> 00:08:35,839
Where did table.new
224
00:08:36,351 --> 00:08:38,399
So this is how you create a new instance
225
00:08:39,423 --> 00:08:41,215
That class that we define
226
00:08:41,471 --> 00:08:42,751
In our waiting tables
227
00:08:43,263 --> 00:08:45,567
And in the ready method what we're going to do
228
00:08:45,823 --> 00:08:48,127
Is we're going to say enemy table
229
00:08:48,383 --> 00:08:49,407
Add item
230
00:08:49,919 --> 00:08:55,807
And we're going to pass in our basic anime seen as the item with a weight of 10
231
00:08:58,111 --> 00:08:58,879
Ok perfect
232
00:08:59,647 --> 00:09:01,951
So let's go down to on timer timeout
233
00:09:02,207 --> 00:09:05,791
And in here instead of referencing a basic anime scene
234
00:09:06,047 --> 00:09:06,815
Directly
235
00:09:07,071 --> 00:09:08,095
Let's do
236
00:09:08,351 --> 00:09:10,399
Another variable above the end
237
00:09:10,911 --> 00:09:12,959
Enemy underscore scene
238
00:09:13,215 --> 00:09:14,239
Is equal to
239
00:09:14,495 --> 00:09:15,007
Wait
240
00:09:15,519 --> 00:09:16,543
Table or song
241
00:09:17,055 --> 00:09:18,079
Anime table
242
00:09:19,359 --> 00:09:20,127
Pick
243
00:09:21,151 --> 00:09:22,943
And this is going to return
244
00:09:23,199 --> 00:09:26,015
One of the Pack seems that we configured in our table
245
00:09:27,807 --> 00:09:30,367
And in this case it's just going to be the rat and
246
00:09:30,879 --> 00:09:33,951
So here make sure to replace this basic enemy scene
247
00:09:34,207 --> 00:09:35,999
Are you on timer time out to
248
00:09:36,511 --> 00:09:37,791
Anime sing instead
249
00:09:39,071 --> 00:09:40,095
And that should be good
250
00:09:40,351 --> 00:09:42,399
So if we did everything correctly the rat
251
00:09:42,911 --> 00:09:44,191
Should still be
252
00:09:44,703 --> 00:09:45,215
Spawning
253
00:09:45,471 --> 00:09:46,239
And actually
254
00:09:46,495 --> 00:09:49,567
This basic anime scene here in my manager
255
00:09:49,823 --> 00:09:51,103
Is still set to Wizard
256
00:09:51,359 --> 00:09:54,431
So let's go ahead and search for the basic enemy here
257
00:09:54,687 --> 00:09:55,711
And drag it over
258
00:09:55,967 --> 00:09:57,247
Into the first light here
259
00:09:57,503 --> 00:09:59,295
So now we've got basic enemy
260
00:09:59,551 --> 00:10:00,588
And The Wizard
261
00:10:00,589 --> 00:10:02,889
Subtitled by
online-courses.club
We compress knowledge for you!
262
00:10:02,889 --> 00:10:03,391
So let's Run the game and make sure that work
263
00:10:04,671 --> 00:10:06,975
So everything's the working which means that are way
264
00:10:07,231 --> 00:10:07,999
Table is working
265
00:10:08,255 --> 00:10:10,047
Now how do we make the wizard store
266
00:10:10,303 --> 00:10:12,095
Spawning later in the game
267
00:10:12,351 --> 00:10:15,679
So we've got this on Arena difficulty increased
268
00:10:15,935 --> 00:10:17,215
So very simply
269
00:10:17,471 --> 00:10:19,007
What we can do in this
270
00:10:19,263 --> 00:10:20,287
Signal handler
271
00:10:20,543 --> 00:10:21,823
Is we can say something like
272
00:10:22,079 --> 00:10:22,591
Yes
273
00:10:23,871 --> 00:10:24,639
Arena
274
00:10:25,407 --> 00:10:26,943
Underscore difficulty
275
00:10:27,199 --> 00:10:28,735
Is equal to 6
276
00:10:29,503 --> 00:10:31,807
So that's 30 seconds into the game
277
00:10:32,575 --> 00:10:34,879
What we're going to do is we're going to say
278
00:10:35,135 --> 00:10:36,159
Anime table
279
00:10:38,975 --> 00:10:41,279
And we are going to say the item is H
280
00:10:41,535 --> 00:10:42,303
Wizard
281
00:10:42,559 --> 00:10:43,327
Anime scene
282
00:10:43,583 --> 00:10:44,607
And we're going to give it away
283
00:10:44,863 --> 00:10:45,375
Top 20
284
00:10:46,655 --> 00:10:52,031
So you see how this is working we're doing this wizard my seen a wait that's greater than the rat
285
00:10:52,543 --> 00:10:54,335
To make it appear more calm
286
00:10:54,847 --> 00:10:58,175
And so since the total weight by the time we add the wizard is going
287
00:10:58,431 --> 00:10:58,943
30
288
00:10:59,199 --> 00:11:02,015
There's actually going to be a 33.3
289
00:11:02,271 --> 00:11:04,063
Percent chance of the rat spot
290
00:11:04,319 --> 00:11:06,623
And a 66.6% chance
291
00:11:06,879 --> 00:11:07,903
Of the wizards
292
00:11:08,415 --> 00:11:09,183
And then we can
293
00:11:09,439 --> 00:11:12,767
Weekend extended this further with other any type so we could say
294
00:11:13,023 --> 00:11:13,791
LS
295
00:11:14,047 --> 00:11:14,815
Arena
296
00:11:15,327 --> 00:11:16,351
Difficulty
297
00:11:16,607 --> 00:11:17,631
Is equal to
298
00:11:18,143 --> 00:11:19,679
12 which would be 1-minute
299
00:11:19,935 --> 00:11:21,727
Then we can add another Enemy
300
00:11:21,983 --> 00:11:22,495
Right
301
00:11:24,543 --> 00:11:25,823
But we're not going to do that
302
00:11:26,079 --> 00:11:28,639
And so we can change this number later bye
303
00:11:28,895 --> 00:11:32,991
Basically what I should see is by the time 30 seconds rolls around
304
00:11:33,247 --> 00:11:36,063
Wizards should start spawning in addition to
305
00:11:36,575 --> 00:11:37,087
Surat
306
00:11:37,343 --> 00:11:39,135
And here comes some wizards
307
00:11:40,415 --> 00:11:42,207
And I've got wizards coming out me
308
00:11:42,463 --> 00:11:44,767
That should be the majority of the things that are pink
309
00:11:45,023 --> 00:11:46,559
Now the majority of the enemies
310
00:11:46,815 --> 00:11:48,863
Yes I look at all these wizards coming in now
311
00:11:50,143 --> 00:11:53,983
There are still here at mixed in but it will mostly be wizards now
312
00:11:54,495 --> 00:11:57,055
And now we've got multiple enemy time
313
00:11:57,311 --> 00:11:57,823
Work
20317
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.