﻿1
00:00:04,370 --> 00:00:05,900
‫Hello and welcome.

2
00:00:05,900 --> 00:00:12,020
‫We're going to be writing our first blueprint program in this lecture so that when we hit play, we

3
00:00:12,020 --> 00:00:15,410
‫get messages printed to the screen.

4
00:00:15,410 --> 00:00:16,190
‫Let's dive in.

5
00:00:17,690 --> 00:00:22,730
‫You can think of programming in Blueprint, a little bit like wiring up an electrical circuit.

6
00:00:22,760 --> 00:00:27,470
‫You have your different components and you can wire them up so that when a light switch is switched

7
00:00:27,470 --> 00:00:31,100
‫on, then the light will switch on.

8
00:00:31,760 --> 00:00:34,670
‫Now, because we're going to be introducing a lot of new concepts here.

9
00:00:34,670 --> 00:00:39,140
‫I'm going to be building up a little bit of a glossary as we go now.

10
00:00:39,140 --> 00:00:44,900
‫We saw at the end of the last lecture that this thing here is called the event graph.

11
00:00:44,930 --> 00:00:49,220
‫It is the canvas on which we are going to be painting all of our blueprints.

12
00:00:50,150 --> 00:00:55,430
‫And we also saw that we can right click on the event graph to get a list of functionality.

13
00:00:55,490 --> 00:01:02,060
‫Now the first thing I want you to search for is print string, and you're going to see that there is

14
00:01:02,060 --> 00:01:03,200
‫a menu item there.

15
00:01:03,200 --> 00:01:08,870
‫It's under the heading development and if you click it, it brings in something that is called a node.

16
00:01:09,050 --> 00:01:17,380
‫Now a node is a piece of pre-made functionality that we can drop in to our project and use from within.

17
00:01:17,390 --> 00:01:21,920
‫Blueprint and a string is essentially programmer.

18
00:01:21,920 --> 00:01:23,960
‫Speak for text.

19
00:01:23,960 --> 00:01:31,010
‫So what we've got here is this node, when it's activated, will say hello.

20
00:01:31,010 --> 00:01:33,020
‫We can change this to something else.

21
00:01:33,020 --> 00:01:38,600
‫A message like Welcome to warehouse wreckage.

22
00:01:39,800 --> 00:01:45,800
‫Now we might want this message to be displayed to the screen when we begin playing the game.

23
00:01:45,980 --> 00:01:48,740
‫Now we can fortunately do this with another node.

24
00:01:48,740 --> 00:01:56,810
‫If we right click, we can look for begin play and that brings up a menu item called Event Begin Play

25
00:01:56,810 --> 00:01:59,180
‫and this brings in yet another node.

26
00:01:59,180 --> 00:02:06,170
‫Now an event is just a special type of when node it tells us when something should happen.

27
00:02:06,170 --> 00:02:12,560
‫And in this case, the Begin Play event tells us that something should happen when play begins, when

28
00:02:12,560 --> 00:02:14,210
‫the play button is pressed.

29
00:02:14,210 --> 00:02:20,240
‫Now, you may notice that these nodes have got these little arrows in on the left hand side or right

30
00:02:20,240 --> 00:02:21,800
‫hand side, sometimes both.

31
00:02:21,800 --> 00:02:29,210
‫These are known as pins, which are essentially sockets that we can connect up to each other.

32
00:02:29,210 --> 00:02:35,120
‫There are input pins which are on the left and they tell us when to run this particular node.

33
00:02:35,120 --> 00:02:40,430
‫And there are output pins that tell us what to do after this particular node.

34
00:02:40,430 --> 00:02:45,530
‫So if we have a look at this, we've only got an output pin on the event, which makes sense because

35
00:02:45,530 --> 00:02:47,510
‫we know that events are a when node.

36
00:02:47,510 --> 00:02:52,730
‫They tell us when to do something and we've got inputs and outputs on the print string, which means

37
00:02:52,730 --> 00:02:59,330
‫that we can tell it when it should start, which is the input, and then we can tell it what to do after,

38
00:02:59,330 --> 00:03:00,620
‫which is the output.

39
00:03:00,620 --> 00:03:07,550
‫So you can click and drag between these pins in either order to make a connection between the two.

40
00:03:07,550 --> 00:03:14,840
‫And connections are literally just these wires between pins that allow us to connect up that when to

41
00:03:14,840 --> 00:03:15,440
‫the what.

42
00:03:15,440 --> 00:03:22,520
‫So in this case we're connecting up when we begin play, then you should print a string.

43
00:03:22,520 --> 00:03:23,690
‫Let's try this out.

44
00:03:23,690 --> 00:03:29,150
‫If you hit the play button in the toolbar, we should see a welcome to warehouse wreckage string being

45
00:03:29,210 --> 00:03:29,990
‫printed.

46
00:03:29,990 --> 00:03:33,260
‫Now the message doesn't hang around for very long, but that's okay.

47
00:03:33,260 --> 00:03:34,220
‫We don't need it to.

48
00:03:34,220 --> 00:03:35,420
‫It proves the point.

49
00:03:35,450 --> 00:03:35,690
‫Now.

50
00:03:35,690 --> 00:03:40,760
‫If you notice any background hissing while I'm playing the game, that's not my computer fans or background

51
00:03:40,760 --> 00:03:41,930
‫noise in my room.

52
00:03:41,930 --> 00:03:47,900
‫That's actually some ambient sound that is in our default level that is playing when we hit play.

53
00:03:47,900 --> 00:03:52,130
‫If you hit play on your own project, try it out and switch on your speakers.

54
00:03:52,130 --> 00:03:53,840
‫You're going to hear the same sound.

55
00:03:53,840 --> 00:03:59,990
‫Now we can make sequences of nodes in the same way as we could connect multiple light bulbs up together

56
00:03:59,990 --> 00:04:06,500
‫in a sequence, and that would allow us to do one thing and then something else.

57
00:04:06,500 --> 00:04:13,040
‫So I'd like you to take the challenge of printing another message after our first one.

58
00:04:13,040 --> 00:04:17,180
‫So add another print string node by right clicking and searching for it.

59
00:04:17,210 --> 00:04:25,310
‫Connect it up in sequence with our first print string node and then customize the text to your liking

60
00:04:25,340 --> 00:04:27,200
‫a pause video and have a go.

61
00:04:27,950 --> 00:04:29,330
‫Okay, welcome back.

62
00:04:29,330 --> 00:04:36,620
‫So let's exit play with an escape and then I'm going to show you that you can actually drag off the

63
00:04:36,620 --> 00:04:38,150
‫output pin.

64
00:04:38,480 --> 00:04:44,870
‫And then that brings up automatically a search box for you so you don't even have to right click and

65
00:04:44,870 --> 00:04:51,350
‫then I can search for print string and that adds in a new print string node that is in sequence with

66
00:04:51,350 --> 00:04:52,160
‫the previous one.

67
00:04:52,160 --> 00:04:57,800
‫And I can say get ready to rumble.

68
00:04:58,550 --> 00:05:02,420
‫And what that's going to do is if we hit play it prints.

69
00:05:02,680 --> 00:05:04,330
‫Both of them at the same time.

70
00:05:04,330 --> 00:05:10,510
‫Interestingly, the the oldest message goes at the bottom and then the newer one comes afterwards.

71
00:05:10,510 --> 00:05:14,580
‫But as has happened in sequence, we've had one, then the other.

72
00:05:14,590 --> 00:05:18,730
‫There's just no delay between the two because computers are really fast.

73
00:05:18,730 --> 00:05:21,070
‫So make sure that you save your changes.

74
00:05:21,070 --> 00:05:25,000
‫You can save all change files by doing a control shift.

75
00:05:25,000 --> 00:05:28,900
‫SE and I will see you in the next lecture.

