Recent content by Capalin

  1. How can i change AI behavior after you go down in battle?

    Hello!
    I don't really understand what you want, but maybe this can help you a bit.

    I hated when I couldn't control my troops while I was doing a siege battle so I modified the AttackEntityOrderDetachment class in
    TaleWorlds.MountAndBlade dll

    C#:
    // Token: 0x060015A1 RID: 5537 RVA: 0x00057AF4 File Offset: 0x00055CF4
            public void AddAgentAtSlotIndex(Agent agent, int slotIndex)
            {
                // This will prevent to lose control over troops, they will only do siege actions (like the ladder) when you give charge command
                if (agent.Formation.MovementOrder.MovementState != MovementOrder.MovementStateEnum.Charge)
                {
                    return;
                }
                this.AddAgent(agent, slotIndex);
                if (agent.Formation != null)
                {
                    agent.Formation.DetachUnit(agent, true);
                }
                agent.DetachmentWeight = 1f;
                agent.Detachment = this;
            }

    You can also try to find in classes like: Agent, Formation,AI behaviors, etc.
    If you want to make troops more "sharper/smarter", well that't not an easy job. You should let the developers fix that, because I know they will, thats for sure! :smile:
  2. Prisoner Recruitment Rate

    It can be done, just not in .xml as Capalin mentioned. You can find my explanation of the recruitment system workings here:https://forums.taleworlds.com/index...er-conformity-bar-bugged.401841/#post-9299751
    I said he can't change that in xml files... he will need to edit the dll files just as you explained in your post.
  3. Prisoner Recruitment Rate

    Hey!
    I suppose you can't change that in xml files.
    Of course it's possible but you will need to edit dll files.
  4. Finding Skill level XP requirements?

    Hey!
    You can find it in TaleWorlds.CampaignSystem.SandBox.GameComponents.DefaultCharacterDevelopmentModel

    C#:
    // Token: 0x06001DD4 RID: 7636 RVA: 0x00071EF4 File Offset: 0x000700F4
            public override void GetSkillLevelChange(Hero hero, SkillObject skill, float skillXp, out int skillLevelChange)
            {
                skillLevelChange = 0;
                int skillValue = hero.GetSkillValue(skill);
                for (int i = 0; i < 1024; i++)
                {
                    int num = skillValue + i;
                    if (num < 1023)
                    {
                        if (skillXp < (float)this._xpRequiredForSkillLevel[num])
                        {
                            break;
                        }
                        skillLevelChange++;
                    }
                }
            }

    Initializing array _xpRequiredForSkillLevel:
    C#:
    // Token: 0x06001DD0 RID: 7632 RVA: 0x00071DF8 File Offset: 0x0006FFF8
            private void InitializeXpRequiredForSkillLevel()
            {
                int num = 30;
                this._xpRequiredForSkillLevel[0] = num;
                for (int i = 1; i < 1024; i++)
                {
                    num += i * 2 + MathF.Round((float)num * 0.005f);
                    this._xpRequiredForSkillLevel[i] = this._xpRequiredForSkillLevel[i - 1] + num;
                }
            }
  5. Modding Horses

    I am glad I could help :smile:
    By the way, yes it's kinda weird that weight isn't a factor in this.
  6. Modding Horses

    Hello!
    Currently we can't use the modding tools, but we have dnspy for example :smile:
    (https://github.com/0xd4d/dnSpy)


    Search in these dlls: TaleWorlds.Core, TaleWorlds.MountAndBlade, TaleWorlds.CampaignSystem

    Calculating horse acceleration in TaleWorlds.Core:
    Code:
    namespace TaleWorlds.Core
    {
        // Token: 0x02000032 RID: 50
        public class DefaultRidingModel : RidingModel
        {
            // Token: 0x06000328 RID: 808 RVA: 0x0000B3F4 File Offset: 0x000095F4
            public override float CalculateAcceleration(ItemObject horseItem, BasicCharacterObject rider)
            {
                float num = (float)horseItem.HorseComponent.Maneuver * 0.008f;
                if (rider != null)
                {
                    num *= 0.7f + 0.003f * ((float)rider.GetSkillValue(DefaultSkills.Riding) - 1.5f * (float)horseItem.Difficulty);
                }
                return MathF.Clamp(num, 0.15f, 0.7f);
            }
        }
    }

    in TaleWorlds.Core dll you will find HorseComponent class.
  7. Changing Town To Custom Culture?

    Sorry if I confused you :grin:
    Setting the settlement's culture is fine.
    Try to start a new game with no custom culture, save it, create the your custom culture and load the save. You should succeed.

    The problem is when you start a new campaign you need to choose a culture.
    I tried to assign the right values, modify the CharacterCreationCultureStage.xml and the brush: CharacterCreation.xml but I couldn't succeed.
    Maybe it can be solved somehow or right now the game isn't ready for dynamically processing new cultures and such stuffs.
  8. Changing Town To Custom Culture?

    Yeah, everything is fine but it crashes, but I think I know what causes the problem.
    I guess you load a save in which you already had a custom culture and now you changed it (to "oldempire") so in the save file there is the old culture which no longer exists so it crashes.

    I tested it, I added your old empire culture to my xmls and loaded a save with 0 custom cultures and everything fine. After that I changed the culture "oldempire" to "asd" and it crashed the next time I loaded a save. :smile:

    *EDIT*
    Oh nevermind, I just saw you said you start a new campaign.
  9. Changing Town To Custom Culture?

    Could you upload these files please? (or just insert in code tag here)
  10. Changing Town To Custom Culture?

    Have you changed any other file?
  11. Changing Town To Custom Culture?

    Hey!
    Well I made a new custom culture and set it for Varcheg with no problem. I can see my custom culture in the Encyclopedia as well.
    Maybe you missed the Class reference when you changed the town's culture? You need to set it like: Culture.yourCultureName
    or maybe something went wrong with the copied block and have a syntax error in the xml file.
Back
Top Bottom