WEBVTT

00:07.540 --> 00:08.800
Welcome back.

00:08.980 --> 00:15.220
Now, our interest is to create some kind of actor that will travel us to another level.

00:15.220 --> 00:22.300
And before we continue on with developing that, I'd like to do something that's pretty fun using what

00:22.300 --> 00:23.890
we've already implemented here.

00:23.890 --> 00:30.970
You see, we already have a highlight interface on our checkpoint actor and.

00:32.360 --> 00:38.180
We have an overlap sphere that if we overlap with it, triggers something in response.

00:38.180 --> 00:45.710
And this is a actor that has a save game variable be reached, which allows us to kind of know that

00:45.710 --> 00:47.420
we've reached a certain point.

00:47.720 --> 00:54.200
So I like that our checkpoints tell us that we've reached a certain point, but it would be nice if

00:54.200 --> 01:01.100
we had other little objects scattered throughout our dungeons that glow as soon as we reach them and

01:01.100 --> 01:06.260
basically give us what the beacons give us, minus actually saving the game.

01:06.260 --> 01:13.970
So it's more just a sense of how far we are in the level, a sense of progress, but not exactly a checkpoint

01:13.970 --> 01:20.720
per se, in that it doesn't save the game state, it doesn't save our state or our status.

01:20.720 --> 01:24.890
All I want it to do is save the fact that it's lit up.

01:25.250 --> 01:30.620
So that's actually pretty easy to do because of the system we already have in place.

01:30.620 --> 01:35.360
We can just inherit from what we have in our checkpoint.

01:35.360 --> 01:38.600
So what we can do is we can take our checkpoints.

01:38.600 --> 01:44.180
I'm going to close all other tabs except for checkpoint dot h, and just make sure that we have enough

01:44.180 --> 01:49.730
things exposed to blueprint to easily extend this in blueprint if we would like to.

01:50.300 --> 01:56.510
Now I'd like handle glow effects to be blueprint callable so we can choose when and how to implement

01:56.510 --> 01:57.830
handle Glow effects.

01:57.830 --> 02:05.330
So I'm going to make this blueprint callable as Handle Glow effects is going to call our checkpoint

02:05.330 --> 02:07.700
reached blueprint implementable event.

02:07.700 --> 02:15.410
After setting our checkpoint mesh material to a newly created dynamic material instance, as well as

02:15.410 --> 02:22.160
disabling the sphere so we can implement that in a blueprint based on this class.

02:22.160 --> 02:24.710
So that's a blueprint implementable event.

02:24.740 --> 02:30.080
Now breached is blueprint read only and it's our save game variable.

02:30.080 --> 02:34.220
I'd like to be able to set this from within blueprint.

02:34.220 --> 02:36.050
So I'm going to make it blueprint read write.

02:36.050 --> 02:43.550
And the reason for that is in blueprint I plan on implementing what happens when our sphere gets overlapped,

02:43.550 --> 02:51.380
as I don't want to save the world state and I don't want to execute save progress, I just want to handle

02:51.380 --> 02:52.460
glow effects.

02:52.850 --> 02:57.230
So we'll need to suppress that from within our blueprint.

02:57.800 --> 03:02.840
Now we can suppress that by simply not binding to it if we don't want to.

03:02.870 --> 03:05.570
We can have some kind of setting that prevents.

03:06.710 --> 03:15.800
Our callback from being bound, such as a boolean called be call overlap callback.

03:16.900 --> 03:22.630
We can have this set to true by default, but we can override this in blueprint by making it edit defaults

03:22.630 --> 03:23.350
only.

03:23.970 --> 03:25.650
Or even add it anywhere.

03:26.520 --> 03:32.250
And then we'll only bind to on component began overlap if b.

03:33.580 --> 03:35.560
Call overlap callback.

03:35.560 --> 03:36.190
Really?

03:36.190 --> 03:38.860
It should be b bind overlap callback.

03:38.860 --> 03:40.720
Let's make it bind.

03:40.720 --> 03:41.170
Overlap.

03:41.170 --> 03:42.070
Callback.

03:47.070 --> 03:48.510
Now that's an option.

03:48.960 --> 03:52.920
So let's go ahead and close the editor down.

03:53.520 --> 03:57.450
And compile and launch and make a new blueprint based on this.

03:59.890 --> 04:05.770
So we can browse to the asset of our checkpoint blueprint and we can make a new one here.

04:05.770 --> 04:12.400
Right click blueprint Class checkpoint and create a blueprint based on checkpoint.

04:12.400 --> 04:13.690
We can select that.

04:14.220 --> 04:16.560
And we can call this BP beacon.

04:17.580 --> 04:23.160
Now, this does technically mean this is a player start within our world, but we don't have to give

04:23.160 --> 04:28.470
it a player start tag, especially if we're always choosing a player start tag specifically when we

04:28.470 --> 04:29.220
load in.

04:29.700 --> 04:31.620
Let's open our BP beacon.

04:31.620 --> 04:35.850
And for the beacon I'm going to choose its checkpoint mesh.

04:35.850 --> 04:40.200
I'm going to choose static Mesh beacon SMM beacon.

04:42.540 --> 04:48.360
And I'm going to select BP Beacon self and search for that setting bind overlap callback I'm going to

04:48.360 --> 04:53.970
uncheck that and leave the custom depth stencil value override to 252.

04:54.800 --> 05:00.410
So now that I have this beacon, I can see what it looks like in the world by dragging one in.

05:06.730 --> 05:13.090
So it looks like my capsule position is a little funky, so we can adjust that.

05:13.510 --> 05:16.240
I'm going to go ahead and undock this.

05:17.050 --> 05:19.270
So I can see both screens.

05:20.190 --> 05:28.440
And just move my checkpoint mesh out just a bit away from my capsule component, which is right here.

05:32.780 --> 05:34.910
And I'd like to move it down as well.

05:41.820 --> 05:45.780
And I'm going to get this whole actor out just a bit.

05:46.500 --> 05:51.150
So I know where it is in relation to the ground, and I can bring that.

05:52.210 --> 05:53.620
Pillar down a bit.

05:54.770 --> 05:55.910
Like that.

05:56.530 --> 06:02.770
Now we do have a sphere as well, and I can increase that sphere radius if I like.

06:06.020 --> 06:07.730
I'm going to make it a little bigger.

06:07.730 --> 06:08.930
Like this.

06:15.410 --> 06:18.170
I'm actually going to make sure to encompass.

06:18.710 --> 06:21.650
That player starts capsule component.

06:26.990 --> 06:28.010
There we go.

06:30.140 --> 06:32.840
I can save all now and press play.

06:33.630 --> 06:35.220
And I can highlight it.

06:35.220 --> 06:37.470
So that means it's something special, right?

06:37.470 --> 06:42.150
If I click on it, at least if I had a navmesh bound volume, I could move to it.

06:42.150 --> 06:48.300
Now, in order to not be distracted by enemies, I'm going to delete that enemy and just get my nav

06:48.300 --> 06:52.140
mesh bounds volume back across the entire map.

06:52.140 --> 06:58.800
That way I can actually click to move and I can test these things out, like clicking on this beacon

06:58.800 --> 07:00.210
and coming over to it.

07:00.210 --> 07:07.950
Now we're no longer binding that C plus plus callback, but I'd like to use an overlap event for my

07:07.950 --> 07:08.460
sphere.

07:08.460 --> 07:12.510
I'm going to right click and use on component begin overlap.

07:14.390 --> 07:19.130
And I'm going to see if the other actor does implement.

07:20.110 --> 07:21.460
An interface.

07:22.120 --> 07:24.280
We'll check for the player interface.

07:26.750 --> 07:28.100
And if it does?

07:30.380 --> 07:32.810
Well, then I'd like to do a few things.

07:32.810 --> 07:34.070
I'd like to.

07:35.170 --> 07:37.150
Call the blueprint callable function.

07:37.150 --> 07:39.190
We made this blueprint callable.

07:39.340 --> 07:42.490
It's called handle glow effects.

07:42.610 --> 07:46.120
And that's going to end up calling checkpoint reached.

07:46.570 --> 07:50.830
So after calling handle glow effects.

07:53.560 --> 07:56.110
I can implement checkpoint reached as well.

07:58.760 --> 08:01.220
And implement checkpoint reached.

08:03.400 --> 08:07.810
And I have a dynamic material instance at this point so I can make a timeline.

08:08.430 --> 08:11.190
So I'll go ahead and make a beacon timeline.

08:13.560 --> 08:14.970
So add timeline.

08:14.970 --> 08:17.790
I'll call this beacon timeline.

08:19.010 --> 08:20.870
I'll open it up, add a track.

08:20.870 --> 08:24.080
We'll make it a float track called Beacon Track.

08:24.920 --> 08:30.020
I'll make it one second long and right click and add a key.

08:30.020 --> 08:36.800
At time zero it'll have a value of zero, and I'll right click and add a key at time one, and it'll

08:36.800 --> 08:38.330
have a value of one.

08:38.540 --> 08:41.990
I'll go ahead and select both keys.

08:41.990 --> 08:45.140
Make it an auto curve so it's nice and smooth.

08:45.320 --> 08:52.370
And I'll go ahead and play this timeline and move this dynamic material instance with a reroute node

08:52.400 --> 08:54.140
around the timeline.

08:55.410 --> 09:03.690
And I know this dynamic material instance is valid and has a glow parameter because the beacon mesh,

09:04.260 --> 09:09.210
if I browse to it and take a look at its material, it's using my beacon.

09:09.210 --> 09:12.000
And if I open that, it has a glow parameter.

09:14.430 --> 09:18.720
So I can call set scalar parameter value.

09:20.900 --> 09:25.040
And call this on update and set the parameter name to glow.

09:25.190 --> 09:28.130
And I can scale this value.

09:30.620 --> 09:33.710
If I would like a glow parameter.

09:34.160 --> 09:36.200
So I'm going to multiply that.

09:37.530 --> 09:43.860
Track value and promote this to a variable called glow factor.

09:44.280 --> 09:48.660
I know I've repeated that as we have a glow factor in the checkpoint as well.

09:48.660 --> 09:54.480
We could have made that a C plus plus member variable, but I'm going to compile and give glow factor

09:54.480 --> 09:55.980
a value of 100.

09:56.950 --> 10:01.330
And that way we now have our checkpoint being reached.

10:01.930 --> 10:07.780
So now that we're calling the timeline, we should see our beacons glow.

10:08.350 --> 10:09.940
Let's test this out.

10:13.460 --> 10:15.590
And when we reach it, they glow.

10:15.620 --> 10:23.180
I think a glow factor of 100 looks fantastic, and it makes my checkpoints pale in comparison.

10:23.180 --> 10:31.250
So I'm going to open my checkpoint and take its glow factor and up that to, I believe, 100.

10:32.040 --> 10:33.120
It was 20.

10:33.570 --> 10:35.520
Let's see how 100 looks.

10:40.940 --> 10:43.070
That's fantastic.

10:43.610 --> 10:45.740
So now we have these beacons right.

10:45.740 --> 10:50.630
And the beacons have a variable with save game.

10:52.320 --> 10:59.190
In fact, if we go into the My Blueprint panel into variables and we open the checkpoint dropdown,

10:59.190 --> 11:00.690
here's that reached.

11:00.690 --> 11:03.390
This is a save game variable.

11:03.390 --> 11:05.820
It has save game and it's you property.

11:06.270 --> 11:12.900
And by the way if you were wondering you can make blueprint created variables save game variables as

11:12.900 --> 11:13.200
well.

11:13.200 --> 11:18.900
You just have to expand advanced in their details panel and check save game if you wanted to save that

11:18.900 --> 11:19.440
as well.

11:19.440 --> 11:26.280
I don't want to save Glow Factor, but just pointing that out now this should because it's a checkpoint

11:26.280 --> 11:28.260
and implements the save interface.

11:28.260 --> 11:29.310
It should.

11:29.920 --> 11:31.810
Remain glowing.

11:31.810 --> 11:34.630
Once we save the game and exit and come back.

11:34.630 --> 11:36.100
Let's test that out though.

11:36.100 --> 11:37.450
I'm going to put one right here.

11:38.080 --> 11:39.310
I'll move it right there.

11:39.310 --> 11:40.450
And.

11:41.190 --> 11:42.450
Why not?

11:42.980 --> 11:45.020
Let's bring one over here.

11:53.390 --> 11:56.600
I'm going to get a BP beacon on the ground right here.

11:56.600 --> 11:59.600
I'm going to hit the end key to bring it down.

12:01.260 --> 12:04.380
I think I'll rotate it by 90 degrees as well.

12:05.460 --> 12:06.780
And move it right there.

12:07.750 --> 12:09.370
Okay, let's save all.

12:09.370 --> 12:12.610
Let's go to our load menu.

12:13.150 --> 12:18.250
I'd like to delete this slot and create a new one just called S.

12:18.250 --> 12:19.960
Select it and play.

12:20.140 --> 12:21.850
Let's reach this beacon.

12:22.710 --> 12:23.520
There we go.

12:23.520 --> 12:26.190
And let's reach a checkpoint.

12:26.950 --> 12:29.200
Let's exit and come back.

12:33.060 --> 12:35.100
And we did not save the beacon.

12:35.370 --> 12:40.230
And I believe we actually never set be reached to true.

12:40.260 --> 12:50.040
Let's do that after handle glow effects as it was set in checkpoint in our overlap callback.

12:50.040 --> 12:51.660
So we're suppressing that.

12:51.660 --> 12:54.420
So we're never actually setting be reach to true are we.

12:54.420 --> 12:55.740
Let's actually set it here.

12:55.740 --> 12:57.360
We made it blueprint read right.

12:57.360 --> 13:02.520
Let's set it to true on component began overlap.

13:02.520 --> 13:05.970
And now we should be able to load in.

13:08.640 --> 13:10.200
Reach the beacon.

13:10.990 --> 13:13.240
Reach a checkpoint as well.

13:15.320 --> 13:17.450
Exit and come back.

13:21.280 --> 13:23.440
Let's see if that beacon is lit up.

13:23.440 --> 13:24.340
And it is.

13:24.340 --> 13:30.160
So we're saving that beacon and it's now no longer reachable.

13:30.160 --> 13:35.470
And if we wanted to, we could actually suppress the highlight as well.

13:35.470 --> 13:41.020
If something is reached for example, we could no longer highlight it.

13:42.100 --> 13:50.320
You could do that for a checkpoint as well if you wanted to, and that's really not too hard to do.

13:50.350 --> 13:56.560
You can just go into the checkpoint C plus plus class to the highlight function, highlight actor and

13:56.560 --> 13:58.990
only highlight if.

13:59.640 --> 14:01.170
Be reached is false.

14:01.170 --> 14:10.530
So if not be reached then you can set render custom depth to true, otherwise it would be false.

14:10.530 --> 14:14.640
So just a real quick test testing out that feature.

14:14.640 --> 14:16.380
Let's see if we can get that.

14:17.170 --> 14:21.130
Highlighting suppressed when breached is true.

14:24.060 --> 14:25.530
Okay, so we're back.

14:25.530 --> 14:30.810
I don't think I need these blueprints open, but I'm going to go ahead and open the load menu.

14:31.510 --> 14:33.940
And select a slot.

14:34.970 --> 14:38.540
Let's go ahead and let's just reach this beacon over here.

14:39.140 --> 14:43.100
Okay, so we've reached it, and we no longer get the highlighting.

14:44.700 --> 14:45.750
Perfect.

14:50.540 --> 14:53.240
Now we do still run to the location.

14:53.240 --> 14:56.180
We're still overriding that, and I'm fine with that.

14:56.330 --> 14:57.890
I'm actually okay with that.

14:57.890 --> 15:04.070
I would rather that because when an object puts a hole in the nav mesh, clicking on it gives us a pretty

15:04.070 --> 15:07.760
undefined location if we want it to run to it.

15:08.120 --> 15:09.500
Okay, so this is great.

15:09.500 --> 15:18.860
And also due to the cool nature of this highlighting that we get with new beacons, you can kind of

15:18.860 --> 15:23.810
count beacons reaching them as a measure of progress too.

15:23.840 --> 15:28.610
You could put something in the HUD that shows how many beacons you've reached, and when you clear a

15:28.610 --> 15:31.490
dungeon, you can know that you've cleared the whole thing.

15:31.490 --> 15:36.650
If you've cleared all the beacons, and that can be something you can show at the end of a dungeon,

15:36.650 --> 15:37.610
for example.

15:38.280 --> 15:39.300
Excellent.

15:39.540 --> 15:41.160
Plus, they look really cool.

15:41.160 --> 15:42.810
I mean, look at those runes.

15:42.810 --> 15:44.370
That's pretty awesome.

15:45.040 --> 15:45.790
All right.

15:45.790 --> 15:46.480
Excellent job.

15:46.480 --> 15:48.550
And I'll see you in the next video.
