SCP: Containment Breach Remastered

SCP: Containment Breach Remastered

Not enough ratings
Modding Documentation
By hunter
This guide provides all the information you need in order to make a mod for SCP: Containment Breach Remastered.
   
Award
Favorite
Favorited
Unfavorite
Enabling the debug console
While developing mods, enabling the debug / developer console can be useful to find errors in your scripts, and to see what your mods are actually doing to the game at runtime. To enable the debug / developer console, follow the steps below:

First, open the properties window for SCP: Containment Breach Remastered by right clicking the game in your Steam library.



Next, under general options in properties, type in "-console" in the custom launch options setting.



An that's all you have to do to enable the debug / developer console! When you start the game, a window looking like this should pop up:



Please keep in mind, the Steam Overlay may not function properly while the debug / developer console is enabled. To disable the debug / developer console, just remove the launch argument the same way you added it above.

Also, to see exactly what your mod and the SCPSDK library are doing at runtime, enable the "Show Trace Messages" option.
Creating the base mod
The folder structure of your mod should reflect the preferred structure below:


Although this folder structure isn't required, it's highly recommended as it makes it much easier to see what your mod is doing to the game.
Creating the mod.toml file
The mod.toml file is the main configuration file for your mod. There are a few options that you can customize within the mod.toml file. The mod.toml file should specify the name of your mod, the delimiter (the mod reference id), the version of your mod, and the description of your mod.


This is an example of a mod.toml file that adds my custom map to the game.
Making a simple script
To make a simple script, you must create a .lua file inside of your mod's directory. Preferably, you should place the script inside the "Assets\Scripts\" directory. You can name the script whatever you want.

There are a few methods available to you inside these Lua scripts.

Method
Arguments
Description
Game.RedirectFile
2 (fileToReplace: string, fileToReplaceWith: string)
Replaces the file specified in the game directory with another file specified in your mod.
Game.SetGameTitle
1 (newTitle: string)
Replaces the title on the main menu to what you specify.
Game.ImplementMap
1 (mapFile: string)
Adds a map file you specify into the game.
Game.ImplementLang
1 (mapFile: string)
Adds a language file you specify into the game.
Game.Wait
1 (time: int)
Waits a specified number of seconds.
Console.Info
Any# (text: string, ...)
Prints the specified text as an info type log to the debug console.
Console.Warn
Any# (text: string, ...)
Prints the specified text as a warning type log to the debug console.
Console.Error
Any# (text: string, ...)
Prints the specified text as an error type log to the debug console.
Console.Trace
Any# (text: string, ...)
Prints the specified text as a trace type log to the debug console.

In order for the script to be ran, you must add it to the mod.toml file like the example below. You can add as many scripts as you'd like to.

Relational paths in scripts
When specifying a path in your mod, you must use the relational path format. When creating your mod.toml file, you specify a delimiter. This value is extremely important as that is how you reference your mod inside of scripts.

For example, if my mod's delimiter is "mymod" and I wanted to reference a file in my mod, I would need to use a path like this:

Changing a game file
In order to replace a game file, you must create a simple script which you can find out how to do above.

To replace a game file, your mod must contain the file that you want to replace a game file with. In this tutorial, I will be replacing the Main Menu background.

First, you must place your custom menu background in your mod. I will place my custom texture in "Assets\GFX\" and name the file "custommenu.png".

Next, you must make a script so you can replace the file at startup. I will replace the main menu background with my texture by adding the following line:



You can use this method to replace any type of file present in the game files. Please keep in mind that when you replace a file, the file type should be the same as the file you are replacing. If not, it may cause crashes.
Adding a custom map
In order to add a custom map to the game, you must first add the map to your mod's directory. Preferably, you should place your custom maps in the "Assets\Maps\" folder. I will place my map in that folder and call it "mycustommap.cbmap2".

In order to actually implement the map into the game, you must have a script. I will add my custom map using the following line:

Changing the main menu title
In order to change the game's title on the main menu, you must have a script.

You can change the main menu title to whatever you specify. For example, I will change the main menu title to "Cool Breach Mod" using the following line:

Uploading your mod
To upload your mod, you must run the workshop mod uploader by choosing the "Launch Workshop Mod Uploader" option when launching the game through steam.
Disclaimer
I understand there aren't many advanced things that you can do with this modding system at the moment, but this is a preview version of the modding system that will be expanded, modified, and updated with every update. I've been working on the system for a while trying to perfect it's current state and how it functions which is why it has taken a long time without a lot of functionality. New features will be added frequently. If you have any suggestions, please don't hesitate to join our discord here[discord.gg] and let me know!
10 Comments
Danty 22 Jul @ 8:27am 
Someone should make a yt tutorial, ez 100k views lol
excluz1v 2 Apr, 2024 @ 12:00pm 
Норм
Mad_Tost_Poland 23 Mar, 2024 @ 2:53am 
how can i do it with workshop?
mario64thane 13 Feb, 2024 @ 11:33am 
I've tried modding the game but the only thing that actually worked was changing the title, I've tried adding a custom map but that didn't work at all, I've tried replacing textures but that causes the launcher to crash, what do I do?
The Egg Doctor 16 Dec, 2023 @ 5:10am 
Cool, but how do you type in the console?
Dragon4k ツ 15 Aug, 2023 @ 7:15am 
@_wania no, we need to wait :/
iam 15 Aug, 2023 @ 2:03am 
Is there a way to update already uploaded content in the workshop?
ebb 9 Aug, 2023 @ 2:46pm 
Хорош
:steamthumbsup:
Mammut 2 Aug, 2023 @ 12:15am 
wow
vernilon 1 Aug, 2023 @ 9:02pm 
good