From df11b354bd40f36ca8897ae4978a0657df46bb4e Mon Sep 17 00:00:00 2001 From: Kay Steinhoff Date: Wed, 6 Aug 2025 21:58:04 +0200 Subject: [PATCH 1/3] Added a setup guide for mod development on Linux --- docs/_tutorials/basic-csharp-mod.md | 85 ++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/docs/_tutorials/basic-csharp-mod.md b/docs/_tutorials/basic-csharp-mod.md index 0ba94be..7ebdd03 100644 --- a/docs/_tutorials/basic-csharp-mod.md +++ b/docs/_tutorials/basic-csharp-mod.md @@ -51,7 +51,7 @@ The following guide will walk you through step-by-step on how to create a basic For more information on the Module folder structure, [Click Here](../_intro/folder-structure.md). -### Setting up your Project +### Setting up your Project (Windows) Before setting up a project, it is important to know that **this is not required for basic mods** (e.g. changing or adding items/characters/scenes). @@ -62,6 +62,89 @@ Before setting up a project, it is important to know that **this is not required 5. [Reference](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-add-or-remove-references-by-using-the-reference-manager?view=vs-2019) the `TaleWorlds.*` DLLs in the `bin\Win64_Shipping_Client` directory of your game files (not your module directory). 6. [Reference](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-add-or-remove-references-by-using-the-reference-manager?view=vs-2019) the DLLs for each official module in `Modules\ModuleName\bin\Win64_Shipping_Client`. +### Setting up your Project (Linux) + +Before setting up a project, it is important to know that **this is not required for basic mods** (e.g. changing or adding items/characters/scenes). +It is assumed you have basic VSCode knowledge(how to install extensions, how to create .NET projects). + +**SDK** + +Since Mount & Blade 2: Bannerlord is written using the .NET Framework 4.7.2 you'll have to install the .NET SDK(don't worry about how we'll compile for .NET Framework we'll come back to it). +Luckily it is rather easy to install as Microsoft has a comprehensive tutorial [here](https://learn.microsoft.com/en-us/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website) on how to do it both manually and scripted. +You can choose either but the scirpted one is easier to do. + +After installing the latest .NET version run the following command in the terminal: + + ``` + which dotnet + ``` + +If a path is printed the SDK was successfully installed. If not check if the directory `/home//.dotnet` exists. If it does run the following command to add it to your `PATH` variable. +**Note that this will not be carried over into the next session. Please check how to permanently add PATH variables if you wish to do that.** + + ``` + export PATH=$PATH:/home//.dotnet/ + ``` + +If you now run the previous `which` command again you should see a path being printed. + +**IDE** + +As Visual Studio is a Windows-only application we'll use Visual Studio Code. +It is of the utmost importance that you install VSCode using the command line as it is otherwise possible that VSCode is unable to open a terminal instance, making it impossible for it to find the installed .NET SDK. +Luckily Visual Studio Code has a tutorial [here](https://code.visualstudio.com/docs/setup/linux) which covers multiple distros such as Ubuntu, Fedora, Arch, etc. + +Once you've followed your distobution specific installation guide run the following command: + + ``` + code --version + ``` + +A result simiar to this should be printed: + + ``` + 1.102.3 + 488a1f239235055e34e673291fb8d8c810886f81 + x64 + ``` + +This will confirm that Visual Studio Code has been successfully installed. + +Once done start Visual Studio Code by typing: + + ``` + code + ``` + +**Final setup** + +Once Visual Studio Code has started and you have **not** received an error message of the .NET SDK not being located a few extensions have to be installed: +- C# Dev Kit +- vscode-solution-explorer(Optional but very helpful) + +Once all extensions are installed create a new Class Library project. +Edit the *.csproj file(either provided as a plain text file in the Explorer or Right Click->'Open file' using the vscode-solution-explorer) and modify it to look like this: + + ``` + + + + + net8.0;net472 + + + + + + + + + + + ``` + +Now you should be set up to make Mount & Blade 2: Bannerlord on Linux. + ### Debugging your Project (Optional) #### Way 1 (Preferred) From d13296bed8a1978ee71d9e77bfff9c591ffab430 Mon Sep 17 00:00:00 2001 From: Kay Steinhoff Date: Wed, 6 Aug 2025 22:01:21 +0200 Subject: [PATCH 2/3] Updated Linux setup guide to properly display code segments --- docs/_tutorials/basic-csharp-mod.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/_tutorials/basic-csharp-mod.md b/docs/_tutorials/basic-csharp-mod.md index 7ebdd03..55b531a 100644 --- a/docs/_tutorials/basic-csharp-mod.md +++ b/docs/_tutorials/basic-csharp-mod.md @@ -75,16 +75,12 @@ You can choose either but the scirpted one is easier to do. After installing the latest .NET version run the following command in the terminal: - ``` which dotnet - ``` If a path is printed the SDK was successfully installed. If not check if the directory `/home//.dotnet` exists. If it does run the following command to add it to your `PATH` variable. **Note that this will not be carried over into the next session. Please check how to permanently add PATH variables if you wish to do that.** - ``` export PATH=$PATH:/home//.dotnet/ - ``` If you now run the previous `which` command again you should see a path being printed. @@ -96,25 +92,19 @@ Luckily Visual Studio Code has a tutorial [here](https://code.visualstudio.com/d Once you've followed your distobution specific installation guide run the following command: - ``` code --version - ``` A result simiar to this should be printed: - ``` 1.102.3 488a1f239235055e34e673291fb8d8c810886f81 x64 - ``` This will confirm that Visual Studio Code has been successfully installed. Once done start Visual Studio Code by typing: - ``` code - ``` **Final setup** @@ -125,7 +115,7 @@ Once Visual Studio Code has started and you have **not** received an error messa Once all extensions are installed create a new Class Library project. Edit the *.csproj file(either provided as a plain text file in the Explorer or Right Click->'Open file' using the vscode-solution-explorer) and modify it to look like this: - ``` + ```xml From 69731b03157553d8c3deb5210cc9bac80d4ad34e Mon Sep 17 00:00:00 2001 From: Kay Steinhoff Date: Wed, 6 Aug 2025 22:03:45 +0200 Subject: [PATCH 3/3] Fixed the XML code segment issue in the Linux setup guide --- docs/_tutorials/basic-csharp-mod.md | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/_tutorials/basic-csharp-mod.md b/docs/_tutorials/basic-csharp-mod.md index 55b531a..e5e051c 100644 --- a/docs/_tutorials/basic-csharp-mod.md +++ b/docs/_tutorials/basic-csharp-mod.md @@ -115,23 +115,23 @@ Once Visual Studio Code has started and you have **not** received an error messa Once all extensions are installed create a new Class Library project. Edit the *.csproj file(either provided as a plain text file in the Explorer or Right Click->'Open file' using the vscode-solution-explorer) and modify it to look like this: - ```xml - - - - - net8.0;net472 - - - - - - - - - - - ``` + ```xml + + + + + net8.0;net472 + + + + + + + + + + + ``` Now you should be set up to make Mount & Blade 2: Bannerlord on Linux.