Jump to content

How to keep modifications to Native's dlls?


EcneloivCM

Recommended Posts

Hello,

 

I modified TaleWorlds.CampaignSystem.dll -> Sandbox.CampaignBehaviors -> CraftingCampaignBehavior -> HourlyTick() so that it becomes

 

    private void HourlyTick()
    {
      foreach (KeyValuePair<Hero, CraftingCampaignBehavior.HeroCraftingRecord> heroCraftingRecord in this._heroCraftingRecords)
      {
        if (heroCraftingRecord.Value.CraftingStamina < 100)
          heroCraftingRecord.Value.CraftingStamina = Math.Min(100, heroCraftingRecord.Value.CraftingStamina + 5);
      }
    }

In doing so, smithing energy is restored even outside of the town where it was depleted. I tried to include it in a mod by having the basic xml file pointing to it, though I'll admit I didn't expect it to work too well (it didn't). I then just copied that into the root/bin/Windows... folder and it now works.

 

How would I go about doing this properly? Is it even possible?

 

To be frank, I don't really understand the entry point we have into the game's code. It's all classes, but they have to be called somewhere. For instance, if I inherit from CraftingCampaignBehavior, and override the HourlyTick() method, how do I ensure it's my class that's used and not the parent class?

 

Thanks in advance,

 

EDIT: Just realized the redundancy of the if and min... That's the result of removing one of the two conditions in the if() clause. Whoever wrote that sure didn't want smithing energy to go past 100 !

Edited by EcneloivCM
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...