Mount & Blade: Warband

Mount & Blade: Warband

Grande Armee - L'aigle Standalone Mod
LifeHussar  [developer] 16 Dec, 2022 @ 8:21pm
Version A 2.0 Changes
Version A 2.0
* script_game_event_simulate_battle - This script checks “slot_party_type” to see if a sim battle involves a castle or town, then modifies defender and attacker strength with a ratio. Changed modifiers to 200/100 (2x) for defenders, 100/200 (0.5x) for attackers. This should help defenders inflict more casualties in sim battles, but still allow large armies to take centers.
* script_give_center_to_lord - This script spawns troops in a center when that center is given to a lord. Changed “garrison_strength” values to 3 for both towns and castles. This should leave newly taken centers vulnerable, but not totally undefended.
* script_game_start - This script does so much…

Script determines center troops and xp by performing rounds of recruitment and xp gains via a “garrison_strength” value. Changed “garrison_strength” to 30 and 15 for castles and towns respectively. This should make centers harder to take in the first few days.

Script spawns looter parties at game start next to villages. Changed from 16% to 50% chance to spawn (random range is 0-1 instead of 0-5).

* simple_triggers - Line 29 - “Give XP” - This script gives xp to NPC lords and centers every time it runs. In the previous update, changed the trigger period to 1 in-game hour and reduced xp given (slower, progressive xp gains). Changed to 30% chance to gain 400 xp hourly (about 3000 xp / day). This keeps newly taken centers from getting huge recruit garrisons, then upgrading to huge elite garrisons.
* mno_begin_adventuring - This script sets stats, items, etc for your character on game start. Changed a “troop_raise_proficiency” line of the “gun for hire” background choice from +1000 Pistol skill to +100 Pistol skill.
* str_tutorial_map1 - Changed “L’Aigle” to “Grande Armée”.
* Added wine, ale, and dates to consumable foods with morale bonuses. Reordered their positions in item_kinds1 to allow consumable food to be in a continuous range.
* Adjusted several food stats, doubling all units per stack for starters. The goal here is to make food less of chore and make the options a little more diverse. Full list: Grain (200/stack), Olives (40/stack), Grapes (40/stack), Dates (40/stack), Dried Meat (20k base price, 200/stack), Butter (5kg, 120/stack), Honey (10kg, 35k base price, 180/stack), Cheese (5kg, 80/stack), Ale (40kg, 200/stack), Wine (160/stack), Cabbage (80/stack)
* simple_triggers - Line 60 - “Consuming Food” - This script determines how much food to consume based on party size and calls consume_food to reduce the amount of food in an item stack. Adjusted the “food_begin” value here to include wine, ale, and dates.
* Adjusted the “food_begin” value in scripts: game_get_item_extra_text, party_calculate loot, get_player_party_morale_values, consume_food. Values in internal_politics_rate_feast_to_s9 remain unchanged because I’m afraid of breaking feast math. Swapped the values for Furs and Dates (because they were reordered in item_kinds1) in a few places, like initialize_item_info, center_get_production, mno_begin_adventuring
* Initialize_item_info - Changed Olives morale bonus to +2 instead of +1. Someone at TaleWorlds must really not like olives.
* get_player_party_morale_values - This script calculates and assigns morale based on stuff like Leadership and food. Adjusted the food bonus modifier from 3/2 to 4/2 (i.e. listed food morale bonuses add twice as much to party morale).


NOTES - some scripts that look for “trade_goods_end” might get messed up by the changes to food, feast scripts might still get messed up anyways


* simple_triggers - Line 77 - “Spawn Bandits” - This script just calls “spawn_bandits” periodically. Changed the period to 1 hour.
* spawn_bandits - This script, shockingly, spawns bandits. It also checks for a maximum number of bandit parties. Changed the looter (highwaymen) party max to 100. Changed the guerillas party max to 100 and the spawn radius to 25.
* parties - This file sets a lot of values for parties on the campaign map. Changed p_guerilla_spawn_point to -250 X, -225 Y to put it in the middle of Spain. This allows them to spawn in pathable locations and hang out in Spain.
* get_party_companion_limit - This script determines your max party size. Changed the skill multiplier to 20 (i.e. every level in Leadership increases party size by 20). Also edited the string in skills to display this number.
* game_get_troop_wage - This script calculates individual wages for troops. Removed the lines that check for “pretenders” (i.e. Native Warband claimants to faction thrones) because it wasn’t assigning wages to any troops in that range, which just so happened to be the six Holland cavalry troops. Also changed the “companion” wage multiplier from 2 to 1 because the range was affecting Prussian troop wages.
* In the conversation file, there’s a line to check if a lord can offer a mercenary contract: dlga_lord_request_mission_ask:lord_propose_mercenary. It looks like the very first line checked if the $players_kingdom value is equal to 69. Classic. Changed this value back to 0 (as it is in Native to make sure the player isn’t allied to any other nation). Also changed the modifiers of dlga_lord_propose_mercenary:lord_mercenary_service to add 10 to party strength, then multiply by 100 for the up-front cash.
* prsnt_budget_report - This script displays the budget report (duh), but the boolean value of $g_apply_budget_report_to_gold is how the weekly budget affects your cash. Changed a modifier from this script that uses party strength to calculate your pay, instead of dividing by 2, it's multiplied by 200.
* Lots of complicated learning around how to edit scenes, entry points, and how mission templates determine stuff
* Mission templates start with spawn records, which determines what spawns where on mission start. This calls out the entry point, troop modifiers, and more.
* Mission templates have common triggers, which show up in the first few lines. You can ID the triggers by their timing numbers at their start (e.g. 3, 0, 5).’
* add_reinforcements_to_entry has two arguments: the relative line number of the spawn record (0 = 1st line, 1 = 2nd line, etc), then the number of troops spawned?
* Editing scenes is best done by overwriting an accessible SCO file (e.g. the first custom battle map) and making changes through edit mode. Once the changes are made, use your edited file to overwrite the target scene.
* Ended up making lots of changes to the town wall scene and copying over all 51 town wall scenes. Most notable changes are the addition of new entry points to spread out the engagement, changes to the spawn records using those new entry points, and a “last stand” fortification to favor defenders more.
* mission_templates - Added additional spawn records to mst_castle_attack_walls_ladder (entry 47 to 49 & 60 to 62 for defense, 50 to 56 offense). Also adjusted the spawned number of troops in these records. Also changed common_siege_defender_reinforcement_check to only add one unit at a time instead of 7. Also added 3 more of this spawn: entry 47, 48, 49. Also changed common_siege_attacker_reinforcement_check to the same thing, reinforcing at entry 0, but also 50 to 56.
* game_get_join_cost - This script determines hiring cost for tavern troops like heroes and mercs. Added a line at the end that assigns 100 as the join cost for every tavern recruit.
* decide_run_away_or_not - This script is called every few seconds in mission_templates. Added several lines to first make retreating troops run back to their spawn point, then retreat to the nearest map edge once within 25m of their spawn.
* simple_triggers - Line 47 - “Accumulate Taxes” - This script is called every 7 days to calculate and set slot_center_accumulated_rents (based on center type and prosperity). Increased base rents by 100x (120k for villages and castles, 240k for towns).
* Lots of changes to troops
* Artillerists had unit flags to guarantee ranged weapons (also a few to make them undead for some reason). Changed so all artillerists are the same and only have their armor guaranteed. This changes their class to “Infantry” so they’re not automatically mixed up in your divisions. Also corrected their level so any artillerist prisoners wouldn’t be worth too much.
* Updated mercenary stats and troop tree to be only Brunswick units, including new grenadiers, a rifle sharpshooter, and strong light cavalry.
* Changed Napoleon Bonaparte to have the same troop flags as other heroes (i.e. only tf_hero). He was originally flagged as both female and undead, so hopefully nothing breaks here…
* Restructured the Polish troop tree to allow light recruits to upgrade to line troops (via Polski_Fizylier and Polski_Ulan). This also helps with party templates for Polish lords and centers. Added Polski_Husar, though it currently uses british dolman and french gaiters. Some Polish troops were also renamed.
* Cosmetic changes to Russkiy_Opolchenets to use Russian_Infantry_Greatcoat and Fur_Hat (from WB Native items), stats should be the same.
* Lots of changes to item_kinds1. This was just a lot of minor corrections, mostly to make sure there were no outliers in terms of armor and to make early game looting more viable. I made a lot of changes, so I probably made a lot of mistakes. Let me know if you find any!
* Fixed spelling of “Trowsers” to “Trousers” in like 20+ instances, very curious how that happened…
* Head items of item_kinds1
* Helmets and casques get 40 head armor, base price 4000c
* Shakos, hats, and czapkas get 20 head armor, base price 1000c
* Bearskins and bi / tricornes get 25 head armor, base price 1500c
* Body items of item_kinds1
* Recruit and civilian clothes get 20 body armor, base price 500c. There’s a lot of these, and in some cases I just added zeros to the price because it was faster.
* Fusilier and light tunics get 23 body armor, base price 1500c
* Grenadier coats get 25 body armor, base price 1500c
* Dolmans and other cavalry uniforms get 25 body armor, base price 2000c
* Sergeant uniforms get 25 body armor, base price 2000c
* Officer uniforms get 25 body armor, base price 5000c
* General’s uniforms get 30 body armor, base price 15000c
* Half-cuirasses get 40 body armor, base price 10000c
* Full-cuirasses get 45 body armor, base price 20000c
* Leg items of item_kinds1
* Breeches, trousers, boots get 16 leg armor, base price 500c
* Hand items of item_kinds1
* Gloves get 1 body armor, base price 500c
* Melee weapons of item_kinds1
* Briquets and infantry sabres do 25 cut damage, base price 2000c
* Cavalry sabres (variable damage) have a base price of 3000c
* Lances do 40 pierce damage, base price 1000c
* Officer’s swords (variable damage) have a base price of 10000c
* Knives, clubs, and bandit weapons have a base price of 200c
* Ranged weapons of item_kinds1
* Hunting Rifle / Musket has a base price of 1000c
* Muskets and carbines have a base price of 3000c
* Military Rifles have a base price of 4000c
* Pistols have a base price of 2000c
* Cartridges have a base price of 1000c
* Mounts of item_kinds1
* Worn-Out Hack base price 1000c
* Cavalry Horse (generic) base price 5000c
* Basic Light Horse (e.g. French Light Cavalry Horse, British Light Dragoon’s Horse, etc) base price 15000c
* Basic Line Horse (e.g. French Cuirassier’s Horse, German Warhorse, etc) base price 15000c
* Special Horse (e.g. French Cuirassier’s Warhorse, Polish Guard Chevauleger's Warhorse) base price 25000c
* Elite Horse (e.g. French Cuirassier's Prized Warhorse, Polish Guard Chevauleger's Prized Warhorse) base price 50000c
________________


Appendix
* Added lines for decide_run_away_or_not:


Before courage check, if running close to spawn, reroute:
1 (agent_get_slot, ":agent_entry_point", ":cur_agent", slot_agent_target_entry_point)
2 (entry_point_get_position, pos1, ":agent_entry_point"),
3 (agent_get_position, pos2, ":cur_agent"),
4 (get_distance_between_positions, ":distance", pos1, pos2),
5 (try_begin)
8 (agent_slot_eq, ":cur_agent", slot_agent_is_in_scripted_mode, 0),
6 (eq, ":is_cur_agent_running_away", 1),
7 (lt, ":distance", 2500),
8 (agent_stop_running_away, ":cur_agent"),
9 (agent_set_slot, ":cur_agent", slot_agent_is_running_away, 0),
10 (try_end)


After courage check, if far from spawn, run to spawn, otherwise just retreat:
1 (try_begin)
2 (ge, ":distance", 2500),
3 (agent_start_running_away, ":cur_agent", pos1),
4 (agent_set_slot, ":cur_agent", slot_agent_is_running_away, 1),
5 (else_try)
6 (agent_start_running_away, ":cur_agent"),
7 (agent_set_slot, ":cur_agent", slot_agent_is_running_away, 1),
8 (agent_set_slot, ":cur_agent", slot_agent_is_in_scripted_mode, 1),
9 (try_end)


NOTES - These lines are dependent on entry points, which may vary between scenes. There may be issues, but still a good framework before overhauling scenes.