Allows the player and AI to send food supply caravans between fiefs the clan owns and siege armies. Select troops from your garrison to escort your supply caravan to it's destination or let the AI handle it for you.
Other user's assetsAll the assets in this file belong to the author, or are from free-to-use modder's resources
Upload permissionYou are not allowed to upload this file to other sites under any circumstances
Modification permissionYou must get permission from me before you are allowed to modify my files to improve it
Conversion permissionYou are not allowed to convert this file to work on other games under any circumstances
Asset use permissionYou must get permission from me before you are allowed to use any of the assets in this file
Asset use permission in mods/files that are being soldYou are not allowed to use assets from this file in any mods/files that are being sold, for money, on Steam Workshop or other platforms
Asset use permission in mods/files that earn donation pointsYou are not allowed to earn Donation Points for your mods if they use my assets
Author notes
Be fair!
File credits
King Harlaus
Donation Points system
Please log in to find out whether this mod is receiving Donation Points
Fixed crash associated with clan's or kingdoms being destroyed.
Version 1.7.4
If the origin town/castle of supply caravans falls into enemy hands while they are out, they will now look for the closest ally settlement and join their garrison. If the kingdom has no other settlements, they will instead join the settlement's new clan.
Version 1.7.3
Fixed war being declared when attacking a supply party if you were already at war.
Version 1.7.2
Fixed a typo in dialogue with your governor and updated the localization template. Not a major update but the typo was annoying enough to address. :3
Version 1.7.1
Supply parties should react to enemies trying to engage them now.
Updated settings so you can toggle fief suppy parties and army supply parties on and off. This would apply to the player and NPC clans. Remember players need to enable automatic supply lines in their fief menu to use this feature.
Version 1.6.5
Fixed governor dialogue. Some of the dialogue was intended for the send message mod and was triggering when talking in person.
Fixed menu items missing tool tips. Should clarify what is and isn't enabled in the menu.
Donating food to town will now prioritize selecting grain first before touching your other food. If you have no grain it will take from the food that you have the highest quantity of first.
Version 1.6.3
Removed the carry weight tweaks and moved them to my trainer mod. (Cheyron's Campagn Helper)
Added party dialogue so supply parties could be interacted with by the player.
Supply parties will now wait 4 hours at their destination to simulate unloading their goods in town and getting ready to return home.
Minor fixes.
Version 1.5.3
Supply parties will not deliver food to an army that is in a besieged city. Once the city is in seeing range, the food supply will realize this and turn around.
Version 1.5.0
Logic for opening the party screen changed and I updated code without having chance to test it so it is possible it migfht not work. The only part of the mod that would be affected is when you manually send a supply party somewhere and you open the party screen to select troops. If it does not work you can report in comments.
Version 1.4.13
Fixed some things to accommodate you editing Supply Amount setting mid game. (Had to create new data to save so you will see the mod "resync lists" if you have any existing supply parties running around.)
Fixed disbanding supply party leaving the caravan icon behind on the settlement nameplate.
Version 1.4.12
Added a patch to fix a crash in CaravansCampaignBehavior.SellGoods
Version 1.4.11
Fixed menu behavior when purchasing, sending or requesting support.
Added setting for army food in days that triggers a supply caravan.
Added setting to allow armies not besieging settlements to also be supplied.
Added setting to allow multiple supply caravans (1 per day) to be sent to armies.
Version 1.4.10
Fixed purchasing grain from other factions.
Version 1.4.9
Added donate food to town menu item. Tweak the max amount to donate in the MCM.
Now you can set the amount supply parties carry in the MCM. Although for now you should only use this before starting a new game. It can interfere with existing supply parties to edit this value mid game. You could but not recommended. Eventually I will fix it so you can edit the value whenever you want.
Fixed some things on the localization template and added the new text for 1.4.9
Version 1.4.8
Garrison attacks moved to a separate mod. https://www.nexusmods.com/mountandblade2bannerlord/mods/3338
Version 1.4.7
Added a patch to fix crashes with WarComponent.OnFinalize.
Version 1.4.6
Guerilla Attacks: Before the mod considered the entire garrison would be able to be used in the attack but really it should only be a small group that could pull off this tactic. New MCM setting added to tweak this. Default max attack party size is 30. This should make guerilla attacks not so OP. They should punish armies that linger in enemy territory but should take a while to outright destroy the army unless they are a small party.
Guerilla Attacks: Now being in an army will reduce the amount of casualties to your party since other parties will be targeted as well.
Guerilla Attacks: Added a setting to toggle guerilla attacks at night only. Enabled by default.
Version 1.4.5
Fixed party wages for patrols.
Version 1.4.4
Patrols are no longer considered militia parties and settlements will not have a new militia party added every time a patrol returns.
Improved patrol AI so they will attack other targets within their range but only if they aren't chasing their original target.
Party icons will no longer accumulate every time a patrol returns.
Version 1.4.3
Fixed a couple crashes when a settlement had no garrison partiy.
Updated some text in the MCM setting to reflect garrisons use patrols for smaller parties and guerilla attacks for larger parties.
Version 1.4.2
Now smaller parties like bandits will be attacked by patrol parties sent out from the garrison instead of the guerilla attacks feature. Guerilla attacks will only happen to larger parties now.
Version 1.4.1
Fixed caravans spawning invisible and not moving.
Version 1.4.0
Compiled for 1.6.1
Version 1.3.4
Fixed divide by 0 crash.
Version 1.3.3
Fixed IndexOutOfRangeException crash when parties are captured by a garrison.
Version 1.3.2
Changed how guerilla attack casualties are calculated. Now scout skill will help that party avoid casualties. Large armies won't get obliterated in enemy territory now. Smaller parties should take more damage. Mod assumes guerilla attacks are done by parties no larger than 50 men who could probably inflict 50 casualties at most.
Version 1.3.1
Fixed crash during guerilla attacks.
Version 1.3.0
1.5.9 stable + mcm 4.2.0+
Version 1.2.16
Added a setting to enable warning messages when in range of an enemy garrison.
Version 1.2.15
Automated supply lines for the player and AI will now purchase grain from the closest fief belonging to other clans as long as you are not at war with their faction.
Bug fixes and code optimizations for automated supply parties stuff. Fiefs will not provide support unless they have at least 60 men in the garrison. Before I wasn't even checking how many men were in the garrison so I think this is why you would randomly see small food supply parties.
Version 1.2.14
Added a bunch of settings to tweak when guerilla attacks occur and improved the algorithm.
Version 1.2.13
Fixed supply parties bringing purchased grain from other clans so they do not get absorbed into the destination garrison when the setting intended for your clan parties only to not go back was toggled on.
Added a few MCM settings to give more options when guerilla attacks occur. Separate probability for small parties now.
Version 1.2.12
Added ability to purchase grain deliveries from other clans via the menu.
Version 1.2.11
Fixed parties captured by garrisons not being destroyed. When your game loads my script will look for bugged parties & destroy them. These parties would have caused you to crash if you engaged them and it caused AI parties to engage them and the battle would never end. I found entire kingdoms attacking these parties. Sorry for messing up your game! Dx But now all these parties will be removed from your game and all AI parties that were stuck fighting them will resume normal activity.
Version 1.2.10
Added a setting to toggle carry capacity changes to caravans or not.
Version 1.2.9
Added settings to tweak carry capacity for spare mounts and healthy troops.
Version 1.2.8
Added messages for the types of troops wounded and killed in guerilla attacks on the player.
More bug fixes related to guerilla attacks' calculations.
Version 1.2.7
Added setting to change carry capacity of pack animals. Default setting is set to 50%, so your carry weight will be reduced once you update. You can tweak in the MCM.
Fief security now affects how effective the guerilla attack is.
Tweaks to the wounded and death calculation for guerilla attacks.
Version 1.2.6
Tweaked garrisons capture to be a little more realistic. The garrison needs to have double the amount of troops you have and your healthy troop count has to be below 25% and then garrisons can capture your party and take your prisoners/free hero prisoners. Example, Garrison has 100 soldiers. You have 49 soldiers and only 10 are healthy... they will capture your entire party.
Version 1.2.5
The tip for handling enemy garrisons will now only display once.
If a guerilla attack occurs and after you have no healthy troops, then you will be captured by the garrison.
Version 1.2.4
Fixed Argument Out Of Range crash when a supply party gets attacked by an enemy garrison. Made a typo.
Version 1.2.3
Fixed bug that reset supply parties's troop roster after they lost troops from a garrison guerilla attack.
Version 1.2.2
Now only the army leader's clan will be able to supply armies.
Any party within x distance of an enemy garrison that is not besieged will cause a random event popup regarding guerilla attacks and you will lose some troops. The better your party's scout the less you will be attacked and the less troops you will lose when attacked. Your scout can also possibly get wounded in guerilla attacks. This affects all parties, player and AI.
Fixed text in the food stocks report
Added Harmony as a required submodule and stopped including Harmony with this mod itself. You need to have the Harmony mod installed or you won't be able to enable this mod in the launcher now. Harmony can be found here on Nexus.
Version 1.2.1
Fixed error when saving game.
Version 1.2.0
Attempting to fix when supply parties lose men for no reason.
Added MCM to toggle how parties are named.
Version 1.1.1
Updated all string formats for number values in messages.
Version 1.1.0
Updated SelectTroops method for 1.5.4.
Version 1.0.21
Fixed a crash introduced last update. Siege supply parties on their way home caused a crash.
Version 1.0.20
Fixed fief supply party that headed out before a siege started and then the fief was lost. They will turn around and go home instead of finishing delivery.
Version 1.0.19
Crash fix when a town had no garrison party.
Version 1.0.18
Added localization support. See optional files.
Fixed a bug that I think was causing the crash in FindLostParties method when it was setting up a siege supply party.
Version 1.0.17
Prevent null object crash when displaying messages in FindLoastParties method. The fact this is crashing for some people means something totally unexpected happened to possibly a supply party. The script should have removed it if it became invalid but for some reason null objects are in the list and the script is trying to add these back when it syncs data. I can't explain why it is happening, but if it ever happens to me I can debug it and fix the actual cause but I have not seen this error happen and I already reviewed the code and there is nothing apparent to fix. I need more info I guess on the steps the user took that led to the situation. i would have to recreate the situation on my end to fix it.
Version 1.0.16
Added check so only your clan governors can send you food.
Version 1.0.15
Fixed town not losing food when governor sends the player party food.
Added proper condition checks for different situations and added dialog for the governor. Everything should work how I intended now.
Version 1.0.14
Message governors to send you food.
Updated generated party names.
Version 1.0.13
Fixed a bug causing Supply Lines menu to not show up if it had to sync lists on load. (loading a save that had an older version of supply lines installed)
Fixed party wages for the supply party. The wage was determined by vanilla behavior and made sending supply parties extremely expensive. It was never meant to be that way since the town should have resources to form the party and you are already paying these soldiers wages in the garrison which are much cheaper. My party wages for around 150 troops was less than 500 gold and this is just a 30 man supply party so it made no sense to cost over 5k in wages. Now it will be 10 gold per man.
Version 1.0.12
Lists will now resync if they ever go out of sync which would then cause an index out of range exception crash. Let me know if you get repeated warnings that the lists have to resync.
Version 1.0.11
Fixed bug loading lost parties caused by a previously fixed bug. Hopefully not another update needed after this until I add more features or something, and not just to fix bugs! Dx
Version 1.0.10
Fixed bug that removed valid supply parties from the AI because I assumed if they were disorganized they were not valid but they were still valid. When the script loads I add these parties back to the AI logic. I think the game might have thought they were caravans in the meantime so hopefully they arent too far off course. :3 This should fix siege supply parties now too since armies sieging a fief are considered disorganized so prior versions, siege supply parties were being immediately removed from the AI :(
Version 1.0.9
For some reason after reading the error I got it stuck in my head looping through clans was the problem but then I realized I am not modifying any clans. I was rushing too quickly. I'm actually looping through all parties to look for sieges and then creating supply parties if an army is low on food. So That's where I was modifying a collection I was iterating through. Anyways, should be fixed now.
Version 1.0.8
No longer iterating through a collection being modified (Creating mobile parties in the DailyClanTick event). Now iterating through a copy of this array in the AfterDailyTick event.
Version 1.0.7
Fixed crash when exiting supply lines menu in castles. I was accidently opening the town menu. I forgot to check the type of settlement you were in so I know which menu to open.
Fixed crash when creating a siege supply party. Accidently was referencing a null town instead of the destination party when setting the party id.
Version 1.0.6
The AI will now send supplies to siege armies low on food. Enable automatic supply lines if you want to use this feature for your clan. This has not been tested by me and if it simply doesn't work, let me know and 1.0.5 is still available until I fix it.
Version 1.0.5
Fixed a list not syncing causing a crash.
Fixed a crash when updating from 1.0.3 or prior.
Version 1.0.4
Fixed a bug causing a fief supporting multiple fiefs to ship more than the food stocks on hand.
Added a warning message if one of your fiefs required support but none of your other fiefs were able to help.
Version 1.0.3
Added a condition for AI fiefs to qualify as being able to support other fiefs. Even if a fief has a decent amount of food I first make sure it doesn't have a large deficit since their surplus would be consumed quickly.
Got rid of the check on the destination garrison for AI to make sure it had room for the escort party since now they are just going home.
Prevented AI from creating shipments between fiefs where one is under siege.
Added setting to allow the AI to take over player supply lines. No more micromanagement. Just turn it on and go fight your wars or whatever it is you do.
Version 1.0.2
Added settings option to menu where you can instruct supply escorts to return home or stay at their destination after delivery.
AI will always have escort parties return home. I have a feeling there will be fiefs that constantly need supplies and I don't want their garrison to fill up, not to mention a larger garrison consumes more supplies. Will be a never ending problem. Better for them to go home. Thanks for the suggestion SteelGoblin.
Version 1.0.1
Prevented AI from sending multiple parties to a destination. AI will wait until the first party they sent arrives before they would send one again if needed.
Supporters on Patreon will be invited to my discord where I can help you with modding or you can have a place to discuss Bannerlord and modding. Additionally, you can click the donate button on my mod pages or profile to show support by donating to my paypal!
This mod will add a 'Supply Lines' menu option to your fiefs (towns and castles). With this option you can choose to send or request food support (50 Grain) to or from your other fiefs. The AI will also use this feature as well and it should add a whole new dynamic to warfare.
In order to send food you must have troops in your garrison you can select to escort the shipment and your town must have at least 50 food in stock. Also the fief you are sending support to or requesting support from can't be under siege.
The AI will basically go through each clan once daily. It will go through all their fiefs and see which fiefs have below 50 food and also a negative food change. If a fief has these conditions then it will look for the closest fief with food surplus and form a party from it's garrison to ship the food. During testing I let it run for one day and I noticed about 3 AI shipments were created. So this is something the AI will benefit from. When the AI used it, their castles had 0 food and a change of -1 while their cities were full of food. You can also let the AI handle the player fiefs by enabling it in the Supply Lines menu.
Sieges: -Automated supply lines for the player and AI will now send out supply parties to siege armies where the siege leader is low on food (< 5 days of food left). This might help the AI from disbanding from sieges early so often.
When supply parties reach their destination they will be absorbed into that garrison or you can instruct them to return. The AI will always instruct parties to return home.
Garrison attacks have been removed from this mod and now you can get here, make sure to download the Supply Lines compatible version!