Suggestion General Make better use of PartyTroopUpgradeModel in party screen to determine upgrades available

Users who are viewing this thread

MitchPTI

Sergeant
I've just discovered that the PartyTroopUpgradeModel exists and am extremely pleased with this, it's exactly the kind of thing I need for my mod. However, it only seems to be partially used in the party screen for determining number of upgrades available. In PartyCharacterVM.InitializeUpgrades, the DoesPartyHaveRequiredPerksForUpgrade method is used for checking perks, but required items are checked manually rather than using the DoesPartyHaveRequiredItemsForUpgrade method (which I actually do want to override). And of course if somebody overrides the CanPartyUpgradeTroopToTarget method entirely it doesn't come into play unless the troop is of a bandit culture for some reason. Ultimately it would probably make the most sense to just use CanPartyUpgradeTroopToTarget. Better yet, a new method in the model like NumTroopsThatCanUpgradeFromTroopToTarget would be perfect.

Edit: I just realised that the DoesPartyHaveRequiredItemsForUpgrade doesn't get used because it's only good for checking if the party has enough to upgrade one troop, not to see how many could upgrade based on the number of items. Once again, I think a method in the PartyTroopUpgradeModel to determine how many troops can upgrade to a target would be perfect and as part of this there could also be a method that checks how many sets of required items are available. Being able to put my own custom logic into these methods would be a true godsend.
 
Last edited:

MitchPTI

Sergeant
@Dejan My mod aims to give non-hero troops more individuality. Instead of just knowing that you have 5 Imperial Recruits for example, each one is given a name and always spawns into battle with the same body properties, equipment, etc. One feature of the mod is that troops can loot equipment from enemies they've killed. So one of your troops might kill an enemy cavalry unit and take their horse. If that happens, then that unit should be able to upgrade to a unit that requires a horse of that type even if I don't have any in my personal inventory.

If I have a stack of 10 troops that can be upgraded to a cavalry unit and I only have 2 horses of the required type in my inventory, BUT 3 of those troops already have horses that they looted in previous battles, then the number of upgrades available should be 5, not 2. Right now I can't accomplish this without harmony. However, if there were methods like NumTroopsThatCanUpgradeFromTroopToTarget and NumRequiredItemsPartyHasForUpgrade in the PartyTroopUpgradeModel, then it would be very doable.

Does that make sense?
 
Top Bottom