SCP: Containment Breach Multiplayer

SCP: Containment Breach Multiplayer

Not enough ratings
Creating a Workshop Addon
By ⛧aura⛧
This contains a list of functions and some examples
Not originally written by me, just put here and cleaned up + added a bit for convenience sake, credit can be found at the end of the guide
(Includes List of all Functions within Additional Resources)
   
Award
Favorite
Favorited
Unfavorite
Part 1 - Getting started with using SteamWorkshopUploader
If you've already created the addon, added an image, title and description, you can continue to the next step.

Inside the game files there's a SteamWorkshopUploader folder, open that and run SteamWorkshopUploader.exe
In the bottom left, there's a textbox and a button with the text Create Item. Put what you want to name your addon inside that textbox and then click the button. Now your files should've been generated.

Additionally in SteamWorkshopUploader remember to add a title, description and preview image - you can leave the uploader open if you want.
Part 2 - Setting up your addon structure
Inside "SteamWorkshopUploader/WorkshopContent" you should see your addon folder, open it.
Place all the files you want to change, for convenience name them as they are in the game files and use the same folder structure.
Part 3 - Setting up redirects
SCP: Containment Breach Multiplayer has a script API made using Skynet++

It allows for many things, it's additionally also used to set up addons. To get a general idea, here's the list of workshop functions:
  • RedirectFont(OriginalFile:String, WorkshopFont:String)
  • RedirectFile(OriginalFile:String, WorkshopFile:String)
  • RedirectText(OriginalText:String, WorkshopText:String)
  • StopRedirectText(OriginalText:String) // Removing RedirectText, use in OnDisconnect()
  • StopAllRedirectText()
  • InitLoadingScreens(loadingscreensfile:String)
  • InitInfoClues(cluesfile:String)

Now let's show an example:

#playerscript RedirectFile("Loadingscreens\106.jpg",getscriptpath()+"\Loadingscreens\106.jpg")

getscriptpath()+ appends the script's path (addon's root folder) to the start of the replaced directory for easier management.
For convenience, the folder structure was written as if this was in the game files.

#playerscript should be included to avoid compilation issues.
Part 4 - Compiling the script
Back in SteamWorkshopUploader, there's a ScriptsCompilerFolder. By default it should at least contain 3 files:
  • compiler.exe
  • compilersettings.ini
  • fmod.dll

Create a new text file, for the sake of simplicity name it workshopscript. Using the function list and example above, add the file redirects for the things you want to replace or add. Once you're done with that rename the file of workshopscript.txt to workshopscript.gs

Now you only need to do this step once, open compilersettings.ini and add this line:
  • compile workshopscript.gs
Then save the ini. Be sure to change this when making a different addon.

Now run compiler.exe, and after it's done you can close it. You should now have a workshopscript.gsc, move that to the root of your addon folder. You're pretty much done with the addon folder now.

You will still have to add the redirects and recompile that script everytime you add new content.

Go back to SteamWorkshopUploader.exe, click on your addon which should appear in the list. Somewhere on the screen you should see a Submit [addon name] button and next to it a textbox, that textbox is optional you don't need to add anything there. If you're done with setting up everything you can click the submit button.
Additional Resources - Functions, Callbacks, Variables
While this is only a guide to publish a basic workshop addon, you can find more resources below if you wish to delve deeper into scripts for either the workshop or servers.

Client
Client operations, anything available on the client can be used in workshop
  • Client functions[web.archive.org] - Functions that can be used in client and workshop scripts
  • Client callbacks[web.archive.org] - Callbacks that can be used in client and workshop scripts
Server
Only server callbacks, functions, etc.
  • Server functions[web.archive.org] - Functions that can be used in server scripts
  • Server callbacks[web.archive.org] - Callbacks that can be used in server scripts
Shared
Functions that work on server and client
Anything that works on client works in workshop scripts
  • Shared functions[web.archive.org] - Functions that can be used in client, server and workshop scripts
Misc variables
Some variables that are needed for some functions. Also some of them are helpful for server owners.
  • Variables[web.archive.org] - Variables that can be used in client and server scripts
Credits
All info retrieved from the old SCP:CB Multiplayer Wiki[web.archive.org] (archive link because the original was dead and this info isn't on the new site)
5 Comments
Theme_Elster512 21 Aug, 2024 @ 3:10pm 
only came because you had a Va-11 Hall-A pfp
⛧aura⛧  [author] 11 Aug, 2023 @ 12:25pm 
you have to put your current .gs script into \SteamWorkshopUploader\ScriptsCompiler before compiling, then put the new .gsc in the \WorkshopContent folder or \workshop\youraddons folder, depending on if you're publishing or just testing
⛧aura⛧  [author] 11 Aug, 2023 @ 12:23pm 
there are already examples for uploading to the workshop in the \SteamWorkshopUploader\WorkshopContent folder
matveytheman 4 Aug, 2023 @ 10:03pm 
For some reason in compiling I keep getting the error "file does not exist"
matveytheman 4 Aug, 2023 @ 9:42pm 
How do i add the preview image? Does it have to be in the containment breach files?