• Please note that we've updated the Mount & Blade II: Bannerlord save file system which requires you to take certain steps in order for your save files to be compatible with e1.7.1 and any later updates. You can find the instructions here.

the loot system

Users who are viewing this thread

LordRaglan

Sergeant
probably been asked before, but is their a way of improving the loot, that is dropped after a fight, for example (i'm using this as an example, but am interested for my own mod) in PoP you can fight young knight companies, and they are often wearing red coat of plates (or whatever colour), yet the coat never seems to appear in the item screne after the battle.

Now i have no idea how the files work in compiling this, but i'm guessing that it is to do with the inventry assigned when making new troops (that would be make logical sense)

is this the case? and how do you 'tweak' the chances of items appearing, since (in my own modding attempts and in most mods i've played) it always seems to be the worse equipment that appears, regardless of what the troops actually spawn wearing/using
 

kt0

Knight
Stuff that's equipped on a troop never show up in the loot pile at the end of the fight.  Furthermore, unless you change it from Native's version, the more troops you have, the less chance you have of nabbing an item.  The first is somewhat ameliorated by doubling up equipment lists.  The second is fixed through hacking up the code in party_calculate_loot.  Specifically, the loot probability factors in the total number of troops in your army as calculated in calculate_main_party_shares.  Also note that heroes never drop loot. 
 

LordRaglan

Sergeant
thanks for the reply, so for the first point i should set my new troops invantry to be like, armour_1, armour_1, shield_1,shield_1 etc etc in order for it to be likely that armour_1 will appear in the loot screne at the end of a battle?

as to the second point, which module files exactly do i need to look at in order to find the 'calculate_main_party_shares' and 'party_calculate_loot'?
 

kt0

Knight
I haven't actually run the numbers to be certain, but I think it's better to do stuff like this:
  armor1
  weapon1
  ranged1
  horse1
  armor1
  weapon1
  ranged1
  horse1

I've seen some weirdnesses where I load up a set of guys with double loots like this:
  melee1
  melee1
  lance1
  lance1

and they end up with two weapon1s and zero lances or vice versa.  I don't know the actual probabilities for things where tf_guarantee flags aren't involved.  Hopefully someone will chime in with more info.  These are probabilities, though, so doubling them up doesn't ensure that those items show up in the potential loot pool. 

Both scripts live in module_scripts.py.  If you want a listing of all the scripts in that file, you can look in ID_scripts.py (ifn' you were curious). 

If you're ever looking for something, I highly recommend doing a "find in files" text search for the term in question.  Edit++ and Textpad will do this.  Many other editors have similar features as well.  If you're not using an editor that has a "find in files feature", then get one!  :mrgreen:  Thus equipped, you can easily answer such questions as "where is this called?", "what things have I marked as #HACK?", and my perennial favorite, "where is convert_to_fixed_point called?  I can't for the life of me remember how to use it."  A fun reference is also header_operations.py which lists all the built-in functions you can call (in case you were wondering). 
 
Top Bottom