samfred2 commited on
Commit
b9bd41d
·
verified ·
1 Parent(s): cfa4602

[flow_default] Transcription: 006 Introduction to blueprints.json

Browse files
transcriptions/006 Introduction to blueprints.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_file": "006 Introduction to blueprints.wav",
3
+ "text": "Hi everyone, welcome to the Blueprints tutorial. If you've already heard about Blueprints or if you're experiencing a programming language, go ahead and skip this tutorial. If you never heard about Blueprints, I would highly recommend you stay so you can understand the basics of it, even if you don't know any programming. Perfect, let's get to it. So Blueprints are a way unreal designed for you to program your level. So if we go ahead to the top here, you can see that there's a Blueprints button. And this just lists all the Blueprints available to the world at that given time. So let's click on it. And I select the open level Blueprint. This is basically the space that we're going to be using to program things that happen in our level. Awesome. So if you open this up, you should see these two events right here. And you should see the entire blueprint, which is just this amazing and huge space right here where we can connect nodes to other nodes or functions to other functions and execute things in the virtual world. So you might be wondering, what are events? So you can see these two events right here. And events are basically just actions, just things that happen at a certain time. The first event right here, the Begin Play, actually gets called whenever the level starts. So if you're playing your game and a new level is loaded, whenever the new level is loaded, the Event Begin Play will execute. And the Event Tech right here just executes every single frame. So if you ever played any games in your life, you have heard about FPS. So like my game is running at 60 FPS, this event tick right here is going to match that and every single frame is going to execute this action. So let's see this in practice. So in order to see what this tube will do, let's go ahead and right click with our mouse button and let's search here on the search bar. We're going to search for an action, a specific action called print. This is basically the Hello World of Blueprints. So I select right here print string, and string is just basically text. What we're going to do here is in the string here, let's modify to Hello World. And what we want to do is that whenever the level starts, we want the Hello World to display in our level. Just so we understand what's going on with this events right here and how blueprints work. So in order to execute the print string, we need to connect the execution right here from the begin play to the print string. This is just a linear way of connecting two functions events that execute linearly, which means that event begin play will be called first and then event-picking play will call printString. Awesome! In order to see this working, let's go ahead all the way to the top left and let's hit compile. This is going to make sure that the code is good to go and let's hit save to save our blueprint. So now let's go back to our level and let's press play. And then if you notice on the top left, it printed Hello World. Let me do this again. So I'm going to press play. Pay attention to the top left on my screen. It printed Hello World. So as you can see, as soon as the level started, my print string got executed because this event starts whenever the level is created. Therefore, it printed my Hello World. Awesome. Another example here is Event Tick. So let's do the same for EventTick. So let's go ahead and right click it and let's select print string. This way, every single frame, it's going to be calling print string. So this runs on every single frame. So you have 60 frames per second. This is going to run 60 times every second. And you're going to see, let's modify the string here to be, this is executing every x seconds. Perfect. So now if I compile this again on all the way in the top left and save it, and if we go back to our level and press play, as you can see, this gets executed a lot of times. And it just prints a lot of print statements. Perfect. And that's what EventTick does. It just executes every frame. But these events are really given to us, you know, and we might want to create our own events whenever we're programming. To do that, you can just click on an empty space and we're going to search for custom event. And you're going to see right here at custom events. So let's click on this, and this is going to allow us to create our own event, just like the above one. So let's name this print string. What we want this event to do is to actually print the text in the screen. So let's go ahead and right click it again, and let's search for print. Awesome. And let's do the same as we did before. Let's connect the execution to the print string right here. And maybe let's change the string to good after name. Awesome. To delete a function or anything here in the Blueprints, you can just select and hit the delete key. So I'm just going to delete the EventTick print string. Otherwise, it's going to print every single time. And I don't want that right now. So I'm going to delete the print string right here. And on the event to begin play, instead of calling this print string directly, I'm going to call the custom event that I just created. To do that, I'm going to delete the print string by pressing delete. And here on the left panel, where you can see, I'm going to drag the print string event from here. This is basically just going to call, just going to transform in this node where we can actually call our custom event from there. So if we connect the event begin play to the print string, what's going to happen is that whenever we create our level, the print string event is going to get executed, which means that this guy right here is going to get executed, which is going to print our string. So if we compile and save, we're going to see that. And we hit play right here. We're going to see that Afternoon just got printed all the way to the top left. Let me do this one more time. Good Afternoon. Awesome. And that's how you create custom events. And we're gonna be using this a lot throughout the course. Another thing that the Blueprints allow us to do is to actually have variables on it. Variables are just simply these containers that can hold different values depending on it. So instead of us typing Good Afternoon here, let's create a variable that we can values variable is going to have a type string. So if you type, if you press here on the Boolean, you can actually change the type of the variable. So let's change it to string. Awesome. Now this variable is contained right here. So the level knows that it needs to memorize whatever text is contained on this variable. So let's go ahead and drag the variable right here. And let's, as you can see, whenever you drag it, it's going to ask if you want to get the text or if you want to set the text. So what I'm going to do right now is I'm going to set the text first. And this is going to place a set node right here. So I'm going to drag this to the top. And whenever the level starts, I want to set the text to, let's say, good morning. Perfect. So whenever the level starts, instead of printing my string, we're going to set this text to Good Morning. And after we set the text to Good Morning, we can drag this again and connect to the print string. So it's going to set the text to Good Morning and it's going to execute our print string. So if we go to the print string right here, instead of us coding Good Afternoon here, we can just drag the text, which is our variable, and we're going to get the text. That way we can actually get that string that we just set it right here. And we're going to connect the purple ones or pink ones to the pink one right here, which is going to just set the string to print that custom text that we just created before. So let's just go ahead and let's just review this again. So whenever our level starts, we're going to set our text variable to good morning, and we're going to print the string. And the string that we're going to print is just text, which is good morning. So if we compile this, and we save it, and we go to demonstration. In the top left, you can see good morning. One more time, if you didn't see, you can see good morning. So this is a way of holding values in our blueprints. And this is also going to be really important whenever we're programming later on. So as you can see, it started to get a little messy. So let's fix that by just arranging the nodes like this. And if you want, you can also double click on a node and it's going to pop this reroute node and you can just drag this to look better. Whenever we're actually dealing with a lot of these, you're going to see that the reroute node is actually pretty useful so you can better organize your blueprints and we're gonna be showing that later on the course. So I'm just gonna delete this right now because there is no need and I'm gonna connect it back. To disconnect it, you just hold Ctrl and just click where you want to disconnect and if you want to place a new node, you just release it and then you can type, you can execute another event right here. Awesome. So another thing that we can do is, so let's delete this too right here. Let's delete event, begin play and event tech. So right now I'm going to show you another way of you, how you can execute this event. One thing that it allows us to do the level blueprint is to actually get keyboard input. So if we right click it and we search for the tab key, as you can see an input keyboard events, we can see the tab. We can actually call an event based on a click. So what I want to do is I want to call print string whenever I press tab on my keyboard. In order to do that I will just drag my print screen here from the from the graphs right over here on the left side. I'm gonna drag and drop and whenever the tab keys press I'm gonna execute my print string. So if we go ahead and we compile this and save it, and if we go to our level, and we press play, and then if I hit the tab key, as you can see, nothing happened. And you might wonder why did nothing happen? So if we go back, and we see what's going on, so whenever I press the tab key, print string gets called, and then print string calls print string, which is this text right here. But if you remember variables are just there to hold some values. Right now nothing got set to text right here. So if you see on the right side on the details, if you click the text, you can see that the default value for it is actually nothing. So nothing was being printed. So if we modify this to pressed, so let's say that the default value is pressed and then I compile and I hit save. If we go back to our level and press tab, as you can see, press is printing. Perfect, because I'm pressing tab lots of times. As you can see, you don't need necessarily to set a variable, but it's good that you set a default value for it. If the default value is not showing up for you, it's because you need to compile first so it actually shows the default value, and then you can actually modify it. Perfect! So this was the introduction to Blueprints. There's a lot more that we're gonna cover it throughout the course but I thought it was good to introduce you to basic concepts so you start getting the hang of it. Cool? Well thank you so much for being here, I'll see you in the next tutorial.",
4
+ "language": "en",
5
+ "confidence": null,
6
+ "duration": 739.58
7
+ }