Search results for query: *

  1. Mod idea:Craft History save only if name is modified, and do not replicate

    remove duplicate by name
    [HarmonyPatch(typeof(CraftingCampaignBehavior), "AddItemToHistory")]
    public class Patch_CraftingCampaignBehavior_AddItemToHistory
    {
    private static void Prefix(CraftingCampaignBehavior __instance, WeaponDesign design)
    {
    if (__instance != null)
    {
    FieldInfo field_craftingHistory = typeof(CraftingCampaignBehavior).GetField("_craftingHistory", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
    List<WeaponDesign> _craftingHistory = (List<WeaponDesign>)field_craftingHistory.GetValue(__instance);
    _craftingHistory.Reverse();
    List<WeaponDesign> TempList = new List<WeaponDesign>();
    List<WeaponDesign> toRemove = new List<WeaponDesign>();
    foreach (WeaponDesign weaponDesign in _craftingHistory)
    {
    bool duplicatefound = false;
    foreach (WeaponDesign weaponDesign2 in TempList)
    {
    if (weaponDesign.WeaponName.ToString() == weaponDesign2.WeaponName.ToString()||weaponDesign.WeaponName.ToString() == design.WeaponName.ToString())
    {
    duplicatefound = true;
    }
    }
    if (!duplicatefound)
    {
    TempList.Add(weaponDesign);
    }else
    {
    toRemove.Add(weaponDesign);
    }
    }
    _craftingHistory.RemoveAll(x => toRemove.Contains(x));
    }
    }
    }
  2. Problem with merging of weapon_descriptions.xml

    You can also load your module after Native, SandBox Core etc but you'll have to use xslt to modify weapon_descriptions.xml.
    I rewrited this mod with C# that fixed all problem
  3. Mod idea:Craft History save only if name is modified, and do not replicate

    this.CraftingHistory.Remove(r => r.Name == weaponDesign.WeaponName);
  4. BUG: no xml file override mechanism for modding

    https://www.nexusmods.com/mountandblade2bannerlord/mods/2500 I want to change Weapon name, but there is no file override mechanism for modding if language is English,place the mod after sandbox core(overwrite weapons.xml and will multiple the weapon type) there is english language file...
  5. Problem with merging of weapon_descriptions.xml

    try place it before native , since weapon_descriptions.xml is in native folder

    I fix a same problem in my mod which change something in sandbox core
    2500-1647064241-1835607664.png
  6. Mod idea: shortest path for moving to a object, motionless or moving

    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
  7. Mod idea: shortest path for moving to a object, motionless or moving

    Fermat's principle Huygens–Fresnel principle Dijkstra's algorithm
Back
Top Bottom