All language subtitles for 08. Creating the First Sword Ability

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian Download
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
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:06,400 It's time to work on our first ability now as you probably already know a key feature 2 00:00:06,912 --> 00:00:08,448 These survivors 3 00:00:08,704 --> 00:00:09,216 Game 4 00:00:09,472 --> 00:00:11,008 Is that your ability 5 00:00:11,264 --> 00:00:12,032 Autotech 6 00:00:12,288 --> 00:00:15,360 You do not actually control any of your abilities at least 7 00:00:15,616 --> 00:00:16,896 In vampire Survivor 8 00:00:17,408 --> 00:00:18,688 I'm sure there are other games 9 00:00:18,944 --> 00:00:20,736 That's slightly tweet dead formula 10 00:00:20,992 --> 00:00:23,808 The working and go with Dad's style where you're 11 00:00:24,064 --> 00:00:25,856 Abilities are going to order it 12 00:00:26,368 --> 00:00:27,904 And you upgrade them over time 13 00:00:28,160 --> 00:00:31,744 Until the 1st of February that were going to implement is going to be a 14 00:00:32,256 --> 00:00:34,048 Quote on quote melee attack 15 00:00:34,304 --> 00:00:35,328 That happens on a 16 00:00:35,584 --> 00:00:36,608 Specific 17 00:00:37,120 --> 00:00:39,424 So I don't go over to your 18 00:00:39,680 --> 00:00:40,448 Tilemap 19 00:00:40,704 --> 00:00:45,056 And let's take a look at it and see what we could use as this a bill 20 00:00:45,312 --> 00:00:47,616 It's going to be a melee attack 21 00:00:47,872 --> 00:00:49,664 I'm thinking that we can take 22 00:00:49,920 --> 00:00:51,456 This sword right here 23 00:00:51,968 --> 00:00:58,112 And have it pop into existence / at something and then disappear and then have that go on 24 00:00:58,368 --> 00:00:58,880 Interval 25 00:00:59,136 --> 00:01:00,909 And then of course we'll have upgrades that will out 26 00:01:00,911 --> 00:01:03,259 Subtitled by online-courses.club We compress knowledge for you! 27 00:01:03,260 --> 00:01:06,304 How to increase the Frequency in a damage of that but let's go ahead and do that 28 00:01:06,560 --> 00:01:08,608 No I don't think that you should 29 00:01:08,864 --> 00:01:11,936 Stray from the abilities that I'll be designing 30 00:01:12,192 --> 00:01:12,704 I think 31 00:01:12,960 --> 00:01:16,288 It will be best if you use the same Sprite that I do 32 00:01:16,544 --> 00:01:20,128 Just because I think you're going to be using a few of these and 33 00:01:20,384 --> 00:01:21,152 It may be 34 00:01:21,408 --> 00:01:22,176 Confusing 35 00:01:22,432 --> 00:01:26,784 When we start getting into new abilities if you've strayed a little bit from what I've done 36 00:01:27,040 --> 00:01:28,320 I'm going to find the sword 37 00:01:28,576 --> 00:01:31,648 And it looks like it's tile 0104 38 00:01:32,160 --> 00:01:34,720 Remind me to do as I'm actually just going to copy this file 39 00:01:34,976 --> 00:01:36,768 And then I'm going to 40 00:01:37,024 --> 00:01:40,864 Go into my file system right-click and say open in file manager 41 00:01:41,120 --> 00:01:44,192 This is a nice easy way that you can open up your 42 00:01:44,704 --> 00:01:45,472 Project folder 43 00:01:45,728 --> 00:01:47,520 In your native 44 00:01:47,776 --> 00:01:49,056 File Explorer 45 00:01:49,568 --> 00:01:51,360 And I'm just going to go ahead and 46 00:01:51,616 --> 00:01:53,920 Put that tile 0104 47 00:01:54,176 --> 00:01:55,456 In the root directory 48 00:01:55,712 --> 00:01:56,992 So there it is 49 00:01:57,248 --> 00:02:00,320 Straight forward going to right click to rename this 50 00:02:00,576 --> 00:02:01,856 And we're going to call it 51 00:02:02,624 --> 00:02:03,136 Sword 52 00:02:03,392 --> 00:02:08,512 I was going to head and create a new scenes organ hit control n 53 00:02:10,048 --> 00:02:13,632 Let's create a root node of 2D scenes if you click this button 54 00:02:13,888 --> 00:02:14,912 It'll make it 55 00:02:15,168 --> 00:02:16,448 No 2D by default 56 00:02:16,704 --> 00:02:19,008 We're going to call this sword ability 57 00:02:19,776 --> 00:02:21,312 And we're going to save this 58 00:02:21,568 --> 00:02:22,848 Go to Simms 59 00:02:23,104 --> 00:02:27,712 And where can I do something a little bit different here I'm going to create a new folder called ability 60 00:02:28,992 --> 00:02:33,088 And then we're going to create a new folder inside a vehicle 61 00:02:33,344 --> 00:02:33,856 Sorted 62 00:02:35,392 --> 00:02:36,416 And then we're going to close 63 00:02:36,928 --> 00:02:40,000 So what you should have is you should have scenes ability 64 00:02:40,256 --> 00:02:41,024 Sword ability 65 00:02:41,280 --> 00:02:42,560 And then sword ability 66 00:02:42,816 --> 00:02:46,144 And what does go ahead and put all of our abilities in there 67 00:02:46,400 --> 00:02:47,168 Ok so 68 00:02:47,680 --> 00:02:51,520 The weather working approach this is were going to make each ability 69 00:02:51,776 --> 00:02:52,544 Phone scene 70 00:02:53,056 --> 00:02:55,616 I'm going to spawn it into the game when it's 71 00:02:55,872 --> 00:02:58,176 Respond will create a 72 00:02:58,688 --> 00:02:59,712 Set of code 73 00:02:59,968 --> 00:03:01,248 Responsible for managing 74 00:03:01,504 --> 00:03:04,320 Where my ability should be used in creative 75 00:03:04,832 --> 00:03:05,856 And upgraded and 76 00:03:06,624 --> 00:03:10,720 What's go ahead in a new child node with ctrl a 77 00:03:10,976 --> 00:03:13,024 Let's find a Sprite 2D 78 00:03:13,280 --> 00:03:18,144 And what you can do that's really nice when you have the filesystem tab up as you can actually 79 00:03:18,400 --> 00:03:20,704 Use this filter files to search 80 00:03:20,960 --> 00:03:21,984 Profile so 81 00:03:22,240 --> 00:03:23,264 I'm going to 82 00:03:23,520 --> 00:03:25,056 Search for sword 83 00:03:26,080 --> 00:03:27,872 That's a nice quick way of finding the sword 84 00:03:28,128 --> 00:03:30,944 I'm going to go and drag that into the store ability swords 85 00:03:31,200 --> 00:03:31,968 Organise 86 00:03:32,480 --> 00:03:34,016 With the scene 87 00:03:34,528 --> 00:03:37,856 I'm gonna take that texture and drag it over to the straight to the 88 00:03:38,368 --> 00:03:39,904 And there's our sword 89 00:03:40,416 --> 00:03:42,208 This orange cross 90 00:03:42,464 --> 00:03:43,744 In the middle that you can see 91 00:03:44,256 --> 00:03:44,768 So I'm just going 92 00:03:45,280 --> 00:03:47,072 Given that that warrant cross right there 93 00:03:47,328 --> 00:03:48,352 That represent 94 00:03:48,608 --> 00:03:52,192 The pivot offset that is the position around which 95 00:03:53,216 --> 00:03:54,752 Will rotate and any 96 00:03:56,032 --> 00:04:01,664 So when you're doing animations and looking to rotate something that will be important thing to know 97 00:04:02,176 --> 00:04:06,016 Why am I bringing it up because we're going to make a slashing motion for the sword 98 00:04:06,272 --> 00:04:09,088 It looks kind of awkward when the 99 00:04:09,344 --> 00:04:10,880 Tivat offset is in the sea 100 00:04:11,648 --> 00:04:12,928 So what we're going to do instead 101 00:04:13,184 --> 00:04:16,000 Is we are going to change the offset down here 102 00:04:16,512 --> 00:04:19,327 And we're gonna move it up in the Y Direction again 103 00:04:19,583 --> 00:04:20,607 By holding control 104 00:04:21,119 --> 00:04:23,167 Clicking and holding and moving the mouth 105 00:04:23,423 --> 00:04:23,935 Left 106 00:04:24,191 --> 00:04:25,983 I'm going to put the rotation point 107 00:04:26,239 --> 00:04:28,031 When around the hilt right 108 00:04:28,543 --> 00:04:30,079 If I rotate it 109 00:04:30,335 --> 00:04:32,895 It's a much more natural motion because that 110 00:04:33,151 --> 00:04:34,175 That's what you would expect 111 00:04:34,687 --> 00:04:36,735 The point to be that a sore throat 112 00:04:37,503 --> 00:04:38,783 Original leave this as is 113 00:04:39,039 --> 00:04:40,831 Because now I'm going to work on 114 00:04:41,087 --> 00:04:45,695 The note that actually going to be responsible for spawning this ability 115 00:04:45,951 --> 00:04:46,463 The game 116 00:04:46,719 --> 00:04:49,023 So let's go to our player scene if you 117 00:04:49,279 --> 00:04:50,559 Control shift 118 00:04:50,815 --> 00:04:51,839 And then 119 00:04:52,351 --> 00:04:52,863 That brings 120 00:04:53,119 --> 00:04:54,143 The quick opensea 121 00:04:54,655 --> 00:04:56,703 We're going to search for our player seen in and 122 00:04:57,983 --> 00:04:59,007 Another player 123 00:04:59,263 --> 00:04:59,775 What do we 124 00:05:00,031 --> 00:05:01,567 Well we need a way 125 00:05:01,823 --> 00:05:02,335 2 126 00:05:02,847 --> 00:05:04,127 Manage when a bill 127 00:05:04,383 --> 00:05:04,895 Is Haber 128 00:05:05,151 --> 00:05:07,455 This is more of a design 129 00:05:07,711 --> 00:05:08,991 Decision and if you're not 130 00:05:09,247 --> 00:05:10,015 Familiar 131 00:05:10,271 --> 00:05:10,783 With 132 00:05:11,039 --> 00:05:14,111 Designing software designing scalable system 133 00:05:14,623 --> 00:05:17,695 Essentially the key to designing any system 134 00:05:17,951 --> 00:05:18,719 Needs to be extended 135 00:05:19,231 --> 00:05:20,511 Is abstract 136 00:05:21,023 --> 00:05:22,047 Now that's a very 137 00:05:22,303 --> 00:05:23,071 General 138 00:05:23,327 --> 00:05:23,839 State 139 00:05:24,351 --> 00:05:25,375 The idea is 140 00:05:25,631 --> 00:05:26,655 If you can have strapped 141 00:05:27,423 --> 00:05:29,727 If you can make things general or generic 142 00:05:30,239 --> 00:05:31,775 Do you have an easier time 143 00:05:32,799 --> 00:05:34,335 More content to that 144 00:05:34,847 --> 00:05:38,175 So what we're going to be sitting up now is going to be in the spear 145 00:05:38,431 --> 00:05:39,455 Of abstract 146 00:05:39,711 --> 00:05:40,479 We're going to be 147 00:05:40,991 --> 00:05:41,503 Creed 148 00:05:41,759 --> 00:05:43,039 A handful of nose 149 00:05:43,295 --> 00:05:45,343 They are all designed to make the process 150 00:05:46,111 --> 00:05:48,159 Making and managing abilities 151 00:05:48,415 --> 00:05:48,927 Easier 152 00:05:49,183 --> 00:05:52,767 So the first thing I'm going to do is I'm going to add a new note 153 00:05:53,023 --> 00:05:54,303 The player and I'm just going to make 154 00:05:55,583 --> 00:05:56,863 Type of note here 155 00:05:57,119 --> 00:05:58,143 Remove it up to 156 00:05:58,399 --> 00:06:00,191 Top again I like to put 157 00:06:00,703 --> 00:06:02,751 The regular nose before the now 158 00:06:03,007 --> 00:06:03,775 2DS 159 00:06:04,031 --> 00:06:05,567 Organisational purposes 160 00:06:05,823 --> 00:06:07,615 We're going to call this dab 161 00:06:07,871 --> 00:06:08,383 Manager 162 00:06:09,407 --> 00:06:13,759 We made her listen to an actual scene at some point but this note is most 163 00:06:14,015 --> 00:06:15,807 Just away for us 164 00:06:16,063 --> 00:06:17,343 To organise our by 165 00:06:18,623 --> 00:06:21,183 Ok and then work we're going to do is we are 166 00:06:21,439 --> 00:06:22,463 How to create a new 167 00:06:22,719 --> 00:06:24,255 Scene control n 168 00:06:25,279 --> 00:06:28,351 Click on other node we're going to make it a type of 169 00:06:28,607 --> 00:06:29,119 Note 170 00:06:29,375 --> 00:06:30,655 And then what we're going to do 171 00:06:30,911 --> 00:06:31,679 What is Renee called Ace 172 00:06:32,191 --> 00:06:32,703 Sword 173 00:06:33,983 --> 00:06:34,495 Control 174 00:06:35,007 --> 00:06:37,311 So you may already see where this is going now 175 00:06:38,079 --> 00:06:39,615 So I got into save this 176 00:06:40,127 --> 00:06:43,199 And within are seen last seen 177 00:06:43,455 --> 00:06:44,479 Mobility Direct 178 00:06:45,247 --> 00:06:48,063 Let's create a new folder and run a call it's sword ability 179 00:06:48,831 --> 00:06:49,343 Controller 180 00:06:49,599 --> 00:06:52,671 Now this level of granularity maybe 181 00:06:52,927 --> 00:06:56,255 Little bit redundant or maybe a little bit unnecessary 182 00:06:56,511 --> 00:07:01,375 But I figured that we should stick with the pattern that we have going on so we'll create a separate folder 183 00:07:02,399 --> 00:07:03,935 And then inside of that 184 00:07:04,191 --> 00:07:04,703 Folder 185 00:07:04,959 --> 00:07:05,471 We will 186 00:07:05,727 --> 00:07:06,495 Save the 187 00:07:06,751 --> 00:07:08,799 It's so now we have our sword 188 00:07:09,567 --> 00:07:10,079 Controller 189 00:07:11,103 --> 00:07:12,639 What's go ahead at a scripted 190 00:07:12,895 --> 00:07:15,455 And all the default setting should be ok so let's go 191 00:07:15,711 --> 00:07:16,223 Create 192 00:07:16,479 --> 00:07:18,271 And now we're going to do is this 193 00:07:18,527 --> 00:07:22,111 No it is going to be responsible for spawning the sword 194 00:07:22,367 --> 00:07:23,647 In an automated fashion 195 00:07:24,159 --> 00:07:25,183 So at the sword 196 00:07:26,719 --> 00:07:29,791 The first thing that we need to do is we need to tell the sword ability 197 00:07:30,047 --> 00:07:30,559 Controller 198 00:07:30,815 --> 00:07:32,351 What the sword ability is 199 00:07:32,607 --> 00:07:38,751 Write in Godot if you want it instantiated as seen at runtime so we've been staying cheating scene 200 00:07:39,007 --> 00:07:40,543 Within other scenes 201 00:07:40,799 --> 00:07:42,079 Like the player 202 00:07:42,335 --> 00:07:45,919 In the main or the basic enemy in the main but we can actually do that 203 00:07:46,175 --> 00:07:46,687 Run 204 00:07:47,199 --> 00:07:47,711 Which 205 00:07:47,967 --> 00:07:50,783 Obviously we're going to want to do in many cases 206 00:07:51,295 --> 00:07:56,671 So what we're going to do first if you're going to specify the scene that corresponds to the sword ability 207 00:07:56,927 --> 00:07:59,999 So that we know which seen we need to spawn 208 00:08:01,023 --> 00:08:02,047 The game at 209 00:08:02,559 --> 00:08:05,887 So what we going to do is work going to export a variable which 210 00:08:06,143 --> 00:08:07,679 Configurable in the editor 211 00:08:07,935 --> 00:08:08,703 In the way that you do 212 00:08:09,215 --> 00:08:09,983 Easy-do at 213 00:08:12,031 --> 00:08:12,799 Sword 214 00:08:13,055 --> 00:08:13,567 Ability 215 00:08:15,103 --> 00:08:15,615 At 216 00:08:17,407 --> 00:08:20,223 And what is Paxton does that contacts 217 00:08:20,479 --> 00:08:24,319 Is that tells us the type of the variable that's being exposed 218 00:08:24,575 --> 00:08:25,599 In the in 219 00:08:26,367 --> 00:08:29,951 So once you've done this and save to the Script your notice over hearing your inspect 220 00:08:30,207 --> 00:08:30,975 Denmead 221 00:08:31,231 --> 00:08:33,535 Underneath sword ability controller 222 00:08:33,791 --> 00:08:35,071 Now you've got 223 00:08:35,327 --> 00:08:36,607 An item a proper 224 00:08:36,863 --> 00:08:38,143 You're called Sword of Bill 225 00:08:38,655 --> 00:08:39,423 With my 226 00:08:39,679 --> 00:08:40,703 If I click this 227 00:08:40,959 --> 00:08:42,239 I can either create a new 228 00:08:42,495 --> 00:08:44,031 Seen or I can download apex 229 00:08:44,543 --> 00:08:49,407 So you see how that's the only resource that can go on here I can't input a number I can input a string 230 00:08:49,919 --> 00:08:50,943 I can use other 231 00:08:51,199 --> 00:08:52,223 It's too late I can say 232 00:08:52,479 --> 00:08:52,991 Play float 233 00:08:53,247 --> 00:08:55,039 And now it becomes a number field 234 00:08:55,295 --> 00:08:55,807 Right 235 00:08:56,319 --> 00:08:57,855 I can do string 236 00:08:58,623 --> 00:08:59,647 So that it become 237 00:08:59,903 --> 00:09:00,415 What's 8 x 4 238 00:09:00,927 --> 00:09:02,463 We're going to do is work going 239 00:09:02,719 --> 00:09:03,487 Dupe axes 240 00:09:04,767 --> 00:09:06,047 Because we want to 241 00:09:06,559 --> 00:09:07,071 The Sword of 242 00:09:07,839 --> 00:09:10,399 And you can go and your inspector here and 243 00:09:10,655 --> 00:09:13,215 Click and drag the sort ability over into that flat 244 00:09:13,471 --> 00:09:14,751 So now we have a rest 245 00:09:15,007 --> 00:09:15,519 To the park 246 00:09:16,287 --> 00:09:18,079 That corresponds to the sort of 247 00:09:18,591 --> 00:09:23,199 Ok so now we have that we need a sword to spawn on a certain inter 248 00:09:23,455 --> 00:09:24,991 I'm going to do something very big 249 00:09:25,247 --> 00:09:27,295 At first so we're going to go ahead and 250 00:09:27,807 --> 00:09:29,087 Add a child node 251 00:09:29,343 --> 00:09:31,135 Underneath the sword build a controller 252 00:09:31,391 --> 00:09:32,159 Daddy time 253 00:09:32,671 --> 00:09:33,695 And then 254 00:09:33,951 --> 00:09:35,487 We're going to check 255 00:09:35,999 --> 00:09:36,511 One shot 256 00:09:36,767 --> 00:09:38,559 Also going to check Auto 257 00:09:39,071 --> 00:09:42,143 You can configure the time however you want I think I'm going to 258 00:09:42,399 --> 00:09:43,423 21.5 259 00:09:44,447 --> 00:09:47,263 And maybe it's a good idea to do the same as me just 260 00:09:48,287 --> 00:09:48,799 Alright 261 00:09:49,055 --> 00:09:52,127 So now we're going to get into a concept called signal 262 00:09:52,639 --> 00:09:54,943 If you're familiar with other programming 263 00:09:55,199 --> 00:09:57,503 Signals in guedel are basically 264 00:09:58,015 --> 00:09:59,295 The Observer pattern 265 00:09:59,807 --> 00:10:00,844 So for those that are unaware 266 00:10:00,845 --> 00:10:03,016 Subtitled by online-courses.club We compress knowledge for you! 267 00:10:03,018 --> 00:10:03,391 The Observer pattern is basically 268 00:10:03,647 --> 00:10:05,183 An event-driven sis 269 00:10:05,695 --> 00:10:07,743 Where you have an event that happened 270 00:10:07,999 --> 00:10:09,023 Inside your coat 271 00:10:09,535 --> 00:10:11,071 And that event is 272 00:10:11,327 --> 00:10:13,375 To a variable number of 273 00:10:14,399 --> 00:10:16,447 So basically in the Observer pattern 274 00:10:16,959 --> 00:10:17,983 You don't know 275 00:10:18,239 --> 00:10:21,055 Who or what is all listening to the event 276 00:10:21,311 --> 00:10:23,615 You basically just passed out the event 277 00:10:23,871 --> 00:10:24,895 To everything at the list 278 00:10:25,151 --> 00:10:30,271 And that's a really nice way of writing software because then an indefinite number of things can listen 279 00:10:30,527 --> 00:10:32,063 For very specific event 280 00:10:32,575 --> 00:10:33,343 To be list 281 00:10:34,111 --> 00:10:34,879 So in a van 282 00:10:35,135 --> 00:10:35,903 Might be 283 00:10:36,159 --> 00:10:37,439 When the timer runs 284 00:10:37,951 --> 00:10:41,535 I don't want to have to explicitly check the timer every frame 285 00:10:41,791 --> 00:10:43,071 To see if it's finished 286 00:10:43,327 --> 00:10:44,863 I just want to be told 287 00:10:45,119 --> 00:10:45,887 When it's 288 00:10:46,399 --> 00:10:47,167 So that I can 289 00:10:47,679 --> 00:10:48,447 Run my code 290 00:10:48,703 --> 00:10:50,495 And this is what signals.in good LR 291 00:10:50,751 --> 00:10:52,799 Signals are essentially events 292 00:10:53,055 --> 00:10:53,567 That 293 00:10:53,823 --> 00:10:54,335 On the 294 00:10:54,847 --> 00:10:56,127 That you can emit 295 00:10:56,639 --> 00:10:58,687 To signified an event has 296 00:10:59,199 --> 00:11:00,735 Or that you can listen to 297 00:11:00,991 --> 00:11:04,063 From any other node or any other girl 298 00:11:04,575 --> 00:11:09,439 If that doesn't sound superclear right now don't worry we're going to get into it and you'll see how it 299 00:11:09,951 --> 00:11:10,463 Right now 300 00:11:10,719 --> 00:11:14,047 So in a ready method this is where we typically what 301 00:11:14,303 --> 00:11:14,815 2 302 00:11:15,071 --> 00:11:16,095 Connect Sid 303 00:11:16,607 --> 00:11:20,959 The weather this works is that we need to get a reference to the timer know so that we can 304 00:11:21,215 --> 00:11:22,239 Connect to a signal 305 00:11:22,495 --> 00:11:23,263 On the time 306 00:11:23,775 --> 00:11:24,799 Is a couple of days ago 307 00:11:25,311 --> 00:11:25,823 You can 308 00:11:26,079 --> 00:11:27,615 Get underscore now 309 00:11:27,871 --> 00:11:30,175 And then you can supply a note 310 00:11:30,431 --> 00:11:31,199 A notepad 311 00:11:31,455 --> 00:11:31,967 Starstruck 312 00:11:32,479 --> 00:11:33,247 There are 313 00:11:33,503 --> 00:11:35,295 Relative or absolute Power 314 00:11:35,551 --> 00:11:36,831 What's 2/8 note in 315 00:11:37,599 --> 00:11:39,391 If I do get 316 00:11:39,647 --> 00:11:41,183 Timer as was 317 00:11:41,695 --> 00:11:42,207 For me 318 00:11:42,463 --> 00:11:43,999 It's going to look for a child 319 00:11:44,255 --> 00:11:45,023 Call timer 320 00:11:45,279 --> 00:11:46,047 If I 321 00:11:46,559 --> 00:11:47,327 Add another 322 00:11:47,583 --> 00:11:48,095 Level 323 00:11:48,351 --> 00:11:48,863 Today 324 00:11:49,119 --> 00:11:50,911 And out of the timer underneath that 325 00:11:51,167 --> 00:11:51,935 I would have to do 326 00:11:52,191 --> 00:11:53,471 Node 327 00:11:54,495 --> 00:11:55,519 Right to say that 328 00:11:56,031 --> 00:11:57,055 So it's basically 329 00:11:58,079 --> 00:11:59,615 Level deep you go 330 00:11:59,871 --> 00:12:01,919 You have to specify that in your 331 00:12:02,431 --> 00:12:02,943 Pass 332 00:12:03,199 --> 00:12:04,223 That's one way to do it 333 00:12:04,479 --> 00:12:07,039 Shorthand way to do it is to use a dollar sign 334 00:12:07,551 --> 00:12:08,063 And 335 00:12:08,319 --> 00:12:08,831 Timer 336 00:12:09,087 --> 00:12:13,183 So the dollar sign timer is shorthand for get no 337 00:12:13,695 --> 00:12:15,999 Timer and we don't have to use any 338 00:12:16,511 --> 00:12:18,559 Strings or the get node function 339 00:12:19,071 --> 00:12:21,375 The way to connect to the signal is to 340 00:12:21,631 --> 00:12:27,775 Time out this is the name of the signal and if you don't know what the name of the signal is that you're trying to 341 00:12:28,031 --> 00:12:28,543 Like to 342 00:12:28,799 --> 00:12:29,823 You can so 343 00:12:30,079 --> 00:12:30,591 The timer 344 00:12:30,847 --> 00:12:32,639 In Your Scene 345 00:12:32,895 --> 00:12:33,663 Dark hair 346 00:12:33,919 --> 00:12:35,199 Go over 2 note 347 00:12:35,455 --> 00:12:38,271 And then you can see all the signals that belong to the notary 348 00:12:38,783 --> 00:12:39,551 That's one option 349 00:12:39,807 --> 00:12:40,575 Or 350 00:12:40,831 --> 00:12:41,599 You can 351 00:12:41,855 --> 00:12:43,647 F1 on your keyboard 352 00:12:43,903 --> 00:12:46,463 Search for the object or the no that you 353 00:12:46,719 --> 00:12:47,231 Connect to 354 00:12:47,487 --> 00:12:49,279 And it will list the signal 355 00:12:51,071 --> 00:12:51,583 Here 356 00:12:51,839 --> 00:12:54,399 So you can see very clearly on time-out 357 00:12:54,911 --> 00:12:55,679 That will be 358 00:12:55,935 --> 00:12:56,447 Omitted 359 00:12:56,703 --> 00:12:57,471 When the timer 360 00:12:57,727 --> 00:12:58,239 0 361 00:12:58,495 --> 00:12:59,007 So 362 00:12:59,263 --> 00:13:01,311 Timer dart time out and then we stayed at 363 00:13:01,567 --> 00:13:02,079 Connect 364 00:13:02,847 --> 00:13:04,639 And then we need to pass a function 365 00:13:04,895 --> 00:13:05,407 Rapha 366 00:13:05,919 --> 00:13:08,735 So let's go out and create a new function down here 367 00:13:08,991 --> 00:13:09,503 The process 368 00:13:11,295 --> 00:13:11,807 On 369 00:13:12,063 --> 00:13:12,575 Time 370 00:13:13,087 --> 00:13:13,599 Time out 371 00:13:13,855 --> 00:13:16,159 And hear what we're going to do is just going to pray 372 00:13:16,927 --> 00:13:17,439 Deuce 373 00:13:18,207 --> 00:13:20,767 This is where we're going to want to actually activate the above 374 00:13:21,535 --> 00:13:24,607 That's going to delete this process method because we don't need it 375 00:13:24,863 --> 00:13:27,167 Will just be running unnecessarily 376 00:13:27,679 --> 00:13:29,983 In our timer timer connector 377 00:13:30,239 --> 00:13:31,775 Der pass that on time 378 00:13:32,287 --> 00:13:32,799 Time out 379 00:13:33,567 --> 00:13:34,079 Internet 380 00:13:34,335 --> 00:13:36,383 Make sure not to call it like this 381 00:13:36,895 --> 00:13:37,663 Because that won't 382 00:13:38,175 --> 00:13:39,455 We need to pass it as a 383 00:13:39,711 --> 00:13:40,991 So this is essential 384 00:13:41,759 --> 00:13:43,039 Pointing to 385 00:13:43,295 --> 00:13:43,807 That's 386 00:13:44,575 --> 00:13:46,111 So we've got the 387 00:13:46,623 --> 00:13:49,951 Auto start and one shot enabled hair and 1.5 sec 388 00:13:50,463 --> 00:13:52,255 So we can quickly verify that this work 389 00:13:52,511 --> 00:13:54,559 By clicking this button up at the top 390 00:13:54,815 --> 00:13:55,583 Call drum 391 00:13:55,839 --> 00:13:56,607 Currents 392 00:13:57,119 --> 00:13:58,143 Or S6 393 00:13:58,655 --> 00:13:59,423 If we click this 394 00:13:59,935 --> 00:14:01,471 And let it sit for a while and have sex 395 00:14:01,983 --> 00:14:05,055 Can we go back to editor and go to the output tab at the bar 396 00:14:05,567 --> 00:14:07,359 You can see the disappointing do some 397 00:14:07,871 --> 00:14:08,895 So if you're seeing this 398 00:14:09,151 --> 00:14:09,663 Then 399 00:14:09,919 --> 00:14:10,431 Your code 400 00:14:10,687 --> 00:14:11,199 Is working 401 00:14:11,455 --> 00:14:12,479 Ok so that's why 402 00:14:12,735 --> 00:14:15,295 Let's just go ahead and disable one shot 403 00:14:15,551 --> 00:14:16,063 Because 404 00:14:16,319 --> 00:14:17,855 We actually do want this 405 00:14:18,111 --> 00:14:18,623 Keep running 406 00:14:18,879 --> 00:14:21,183 And so if you disable the one shot in and around again 407 00:14:21,439 --> 00:14:22,975 What you'll see is that 408 00:14:23,231 --> 00:14:26,047 Timeout signal keeps getting a murdered everyone 409 00:14:26,559 --> 00:14:27,071 Seconds 410 00:14:27,327 --> 00:14:31,167 What we want because every time on timer timeout is called 411 00:14:31,423 --> 00:14:32,959 By the signal emission 412 00:14:33,215 --> 00:14:35,263 We are going to want to spawn our sword 413 00:14:36,543 --> 00:14:37,823 So let's go back to a player 414 00:14:38,079 --> 00:14:42,431 And we're going to click on the ability manager in my going to instantiate a child scene 415 00:14:42,687 --> 00:14:44,223 By doing control 416 00:14:45,247 --> 00:14:47,807 Or command shift I will be using win 417 00:14:48,063 --> 00:14:50,623 Keyboard shortcuts but I believe it's the same on Mac 418 00:14:50,879 --> 00:14:52,415 And we're going to 419 00:14:52,671 --> 00:14:54,463 Instantiate the Sword of billet 420 00:14:54,719 --> 00:14:55,231 Controller 421 00:14:55,487 --> 00:14:57,023 So that it is a child 422 00:14:57,279 --> 00:14:57,791 The 423 00:14:58,047 --> 00:14:58,559 Manage 424 00:14:59,071 --> 00:15:00,607 Let's go and Run the game 425 00:15:01,631 --> 00:15:05,471 And you should see the output window that is being printed now when we run the four 426 00:15:05,983 --> 00:15:10,079 That's because our sort ability controller is now in the overall tree 427 00:15:10,335 --> 00:15:11,615 Because it is a child 428 00:15:11,871 --> 00:15:12,383 Of 429 00:15:12,639 --> 00:15:13,151 The player 430 00:15:13,407 --> 00:15:15,967 Ok let's just do something really basic 431 00:15:16,223 --> 00:15:18,527 We're going to instantiate this sort of 432 00:15:18,783 --> 00:15:20,319 Add the player position 433 00:15:20,831 --> 00:15:22,367 Set of printing this do some 434 00:15:22,623 --> 00:15:23,903 What we're going to do instead 435 00:15:24,415 --> 00:15:26,207 Is we're going to say 436 00:15:26,463 --> 00:15:27,231 Incidence 437 00:15:27,487 --> 00:15:28,511 Is equal to 438 00:15:28,767 --> 00:15:29,279 Sore 439 00:15:29,535 --> 00:15:30,559 Ability 440 00:15:32,607 --> 00:15:34,143 And since we know that 441 00:15:34,399 --> 00:15:35,679 The Sword of Bill 442 00:15:36,191 --> 00:15:38,239 Is basetype Notre Dame 443 00:15:38,495 --> 00:15:39,007 Weekend 444 00:15:39,263 --> 00:15:42,591 As known to die at the end of that instantiation 445 00:15:43,103 --> 00:15:43,871 Cast 446 00:15:44,639 --> 00:15:47,455 And now this is the tricky thing with instantiation 447 00:15:47,711 --> 00:15:51,295 So what we've done is a we've created a node but it's in memory 448 00:15:51,807 --> 00:15:55,903 We have to tell it manually to be inserted into the scene tree 449 00:15:56,159 --> 00:15:57,695 Add a specific 450 00:15:58,463 --> 00:15:59,999 So where we want to put a sword in 451 00:16:00,767 --> 00:16:03,583 Well I think for now we probably just want to put it in 452 00:16:03,839 --> 00:16:04,351 The main 453 00:16:04,863 --> 00:16:05,887 So how are we going to do 454 00:16:06,399 --> 00:16:07,679 Well here's something that 455 00:16:08,447 --> 00:16:09,471 So let's grab the play 456 00:16:09,983 --> 00:16:10,751 Bar player 457 00:16:11,007 --> 00:16:11,775 Is equal to 458 00:16:12,287 --> 00:16:13,311 Get tree 459 00:16:14,335 --> 00:16:14,847 Get 460 00:16:15,103 --> 00:16:16,639 First node in group 461 00:16:17,663 --> 00:16:18,175 Claire 462 00:16:18,687 --> 00:16:21,247 And I'm going to do as no a 2D like we usually 463 00:16:21,759 --> 00:16:25,855 And let's go ahead and move this line down the sword instance 464 00:16:26,111 --> 00:16:26,623 So 465 00:16:26,879 --> 00:16:27,647 If you hold on 466 00:16:27,903 --> 00:16:31,487 And then press down on arrow keys you can actually move Lines 467 00:16:31,743 --> 00:16:33,023 Up and down in the 468 00:16:33,535 --> 00:16:35,327 Move this line down 469 00:16:35,839 --> 00:16:40,447 And the reason is because we don't want to understand this unless we know that it's safe that we have a player 470 00:16:41,215 --> 00:16:43,519 So if player is equal to now 471 00:16:44,031 --> 00:16:45,823 What we're going to do as we're just going to 472 00:16:46,335 --> 00:16:46,847 Return 473 00:16:47,615 --> 00:16:48,127 Now 474 00:16:48,639 --> 00:16:50,175 This should never happen 475 00:16:50,431 --> 00:16:51,199 Because 476 00:16:51,455 --> 00:16:52,479 Our player 477 00:16:53,503 --> 00:16:56,319 Where this ability controller is attached 478 00:16:56,575 --> 00:16:58,111 To write however 479 00:16:58,367 --> 00:16:59,903 I generally like to 480 00:17:00,159 --> 00:17:04,255 Write my code as module as possible and make as few a song 481 00:17:05,279 --> 00:17:06,559 That generally ends up 482 00:17:06,815 --> 00:17:07,839 Creating better Co 483 00:17:08,351 --> 00:17:10,143 So we shouldn't make the assumption 484 00:17:10,655 --> 00:17:11,423 The player 485 00:17:11,679 --> 00:17:12,959 Is going to exist 486 00:17:13,215 --> 00:17:14,495 Despite the fact that 487 00:17:14,751 --> 00:17:16,031 As the game current least 488 00:17:16,543 --> 00:17:18,335 The players should always 489 00:17:18,591 --> 00:17:20,127 When this code is being run 490 00:17:20,383 --> 00:17:22,943 So the players go to normal just return 491 00:17:23,199 --> 00:17:25,759 Otherwise we can instantiate the sword instance 492 00:17:26,015 --> 00:17:27,039 Am I going to say 493 00:17:27,295 --> 00:17:27,807 Player 494 00:17:28,319 --> 00:17:29,855 Start get pairing 495 00:17:30,367 --> 00:17:32,415 So that's going to get the parent of the player 496 00:17:32,671 --> 00:17:35,743 Which in this case is going to be this main mode right here 497 00:17:35,999 --> 00:17:37,023 Because you've got the pleasure here 498 00:17:37,279 --> 00:17:38,047 Get pair 499 00:17:38,303 --> 00:17:40,095 Is up one level two mean 500 00:17:40,351 --> 00:17:41,631 Player get paid 501 00:17:42,655 --> 00:17:43,679 Adch 502 00:17:44,191 --> 00:17:46,495 And this is the way that you add new note 503 00:17:46,751 --> 00:17:47,263 To the scene 504 00:17:47,775 --> 00:17:50,079 I'm going to go ahead and add my sword 505 00:17:51,359 --> 00:17:52,895 And I was one of the things that we need to do 506 00:17:53,151 --> 00:17:56,735 By default when you add a note to D to the scene 507 00:17:57,247 --> 00:17:59,551 It's going to have a position of zero zero 508 00:18:00,063 --> 00:18:01,855 So it's going to be at the world Orange 509 00:18:02,367 --> 00:18:05,183 Or the origin of the new Duty that you're adding 510 00:18:05,951 --> 00:18:08,767 What we need to do is we need to take that sword instance 511 00:18:09,023 --> 00:18:11,071 I'm going to set the global position 512 00:18:11,327 --> 00:18:11,839 Eagle 513 00:18:12,095 --> 00:18:13,119 Two player 514 00:18:13,375 --> 00:18:14,143 Start global 515 00:18:15,423 --> 00:18:19,519 Now this is not the final behaviour that we're going to do but just doing this to get our code to start 516 00:18:20,031 --> 00:18:22,335 And so all went well we can run the game 517 00:18:22,591 --> 00:18:26,175 And you can see that as you walk around swords are being spawn 518 00:18:26,431 --> 00:18:31,807 And so that's a good start for our sword ability in the next lesson we're going to continue working out 33117

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.