• Hey, guest user. Hope you're enjoying GameParadise! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Getting started with the BB+ Dev API in 2024

66b08bd1508bc.jpg

Context

The Baldi's Basics Plus Developer API is a commonly used tool when making mods for Baldi's Basics Plus. It is powered by BepInEx, which is a runtime modding framework used for the Unity engine.

The API itself is great, however, one major flaw is that it isn't very beginner friendly. There are almost no official resources for getting started.

With that out of the way, let's get started.

Downloading Visual Studio

Firstly, we need to download Visual Studio Community 2022 (NOT to be confused with Visual Studio Code!). This is where we will do all the actual programming. You can download the IDE from here.

After opening the installer, in the Workloads tab, click on the .NET desktop development workload. This is essentially required to work with C# in Visual Studio.

After installing, open the application.

Creating the project

After opening the application, you may need to log into a Microsoft account. After you input the required information, select Create a new project.

Use the Search for templates field to find the Class Library template. Select it and click Next.

Fill in info such as project name and location. For the sake of this tutorial, I'll be naming our project PlusTutorial.

Click Next, and select .NET Standard 2.1 as the framework. Then, press Create.

A window should open containing your new project:
image.png

Head over to the Solution Explorer on the right. Right click PlusTutorial > Dependencies > Add Project Reference.

Head to the Browse tab, then press the Browse button.

Navigate to your Baldi's Basics Plus folder. Go to BALDI_Data > Managed, select every file, then click Add.

Next, download the latest BepInEx 5.0 release (Do not download a 6.0 release!) for your operating system.

Extract all of the files into your Baldi's Basics Plus folder.

Head back to Visual Studio 2022, click Browse again, and add every file from BepInEx > Core, EXCEPT 0Harmony20.dll. From my experience this causes conflicts with certain functions you may use while developing your mod.

Next, download the latest release of the Baldi's Basics Plus Developer API. Extract all of these files into your Baldi's Basics Plus > BepInEx > plugins folder. if the plugins folder does not exist, create it. Alternatively, launching the game should create these folders automatically.

Head back to Visual Studio, click Browse again, and add every file from the Developer API. This includes Newtonsoft.Json.dll!

Finally, press the Ok button.

Importing all of the files may take a bit of time. After it finishes, you may get some errors about invalid references. These can be ignored, close the tab and press the Ok button again.

Head back to the Solution Explorer. Rename the Class1.cs file to BasePlugin.cs.

Then, paste the following content into your renamed file:

```
using BepInEx;

using HarmonyLib;

using MTM101BaldAPI;

namespace PlusTutorial
{
[BepInPlugin("tutorials.plus.setup", "Plus Tutorial", "1.0.0.0")]

[BepInDependency("mtm101.rulerp.bbplus.baldidevapi")]

public class BasePlugin : BaseUnityPlugin
{
public void Awake()
{
Harmony harmony = new Harmony("tutorials.plus.setup");

harmony.PatchAllConditionals();
}
}
}
```

Then, go to your Baldi's Basics Plus directory. Go to BALDI_Data > StreamingAssets and create a folder with the name Modded. Inside that folder, create another one named tutorials.plus.setup. This is where you will store assets later on.

If you want to change the name and path of your mod, you can change every instance of Plus Tutorial and tutorials.plus.setup in the code above and the recent folders you created.

In the code here, the Awake method is called when the game is loaded. It's where we add items, characters, and other assets.

Now that we have the core project created, go to the top toolbar, and select Build > Build Solution.

Once the compilation has completed, go to PlusTutorial/bin/Debug/netstandard2.1. The built mod file should be named PlusTutorial.dll.

Copy this file back into your Baldi's Basics Plus > BepInEx > plugins folder.

And there you go! You now have a built .dll file for your BepInEx mod. You can now boot up the game and your plugin will be loaded. However! Currently your plugin has 0 functionality.

Where to go from here

This is the end of the tutorial. However, you may be wondering how to actually create something with your plugin. Here are some useful resources that should be able to get you started on adding new content.

The Carnival Pack - This mod adds a new character, item, and room to the game. I referred to the source code of this mod to learn the fundamentals of adding new characters and items. In general, looking at the source code for Baldi's Basics Plus mods is a great way to learn how to make them.

The official BB+ Dev API wiki - It can be useful for documenting some very specific aspects of the API.

Unity Scripting Reference - For documentation on specific classes in the Unity game engine.

Knowledge of C# is also very helpful, as it is the language you will be working with. As long as you have had some programming experience, even with other languages, it should be very easy to pick up.
About author
admin
Avid gamer.

Comments

There are no comments to display.

PC/MAC Tutorial information

Author
Chad Waliser
Article read time
4 min read
Views
2,874
Last update

More in PC/MAC

More from Chad Waliser

Share this pc/mac tutorial

Back
Top