Multiple base_troops possible!

Users who are viewing this thread

In Warband I always wondered why it is not possible to have multiple different types of recruits. The most obvious would be male and female but also types like noble, peasant, local subculture vs. empire culture and so on. And seemingly in Bannderlord we have the same weird restriction. Yes, we have the "elite_basic_troop" but still that feels so restrictive.

Do you think it is possible with the new framework/engine to to configure more than one basic_troop and return one randomly? Unfortunately my C# experience is very limited. I set up VS and got my own DLL working but I couldn't find that one method that returns the basic_troop. I know it's a member of TaleWorlds.CampaignSystem.CharacterObject and therefore it probably only has the simple get method? Can this be overriden and then return something more than just what's stored there? Or is this not a good idea/approach?
 
Okay, progess (if anyone cares)!

I managed to write a postfix method to modify the returned basic_troop for any call. I hope it's only called for recruitments or I'm screwed, but so far it looks good! So right now I have a test szenario set up to return my modded female tree 50% of the time and the basic male tree the rest of the times and only for the empire. Couldn't be happier. Now I have to figure out why the randomizer isn't really random at all and how to make a nice xml for the users to configure their troop replacement trees with their respective percentages.

Thanks for reading.
 
Upvote 0
Well I've learned quite a bit today (not only about C# luckily).

I can now...
... have multiple recruits (with complete upgrade trees) replace the standard base_troop recruits
... have certain recruit replacements be recruitable for the player only (i.e. if you want to make sure only you can recruit your own amazing troops). If the AI tries to recruit them they will be reverted back to the original recruits.
... have a config file for the player to define which base_troops should be replaced by which new recruits at which percentage and whether the AI can recruit them too.

Yay!

To answer your question @vota dc : I have not found a method where the notables get their volunteers but I have not searched for it. What I have found is a method that gets called when a lord tries to recruit a volunteer and there the notable is definitely part of it. So the AI - just like the player - recruits volunteers from specific notables which have a set of up to 6 volunteers. That set has to get populated somewhere so I assume yes, it should be possible.

@KuroNeko87: Not sure how you would define regional but you can of course use the cultures as regions so the Empire has different mercenaries than the Vlandians etc.
 
Upvote 0
It would be great if only mercenaries and criminals would be eager to work for their conquerors. Mercenaries would be neutral while a sturgian brigand would have a reversed morale: low with sturgian commanders and high with invaders.
 
Upvote 0
hi Adonnay , really interested by you work on setting multiple recruits , can you explain me what you have found and how does it work ?
thx for reading
 
Upvote 0
Well the problem I was facing was that the recruits are not spawned/generated when you enter the village specifically for you. They are spawned in (I assume) random intervals and attached to each notable (the village people). This way all lords have access to the same recruits as soon as they are spawned.

The way they are spawned is yet unclear to me but I know that at some point the game calls the method "get base_troop" from the CultureObject class to determine which kind of recruit to spawn. This is where I put my code to replace the base_troop with a base troop of my own tree. I'm not 100% sure yet that there are no side-effects but it seems to work fine.

Future plans are - when I sorted my baby issue out - to find a better hook because I don't know whether get base_troop is also called elsewhere with a different purpose. Ideally I want to find the method that specifically handles the recruitment calls only.
 
Upvote 0
thx ,
just a noob question with which kind of programm did you open and edit dll files ???
and can you give me the path to find the document you are editing
thank you
 
Upvote 0
Back
Top Bottom