Recent content by Butterfan

  1. Bandit/looter party speed

    You'll need to create a custom party speed calculating model that derives from the DefaultPartySpeedCalculatingModel. Something like that should work.

    C#:
    using TaleWorlds.Localization;
    using TaleWorlds.CampaignSystem;
    using TaleWorlds.CampaignSystem.SandBox.GameComponents.Map;
    
    public class CustomPartySpeedCalculatingModel : DefaultPartySpeedCalculatingModel
        {
            public override ExplainedNumber CalculateFinalSpeed(MobileParty mobileParty, ExplainedNumber finalSpeed)
            {
                if (mobileParty.IsBandit)
                {
                    finalSpeed.Add(3f, new TextObject("{=*}Increased Bandit Speed"));
                }
    
    
                return finalSpeed;
            }
        }

    Then add this model to the CampaignGameStarter object on your MBSubModuleBase.

    C#:
    protected override void OnGameStart(Game game, IGameStarter gameStarter)
            {
                if (game.GameType is Campaign campaign)
                {
                    CampaignGameStarter campaignStarter = (CampaignGameStarter)gameStarter;
                    campaignStarter.AddModel(new CustomPartySpeedCalculatingModel());
                }
            }
    Thanks for your reply, i'll try it out soon!
  2. Bandit/looter party speed

    Hello all, i'm looking for some help. I modded my bandits and other evildoers to have larger parties with the added consequence that because of their size they move extremely slow. I'm trying to speed them up but I cannot figure out how to program it in using C# and a limited amount of time. I...
Back
Top Bottom