---
description: How to take a rundown and reduce it to one level
---

# Isolating a level

## Overview

This step isn't necessary (and in some ways it's better not to do this at all), but for learning purposes it's good to understand exactly what we'll be working with.

For this step we're going to trim the main datablocks that we'll be working with (specifically Rundown and LevelLayout) so that they only contain one level.

This also doubles as an exercise in using VS Code.

## Isolating blocks

### Setup

To start, we'll grab a copy of the unedited Rundown, LevelLayout and GameSetup datablocks. You can follow along with how to generate them using MTFO from [The Complete Newbie Guide](../the-complete-newbie-guide) or grab them from the archived versions at [OriginalDataBlocks](https://github.com/UntiIted/OriginalDataBlocks) . You can also view the final version of our edited datablocks here: [Final datablocks version page](final-datablocks-version). Put these inside a folder in the `GameData` directory of BepInEx. You'll have something like this:

<figure><img src="https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2F1StUEOz39OmbJ27Ps4Pc%2F1.png?alt=media&#x26;token=b95cd306-d514-4bff-9880-f467ccbe7d01" alt=""><figcaption><p><code>GameData</code> folder of BepInEx.</p></figcaption></figure>

<figure><img src="https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FppkpB1fZLHb8d4SD9ypn%2F2.png?alt=media&#x26;token=dc0f03a6-0881-4d92-990d-8eb41c5db229" alt=""><figcaption><p>The datablocks inside our <code>GameData</code> folder.</p></figcaption></figure>

{% hint style="info" %}
MTFO can load datablocks directly from the `GameData` folder, but it is better to keep them organized in a separate folder. MTFO also used to support loading datablocks from the `plugins` folder instead, which is what you'll see in many mods and other guides (and even in other parts of this wiki!). Placing datablocks in the `GameData` folder is now preferred.
{% endhint %}

Open your `GameData` folder with VS Code.

<figure><img src="https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FwrTsOV1ozVuRLIduZSkJ%2F3.png?alt=media&#x26;token=f9de81d1-0ef6-439d-a3f0-7551c1d029f4" alt=""><figcaption><p>Context menu to open the folder directly in VS Code.</p></figcaption></figure>

### Deleting rundown blocks

Open the Rundown datablock and delete the headers.

![Headers selected to delete](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FsAgbGREKD3EpJJ50RnVR%2Fimage.png?alt=media\&token=31d2a8c5-8ff3-407d-8108-9fe194519b28)

{% hint style="info" %}
Headers have no impact on modded datablocks, deleting them is optional. They're used only by the devs in their editor tools.
{% endhint %}

Now we'll delete all but one rundown from the `"Blocks"` part of the datablock.

First, find the `"Tutorial Holder"` rundown's block. This contains the game's tutorial, and its presence is hardcoded so we can't delete it.

Go to the start of the block, collapse it, and copy it. (Or, if using VS Code, you can use `Control + Shift + [` to collapse the block your cursor is in).

![R6 block collapsed and selected to copy](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2Fj7LUWzbtSIYeV0z6XyIK%2Fimage.png?alt=media\&token=74571794-6b35-4f1c-8fa9-61f901de3521)

Paste it at the bottom of the blocks.

Find the rundown that contains whichever level you'd like to use as a foundation. In this case, we'll use Rundown 6.

![Rundown 6.0 block](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FqxWN2RMJwzScTlOUO6Cj%2Fimage.png?alt=media\&token=97cb0e81-38ab-4b69-b167-691423200f7e)

Collapse it, copy it and paste it at the bottom of the blocks.

Delete all the other blocks, aside from our two at the bottom (it's easiest to do this by collapsing them all). Once we're down to just our two blocks you might need to fix some formatting. There should be a comma between our two blocks, but not one at the end.

<figure><img src="https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FwMgIUrRTzhlDAg2ho4ZW%2F4.png?alt=media&#x26;token=cfabb396-1ca3-4f5f-9230-33f9233207f8" alt=""><figcaption><p>The Rundown datablock trimmed to just two rundowns.</p></figcaption></figure>

### Deleting all but one level from the rundown

We only have one rundown and we want to keep only one level in it. Let's go with B2.

Collapse all the tier blocks.

![R6 tier blocks collapsed](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FTxlsRVyr9XmzoZH9J5gz%2Fimage.png?alt=media\&token=94d1e47f-1ceb-4efb-93da-219ad1e60089)

Delete everything but B tier.

{% hint style="warning" %}
Make sure you don't delete the tiers themselves, just leave them empty. Otherwise the rundown will not load correctly.
{% endhint %}

![R6 with only B tier](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FrcUiqwMWE3ZO3O7n2DwX%2Fimage.png?alt=media\&token=acc47bfc-3815-488a-b16e-5fd3e17832f0)

Confirm that the 2nd object in B tier is B2 "Contaminant" and collapse the tier blocks

![B Tier collapsed](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2F7FjeCFrCqRM0B7FWImjD%2Fimage.png?alt=media\&token=0b3a5845-26e0-4333-b2e9-9e5d60f2706c)

Delete all but the 2nd block.

![B Tier with only B2 left](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2Fw9WQxtL2bZF1MbmtTWxC%2Fimage.png?alt=media\&token=ead6dcfd-8264-4643-ae5c-bae3984ac08d)

B2 has now become B1 and is the only level in the rundown.

{% hint style="info" %}
At the bottom of the rundown's block there is the `"persistentID"`. When the rundown's ID is not 1, GTFO API ensures all levels are unlocked, so we don't have to take care of that ourselves. If you want to include level progression, you'll have to set the ID to 1 and then use the "Accessibility", "UnlockedByExpedition", and "CustomProgressionLock" fields to control levels being unlocked.
{% endhint %}

### Deleting secondary layer

Contaminant is the only level in our rundown, but it still has a secondary layer. Let's _thoroughly_ remove the secondary layer from the Rundown datablock. We'll have to remove quite a few sections, see the image below for what we have to remove. We need to remove the bulkhead information from the main layer, and also a bunch of stuff from the secondary layer. After we're done, the secondary layer should look the same as the third layer.

![Contaminant with secondary layer removed. Pay attention to the red triangles next to line numbers.](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FRHC6ZtnikkBdR2qrx0PG%2Fimage.png?alt=media\&token=bf5d9083-9efd-4577-9a31-7cff8f7803a3)

### Deleting level layout blocks

Now we have to do the same to the LevelLayout datablock. We'll find the correct level layout ID and delete the rest.

In the picture above from our rundown block, you can see that `LevelLayoutData` is set to 162. That's our main layer level layout.

Open the LevelLayout datablock and find the block with this ID.

![R6B2 main layer level layout](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FReelNcaeawn4LjGgyozp%2Fimage.png?alt=media\&token=34bc8144-6476-432a-9b39-249b091e768c)

Repeat the same process as for our rundown blocks: collapse it, copy it, collapse all blocks, delete them, paste the copied block, delete the comma.

Remember VS Code has to process over 200k lines here so don't be too harsh if it lags a bit. Deleting at least a part of the blocks does have practical use here as VS Code and its plugins won't take time to load when editing huge files like this one.

There should only be a few thousand lines left in this file.

### Modifying game setup datablock

Most of the work is now done, and we only have to do a minor tweak to the GameSetup datablock. Open it up and change the `"RundownIdsToLoad"` to only contain the rundown ID for your rundown. The rundown's ID is the `"PersistentID"` number at the bottom of the rundown's block.

### Regarding changing IDs

We talked briefly about changing the ID of our rundown block earlier. While this is not a necessary step anymore thanks to GTFO API, it was originally agreed with devs to change all custom rundowns' ID to 1. If you did do this, you'll obviously have to change the `"RundownIdsToLoad"` to match.

You're also allowed to change the LevelLayout block IDs. If you do so, then you'll have to change the `"LevelLayoutData"` from the rundown's block to match.

### Verifying

Remember to save everything.

Launch the game. You should now see only B1 in the rundown menu.

![R6.5 with only B2 Contaminant, now shown as B1.](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FFdIhthT5zz0Wt0mLLhpU%2Fimage.png?alt=media\&token=c9f3ebb1-a66f-40b7-affc-400a937f7748)

Drop into the level. You should now have only the one rundown, and the level itself should load just fine. If you have freecam or some other mods, you can use them to check what the level looks like more easily. See if anything has changed.

You should see some marker (all sorts of objects placed in the level, a whole different topic) placement differences, also the lack of the secondary layer.

Oh and we deleted the bulkhead key, controller, and the bulkhead door (which is now just a security door) from the main layer. If you want to restore that, you can do so by restoring these 3 fields from the original datablock we kept as a backup (you did keep some as a backup, right?):

* ZonesWithBulkheadEntrance - zones in same layer (main) that have bulkhead entrances.
* BulkheadDoorControllerPlacements - where to place bulkhead door controllers. If a zone with a bulkhead entrance does not have a door controller, the entrance will not require a bulkhead key.
* BulkheadKeyPlacements - where to place bulkhead keys in the layer.

Make sure you restore the ones under `MainLayerData` and not secondary. You can also just copy the whole `MainLayerData` block.

Later sections of the guide will assume you restored these (or didn't delete them to begin with).

If you did actually restore and verify again, the terminal near the bulkhead might be near the zone door in front of the door controller now.

![Bulkhead zone new terminal location](https://3973191706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MMzImARIIXgtwqSyjDR%2Fuploads%2FhA7vZh33tSNz7RInfBXu%2Fimage.png?alt=media\&token=c251cf3f-95fd-406b-b0f4-473b8512e775)

The Rundown, LevelLayout and GameSetup blocks are now cleaned up and we can move onto the 2nd step in the guide.
