Change Ransom Amounts

Users who are viewing this thread

mawcs

Recruit
Hi all.  I'm trying to figure out how to change the amount that is offered by other kingdoms for ransom of lords.  Does anybody know how to do this?
 
Search module_scripts for "offer_ransom_amount_to_player_for_prisoners_in_party". You may also want to look for "enemy_offer_ransom_for_prisoner" in module_game_menus. That is the menu you are sent to from the script I just mentioned.
 
My apologies, I should have mentioned.  I'm new to modding M&B.  I have some python experience, but these txt files with numbers are foreign to me.  How do I know what these numbers mean and what is to be changed?
 
Incidentally, the "offer_ransom_amount_to_player_for_prisoners_in_party" seems to apply to prisoners in my party.  What about prisoners in a jail of a castle or town?  I am specifically looking to make the ransom amounts for lords different.
 
Well, I can't help you with editing the text files. I only work with the module system. But I believe that script also applies to prisoners in centers. Here is the trigger in module_simple_triggers the calls that script. As you can see, it first checks the player's party and then checks walled centers:
Code:
  # Offering ransom fees for player's prisoner heroes
  (24,
   [(neq, "$g_ransom_offer_rejected", 1),
    (call_script, "script_offer_ransom_amount_to_player_for_prisoners_in_party", "p_main_party"),
    (eq, reg0, 0),#no prisoners offered
    (assign, ":end_cond", walled_centers_end),
    (try_for_range, ":center_no", walled_centers_begin, ":end_cond"),
      (party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
      (call_script, "script_offer_ransom_amount_to_player_for_prisoners_in_party", ":center_no"),
      (eq, reg0, 1),#a prisoner is offered
      (assign, ":end_cond", 0),#break
    (try_end),
    ]),

What this would all look like in the text files, I don't know.
 
I skimmed the first couple "chapters" on the module system.  One of the key phrases was, "It is important to note that Mount&Blade does not use Python and does not read the Module System python scripts directly. Rather, the python scripts are executed to create the text files that Mount&Blade reads."

I was under the assumption that the text files were like configuration files for the python scripts.  This makes it much easier for me knowing that I don't have to muck with those cryptic files. 

Thanks for your help.
 
NP. Modifying the text files is really only good for minor modifications and tweaks. To really mod the game, it's best to use the module system.
 
I got it figured out.

For anybody wanting to know how to change the amount that is offered for lord prisoners, look in module_scripts.py from the ModuleSystem.  Look for "calculate_ransom_amount_for_troop." 

There are two basic ways to change the amounts.  First, you can change the base amount.  For Lords, the base amount is 4000.  If you change this to 2000, you will get substantially smaller offers like 748 denars. 

For example:
Change:
Code:
(try_begin),
       (faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
       (val_add, ":ransom_amount", 4000),
(try_end),

To:
Code:
(try_begin),
       (faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
       (val_add, ":ransom_amount", 2000),
(try_end),

The second way is to change the modifiers for the base amount.  The amount is first divided and then multiplied.  If you lower the divisor or raise the multiplier (or both  :shock: ) you can dramatically change the amount that is offered.  Changing the divisor to 10 and the multiplier to 750, you will get offers in the hundreds of thousands or even over a million.

For example:
Change:
Code:
(val_div, ":random_ransom_amount", 100),
(val_mul, ":random_ransom_amount", 100),

To:
Code:
(val_div, ":random_ransom_amount", 10),
(val_mul, ":random_ransom_amount", 750),


I hope this is helpful to anyone else attempting to change the ransom amounts for Lords.
 
Back
Top Bottom