Recent content by tase

  1. Need More Info Bandit party template 3 stack limitation

    Game version: e1.2.0 (present in previous version too) Not a straight crash, but an issue that can cause crashes in the future. I.e a bandit party template with 4 stacks, its first three stacks having a min of 0, possibly leading to parties with 0 units, which causes a crash when interacting...
  2. Hardcoded bandit party limit of 3 stacks

    Thanks for the advice, I feel a bit guilty of posting it there since its related to modding.
  3. Hardcoded bandit party limit of 3 stacks

    Obviously nowhere to report this as a problem, just gonna chuck this in the pile of Q&A. Anyway, anything in the party template beyond the 3rd stack is ignored. MobileParty.cs private void FillPartyStacks(PartyTemplateObject pt, PartyTypeEnum partyType, int troopNumberLimit = -1)...
  4. Need More Info Bandit Hideout Crash [Beta Branch] [Solved]

    Also happened to me while debugging. Occured when proceeding from the prisoner screen after clearing a Sea Bandit hideout as OP mentions.

    NullReferenceException in TaleWorlds.CampaignSystem.ViewModelCollection.SPItemVM.UpdateProfitType()
    Code:
    Town town = Settlement.CurrentSettlement.IsVillage ? Settlement.CurrentSettlement.Village.Bound.Town : Settlement.CurrentSettlement.Town;
    if ((double) factorItemCategory == -99.0)
        return;
    this.ProfitType = (int) SPItemVM.GetProfitTypeFromDiff(town.MarketData.GetPriceFactor(this.ItemRosterElement.EquipmentElement.Item.ItemCategory, false), factorItemCategory);

    factorItemCategory != -99f (ItemCategory is garment)
    Settlement.CurrentSettlement is hideout_seaside_6
    Settlement.CurrentSettlement.IsVillage = False
    Settlement.CurrentSettlement.Town = null
    town = null
    => town.MarketData throws null ref.
  5. Patching/Overriding XML nodes

    I see the code with presumedObject.Deserialize but not all the things in Deserialize are "mergable".

    There are 2 issues here.

    1) is I see a lot of default values if the node or attribute isn't present in the XML. I.e the level
    Code:
    this.Level = attribute5 != null ? Convert.ToInt32(attribute5.InnerText) : 1;
    So it won't merge the level but reset it to 1 when it sees the new definition with just the equipment node
    If it was something like
    Code:
    if(attribute5 != null)
    { 
       this.Level = Convert.ToInt32(attribute5.InnerText);
    }
    else if(!this.Level.HasValue)
    {
       this.Level = 1;
    }
    it would have worked, assuming Level was int?.

    2) The loading only adds equipment so the first definition of imperial_recruit will add the equipment, but there is no way for me to remove it, at best I can override the slot with a different item, but that might not work since the behavior is probably undefined if a unit's equipment has 2 items with the same slot.

    I tried going the code route but there's no RemoveEquipment on the units
  6. Patching/Overriding XML nodes

    Let's say I want my Imperial Recruits to start out barehanded because swords are too expensive. I see the file Modules\SandBoxCore\ModuleData\spnpccharacters.xml has a NPCCharacter node with the id imperial_recruit with a subnode equipmentSet having itself 3 equipment subnodes. I want to remove...
Back
Top Bottom