Skip to content

Creating A DLL File

Yasin Karaaslan edited this page Sep 12, 2022 · 7 revisions

In this page you will learn how to create your own DLL files and where to put them.

Rules

There are a few rules you need to learn before we go any further. These are really important.

  • DLL files MUST be a .NET DLL.
  • Class name MUST match with the file name. For example, if your file name is TestDLL.dll then your class name MUST be TestDLL.
  • The class MUST NOT use namespaces (Maybe you can play around it and use something like MyNamespace.MyClass.dll but I didn't test it. It is better not to use them). You can use namespaces in other parts of your project but the class associated with your DLL name must not use any namespace.
  • If you want to implement in game methods, you MUST implement them with their references. For example, if you want to call BannerlordGameStart then you should reference to TaleWorlds.Core.dll and use TaleWorlds.Core.Game and TaleWorlds.Core.IGameStarter. I didn't test the methods without using references but it will probably cause crashes.

How

After you create your DLLs, create a folder called "Scripts" (capital is important, idk why I did it this way.) in Bannerlord base path and put all your DLLs in there. It should run as expected.

Clone this wiki locally