bu90j2 Recruit Mar 9, 2022 #2 1, modding environment ✔ 1)Install Visual Studio 2019 and dotnet https://visualstudio.microsoft.com/downloads/ 2)Install templates: Powershell: dotnet new --install Bannerlord.Templates https://github.com/BUTR/Bannerlord.Module.Template 3)Set environment: Powershell: [Environment]::SetEnvironmentVariable('BANNERLORD_GAME_DIR', 'C:\games\Steam\steamapps\common\Mount & Blade II Bannerlord', 'User') https://github.com/BUTR/Bannerlord.Module.Template 4)Restart Visual Studio and use the template to generate a module(enable Nullable or the mod will crash) 5)Learn C# and Assembly and Reflection 6)Harmony:Hello World Example https://harmony.pardeike.net/articles/intro.html#hello-world-example 7)dnSpy to check code https://github.com/dnSpy/dnSpy make a mod Smelt Item Prefix:https://www.nexusmods.com/mountandblade2bannerlord/mods/2500 2, speed and move mechanism Campaign.Current.Models.PartySpeedCalculatingModel.CalculateFinalSpeed(p, p._pureSpeedExplainer); TaleWorlds.CampaignSystem.Campaign.RealTick(float) Campaign.Current.MapSceneWrapper.GetPathBetweenAIFaces(this.CurrentNavigationFace, this._targetAiFaceIndex, position2D, newTargetPosition, 0.1f, this.Path); 3, mod without algorithm 4, algorithm Shortest_path_problem 5, chasing algorithm Last edited: Mar 16, 2022
1, modding environment ✔ 1)Install Visual Studio 2019 and dotnet https://visualstudio.microsoft.com/downloads/ 2)Install templates: Powershell: dotnet new --install Bannerlord.Templates https://github.com/BUTR/Bannerlord.Module.Template 3)Set environment: Powershell: [Environment]::SetEnvironmentVariable('BANNERLORD_GAME_DIR', 'C:\games\Steam\steamapps\common\Mount & Blade II Bannerlord', 'User') https://github.com/BUTR/Bannerlord.Module.Template 4)Restart Visual Studio and use the template to generate a module(enable Nullable or the mod will crash) 5)Learn C# and Assembly and Reflection 6)Harmony:Hello World Example https://harmony.pardeike.net/articles/intro.html#hello-world-example 7)dnSpy to check code https://github.com/dnSpy/dnSpy make a mod Smelt Item Prefix:https://www.nexusmods.com/mountandblade2bannerlord/mods/2500 2, speed and move mechanism Campaign.Current.Models.PartySpeedCalculatingModel.CalculateFinalSpeed(p, p._pureSpeedExplainer); TaleWorlds.CampaignSystem.Campaign.RealTick(float) Campaign.Current.MapSceneWrapper.GetPathBetweenAIFaces(this.CurrentNavigationFace, this._targetAiFaceIndex, position2D, newTargetPosition, 0.1f, this.Path); 3, mod without algorithm 4, algorithm Shortest_path_problem 5, chasing algorithm