Modify troop items in mercenary camps

Users who are viewing this thread

Hello there of the Taleworlds forum!
I'm going to ask you a modding suggestion about mercenaries in With Fire & Sword.

I'm testing some weapons and so I would like to know if there is a way to modify the equipment given to mercenaries. I'm not talking about the ones you can already choose for them, asking to the mercenary captain, but I would like to know where is the code about it in order to get the possibility of putting in it some more items. As an example I would like to dress Russian musketeers with the Tsar Guard uniform, or to equip Tatar Mercenaries with matchlock carabine, and so on.

Unfortunately I have not found anything about it on the web and, also after hours of studying, I was unable do find the code by myself inside text files.

Thanks in advance for any reply.
 
You need to edit and compile the WFaS module system to change the equipment options offered at mercenary camps. The options for each item type (i.e. helmets, horses, boots etc), by faction, are set up in module_scripts.py in a script called set_merch_item_parametres and stored in slots on trp_merch_arms_array with their prices held in trp_merch_arms_price_array.

For example, the Polish body armours:

Code:
# polyak tulub alternatives
		(troop_set_slot, "trp_merch_arms_array", 105, "itm_poland_dragoon_uniform"),
		(troop_set_slot, "trp_merch_arms_price_array", 105, 20),
		(troop_set_slot, "trp_merch_arms_array", 106,"itm_koja_kurtka_s_podbivom"),
		(troop_set_slot, "trp_merch_arms_price_array", 106, 124),
		(troop_set_slot, "trp_merch_arms_array", 107, "itm_kolchuga_panzernika"),
		(troop_set_slot, "trp_merch_arms_price_array", 107, 252),
		(troop_set_slot, "trp_merch_arms_array", 108, "itm_poland_uniforma_german_line"),
		(troop_set_slot, "trp_merch_arms_price_array", 108, 540),
		(troop_set_slot, "trp_merch_arms_array", 109, "itm_poland_gusar_panzer_bez_kril"),
		(troop_set_slot, "trp_merch_arms_price_array", 109, 550),

To substitute items, change say itm_poland_dragoon_uniform for an acceptable alternative body armour from module_items.py (which must have the itm_ prefix so the engine knows it comes from module_items.py).
Adding additional items would require a re-write of the whole array code - not recommended unless you know what you're doing.

PS the price is the last number in the following line (i.e. 20 for poland_dragoon_uniform - 105 is the slot number where that data is stored & accessed from in-game).
 
Thankyou very much for the quick reply! I will install the module system and the Python 3.6.4 immediately!

May I ask you also if there is any way to add an item modifier? As an example, a way to equip the same rifle but with different modifiers: better for an higher cost and for higher performances, and worst for less money and less performances.

Ex.

Cracked          Miquelet Musket
                        Miquelet Musket
                        Good Miquelet Musket
Masterwork      Good Miquelet Musket
 
Python 3.6.4 is far too advanced for Warband/WFas - you need 2.something - I'm using 2.6.1

Read this Warband set up guide (remember WFaS is just an old version of Warband's engine) https://forums.taleworlds.com/index.php/topic,240255.0.html

Also, if you intend to change any names, the big difference between WFaS & Warband is names are taken from the language CSV files, not the source code - I deleted the CSV files so that these wouldn't interfere, but that required me to track down and translate bits of Russian sprinkled throughout dialogues etc in the module system - you might only need to delete the CSV files for items (or edit the names in item_kinds.csv as well as editing module_items.py, which is tedious).

There is only one version of a particular musket in module_items.py. Modifiers are randomly added to loot or shop merchandise to vary the base price and performance set for that base item.

PS the language CSV files aren't part of the module system. You'll find them in the languages folder of your mod. For example:
C:\Program Files (x86)\Steam\SteamApps\common\mount & blade with fire and sword\Modules\Your_Mod_Name\languages\en
 
Really many thanks for your aid! I discovered that Python 3.6.4 is too advanced and I followed your hint to use the 2.6.1 version.

Thankyou also for your guide link, as it will help me in other similar things.

What you told me is exactly what I was looking for! Now I can start the work!
 
Back
Top Bottom