Anyone know where I could find the code, which determines whether the upgrade troop button is active?

Users who are viewing this thread

Waybook

Sergeant
I've been looking around the game source code, but can't find it. Basically, I'm looking for the code that determines if the upgrade troop button is active in the party screen UI.

For example in the native game if you're missing the required disciplinarian perk or a horse or enough troop XP, then it's inactive. Anyone know where this code is? I'd like to add more conditions to it.
 
the only thing I know (since I don’t know c#)you can see that on xml, specifically the spnpccharacters.xml inside SandboxCore, disciplinarian perk condition is if the troop such as looter has a is_bandit=“true” tag, while the cavalry upgrade condition can be seen also as tags something like upgrade_requires="ItemCategory.horse" or “warhorse” or you can even add “iron” or “grain” as a troop upgrade requirement located somewhere near the soldier’s name

<NPCCharacter id="aserai_mameluke_regular"
default_group="Cavalry"
level="16"
civilianTemplate="NPCCharacter.aserai_troop_civilian_template_t2"
name="{=WJbOQSiT}Aserai Mameluke Regular"
upgrade_requires="ItemCategory.horse"
occupation="Soldier"
culture="Culture.aserai">

You can see usable Item categories inside module_strings inside Native folder, and search for grain

<string id="str_item_category.grain" text="{=Itv3fgJm}Grain" />
<string id="str_item_category.fish" text="{=QGaIYQpg}Fish" />
<string id="str_item_category.meat" text="{=LmwhFv5p}Meat" />
<string id="str_item_category.cheese" text="{=WSk5Sibs}Cheese" />
<string id="str_item_category.grape" text="{=Fg9qCGUu}Grape" />
<string id="str_item_category.date_fruit" text="{=ITTGMEUJ}Date Fruit" />
<string id="str_item_category.olives" text="{=45kZUyjh}Olives" />

The list will go on.
 
Last edited:
Upvote 0
Back
Top Bottom