Giter Site home page Giter Site logo

adobitar / bannerlord.module.template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from butr/bannerlord.module.template

0.0 0.0 0.0 187 KB

Template extension for dotnet, eases the process of creating new mods for M&B 2: Bannerlord

Home Page: https://forums.taleworlds.com/index.php?threads/module-template-for-visual-studio-and-dotnet.444482/

License: MIT License

C# 100.00%

bannerlord.module.template's Introduction

Bannerlord Module Template

Installation

  1. Install the latest .NET Core SDK.
  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.
  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!
You also need to use the new template feature:

FAQ

What 'Target Framework' should I chose?

If you plan on using Harmony or WinForms, use .NET Framework 4.7.2. If not, you can chose .NET Standard 2.0.

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.
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 '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 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 <ModuleName> property used in your project file (.csproj)
  • $version$ is the <Version> 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 <ModuleName> and <GameFolder> 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.

bannerlord.module.template's People

Contributors

aragas avatar dependabot[bot] avatar imgbotapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.