WEBVTT

00:07.310 --> 00:08.270
Welcome back.

00:08.270 --> 00:12.140
So we now have the ability to show the map name.

00:12.260 --> 00:18.860
And we're only setting that if we click on new slot we're setting it on our load slot here.

00:18.860 --> 00:21.080
But we're not actually saving it to disk.

00:21.080 --> 00:25.670
Which means if we close the game and come back in, the map name is blank.

00:26.030 --> 00:30.560
So we need to actually load that in just like we're loading in our player name.

00:30.560 --> 00:32.690
And that means we need to save it to disk.

00:32.690 --> 00:35.240
So we're going to do that in this video.

00:35.570 --> 00:38.420
Now when are we saving to disk.

00:38.420 --> 00:41.480
Well we're doing it in new slot button pressed.

00:41.840 --> 00:45.560
When we save slot data we're passing in that slot.

00:45.560 --> 00:49.580
But save slot data doesn't save the map name.

00:49.580 --> 00:53.840
Let's go into our game mode base and see we see save slot data here.

00:54.500 --> 00:56.960
It creates our save game object.

00:56.960 --> 01:03.050
It's cast to a load screen save game and we're saving in that load screen save game, the player name

01:03.050 --> 01:06.800
and the save slot status, but not the map name.

01:07.100 --> 01:10.670
We need to add the map name to our load screen save game.

01:10.670 --> 01:14.660
So let's go to Load Screen Save game and add a map name.

01:14.660 --> 01:17.990
Let's go ahead and just copy Player name.

01:18.930 --> 01:22.080
Paste it here and call this map name.

01:23.820 --> 01:28.980
And for the default value, we'll call it default map name, which we should never see because.

01:29.680 --> 01:35.260
We're always going to save the map name now, and we'll do that in our game mode base right here where

01:35.260 --> 01:38.170
we're saving our other properties.

01:38.170 --> 01:47.860
So we'll take load screen save game, get that map name and we'll save it to the load slot map name.

01:47.860 --> 01:51.370
So we can call get map name from the load slot.

01:51.670 --> 01:53.140
So now we're saving it.

01:54.130 --> 01:56.320
But what about when we're loading up from disk?

01:56.320 --> 01:57.850
We need to do that too.

01:58.210 --> 02:04.270
We're doing that and get save slot data, which just returns our load screen save game.

02:04.510 --> 02:09.070
We have to harvest that data in our mVVM load screen.

02:09.070 --> 02:11.080
So where are we calling that?

02:11.080 --> 02:12.640
Right here in load data.

02:12.640 --> 02:13.540
We're doing it.

02:13.870 --> 02:22.240
So when we load data we need to get our load slot dot value because we're in a map here load slot dot

02:22.240 --> 02:22.990
value.

02:22.990 --> 02:28.150
And we need to set the map name with our setter we call the setter.

02:28.150 --> 02:31.300
It's going to broadcast the field notify which is what we want.

02:31.330 --> 02:38.350
Now we can get the map name from our save object, which is of course of type load screen save game.

02:38.350 --> 02:42.190
So we can take save object and get the map name from it.

02:42.190 --> 02:48.310
And that way we'll set our field notify as we're loading in from disk.

02:48.580 --> 02:50.410
So with that we can test this out.

02:50.410 --> 02:56.320
We can run in debug mode and make sure that we're loading in that map name that we're now saving to

02:56.320 --> 02:56.980
disk.

02:58.510 --> 03:01.330
Okay, so we can get things open here.

03:02.590 --> 03:09.940
We know that our map already has its text map value here bound to the field notify.

03:10.240 --> 03:13.570
Now that we're saving to disk and loading, let's see how this works.

03:13.570 --> 03:14.410
We can press play.

03:14.410 --> 03:20.350
Now we're just going to get default map name because we never actually saved these names to disk yet.

03:20.350 --> 03:23.200
So we need to go ahead and just delete these slots.

03:26.530 --> 03:30.640
And if we create a new slot now we see first dungeon.

03:30.640 --> 03:36.070
We're setting that, and if we close and come back, first dungeon has been saved to disk and we're

03:36.070 --> 03:37.240
loading it from disk.

03:37.240 --> 03:38.710
So we see it here.

03:38.830 --> 03:42.700
So we can do that with any of these as soon as we've done this.

03:42.700 --> 03:46.300
Now first dungeon is saved to disk and we load it back.

03:46.630 --> 03:54.130
And if we save over this, then we can update that dungeon to whatever map that we travel to and save.

03:54.430 --> 03:56.140
And we'll see that here.

03:56.530 --> 04:02.500
So now that we're saving the map name to disk, it's time to be able to select the slot, press play

04:02.500 --> 04:04.150
and travel to that map.

04:04.150 --> 04:11.950
Now we can identify the map and our game mode should have a map with that default map inside of it.

04:11.950 --> 04:14.440
And that's going to allow us to travel to it.

04:14.440 --> 04:15.460
So let's do that.

04:15.460 --> 04:16.690
We'll do that next.

04:17.050 --> 04:17.800
I'll see you soon.
