Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/butr/bannerlord.module.template
Template extension for dotnet, eases the process of creating new mods for M&B 2: Bannerlord
https://github.com/butr/bannerlord.module.template
bannerlord bannerlord-mod dotnet dotnet-template mount-and-blade-bannerlord template
Last synced: 6 days ago
JSON representation
Template extension for dotnet, eases the process of creating new mods for M&B 2: Bannerlord
- Host: GitHub
- URL: https://github.com/butr/bannerlord.module.template
- Owner: BUTR
- License: mit
- Created: 2020-11-07T16:18:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-29T13:48:12.000Z (11 months ago)
- Last Synced: 2024-04-26T22:20:47.288Z (7 months ago)
- Topics: bannerlord, bannerlord-mod, dotnet, dotnet-template, mount-and-blade-bannerlord, template
- Language: C#
- Homepage: https://forums.taleworlds.com/index.php?threads/module-template-for-visual-studio-and-dotnet.444482/
- Size: 319 KB
- Stars: 59
- Watchers: 6
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bannerlord Module Template
## Installation
1. Install the latest [.NET Core SDK](https://dot.net).
2. Run `dotnet new --install Bannerlord.Templates` to install the project templates.## Updating
1. Run `dotnet new --install Bannerlord.Templates` to update the project templates.## Creating a new Module
### Creating from command line:
1. Choose a project template i.e. `blmodfx` or `blmodsdk`.
2. Run `dotnet new blmodfx --help` to see how to select the feature of the project.
3. Run `dotnet new blmodfx --name "Bannerlord.MyModule"` along with any other custom options to create a project from the template.### Creating via Visual Studio
You need to have at least an 16.8.x version to create the template!### Creating via Rider
Technically you can create the project from Rider, but Rider does not provide the configuration like Visual Studio does.
We recommend to either create the project from VS or the dotnet CLI and then use it in Rider.## FAQ
### What are the differences between 'soft-dependency' and 'hard-dependency?
**Hard dependency** means that an entry will be added to `SubModules.xml`. Your Module will not include the dependency inside it's `/bin` folder (the .dll). It won't allow the game to run your mod without the dependency installed as a separate Module. This is an important feature to prevent having multiple versions of the same dependency running within the game.
**Soft dependency** means that nothing will be added to `SubModules.xml`. Your Module will include the dependency inside it's `/bin` folder (the .dll).### What is this variable 'Bannerlord Game Folder Location'?
`$(BANNERLORD_GAME_DIR)` is an environment variable. We think that it would be best to set it once on the system instead of hardcoding the game path in the project.
Feel free to replace it with a full folder path like `C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord` if you don't want to use the environment variable.### What is this variable 'Module Name'?
`$(MSBuildProjectName)` is a MSBuild built-in variable that returns the file name of the project file without the file name extension; for example, `Bannerlord.Module1`.### What is this variable 'Module Url'?
If you plan to host your mod on NexusMods or Steam Workshop, we recommend to create a page there and the set the url for this variable!
If you don't plan on keeping the Module folder name the same as the project that is being created, override it.### What is this variable 'Install Community Module Loader'?
See [Bannerlord.ModuleLoader](https://github.com/BUTR/Bannerlord.ModuleLoader).### What is this variable 'Require BLSE Features'?
See [Bannerlord.BLSE](https://github.com/BUTR/Bannerlord.BLSE#features).### What is this variable 'Language Version'?
The version of C# that is used. By default, the value is `9.0`, which is the latest currently.### Should I set 'Use Nullable Feature'?
Read the [docs](https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references) on Nullable reference types to decide if you need this feature!### What are those '$SOMETHING$' variables inside SubModules.xml?
Those are variables that will be replaced with real values when the project is built.
* **$modulename$** is the varible you passed in `Module Name` when creating the Module. It is the `` property used in your project file (`.csproj`)
* **$version$** is the `` property used in your project file (`.csproj`)### What is the '\_Module' folder inside the project?
It is the root Module folder that copies everything that is placed there inside the output.### I build my project and a folder with my Module was created in `GAMEPATH/Modules`!
This is one of the features that this project template provides.
If the `` and `` properties are valid, your Module will be copied in the game's `/Modules` folder automatically. You can test your Module without the need of creating a script that will move everything inside the game's Modules folder.