Mod idea: shortest path for moving to a object, motionless or moving

Users who are viewing this thread

bu90j2

Recruit
Fermat's principle
206px-Fermat_Snellius.svg.png

Huygens–Fresnel principle
500px-Refraction_-_Huygens-Fresnel_principle.svg.png

Dijkstra's algorithm
Dijkstras_progress_animation.gif
 
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:
Back
Top Bottom