Mount & Blade II: Bannerlord
0 of 0

File information

Last updated

Original upload

Created by

DarthKiller

Uploaded by

DarthKiller

Virus scan

Safe to use

About this mod

(Requires Harmony)Makes it possible to use melee weapons from the items.xml with working customizable damage. Detailed Guide inside the Readme.
Especially useful for custom non-linear weapons where you want to quickly create a weapon with stats. or Have a Ranged/Melee weapon crossover like Muskets.

Requirements
Permissions and credits
Changelogs
Donations
Introduction


I present you my simple fix for calculating damage using only a singular items.xml method. 
This way you can avoid having to create crafting templates, pieces and weighting stats around until you get a half-decent weapon to use.
The feature is originally intended as a proper stat workaround for Sword & Musket. Specifically for the Bayonet Muskets and the Melee Defense mechanisms of buttstock melee combat.
This way we are able to define specific stats without relying on the Native Calculation of Damage. 
My hopes are that this will help modders to easily integrate simple non-complicated weapons into their mod without becoming architects of assembling weapons and studying quantum physics to calculate a proper working weapon with working stats.
I also hope that this will help developers like especially Full Invasion 3 to finally integrate FUN Weapons which aren't bound by this cryptic stats assembly system.

Old Methods


Before we were able to do this, modders messed around by (1) using a very heavy weighted weapon and counterbalance it with extra agility/athletics or (2) in Multiplayer GameModes by using a damage multiplier for specific classes/weapons/gamemodes.
(3) using a modified CalculateDamage() method which is able to modify the damage by either multiplying it again and excluding certain issue areas but being very limited in the appliance of variable damage per weapon or being reliant on extra code to make it differentiate between weapons.
The Results were sort of promising, but always followed up on issues regarding specific cases that are not intended.
Known Issues of old Methods:
- Flash fast enemies when dropping heavy-weighted weapons (1)
- Kicking/Bashing dealing extreme damage while equipped with spears/muskets (2)
- Useless in SinglePlayer (1, 2)
- Damage Calculations ignoring Armor (3)
- Damage Calculations ignoring Speed (3)
- Damage Calculations ignoring Character Skill (3)
- Damage Calculations ignoring other calculations (2, 3)
- Damage Calculations not variable for each weapon (2, 3)

New Method/Math


The original method only used weight, weapon length, damage type (cut, blunt, pierce) and the skills of the player. Usually Resulting in a messy and weak damaging melee weapon.
This was overwritten by my calculation to instead, as should be intended, use the parameters swing_damage and thrust_damage from your typical items.xml item. 
Since Bannerlord's melee system is reliant on using a stat called SwingDamageFactor or ThrustDamageFactor to calculate all effects which you cannot directly set in the .xml I had to work-around this.
In my code, we simply divide the damage by 20 and use the resulting variable as our new DamageFactor.
Example:
A Sword usually has a SwingDamageFactor varying between ~2.5 to 5 and a ThrustDamageFactor of ~1 to 4.
Depending on how strong your Sword is supposed to be, you can either set the damage to be like 50/20 or you can set it to 100/80. You can also of course go higher.
The Reason we are using division by 20 and not 10, is that I think that with 20, the damage you have ingame and the approximated damage that will be displayed on your item in your Inventory will match up better.
It is still not 100% accurate to say that you get an average of 80 damage with the value 80 but it is easier for calculations to have it this way.
I also highly advise you to use high values for spears rather than the Native ones. Because those suck ass.

Limitations


It does NOT affect any crafted weapons or crafting recipes created. That includes almost all Native weapons
You are restricted by ONLY 1 Item_Usage per weapon in every ItemComponent.
This means that you can still make switchable 1/2 Handed Swords or Add a melee function for your musket with polearm stabs. You can even use different stats for those weapons aswell depending on the usage
However the combination of certain animation groups that create unique animations in certain situations is sadly not possible.
In this example we have some polearms that are held differently when mounted, than others. However those considerations are only registered when mounted.
For this you have to study the item_usage_sets.xml to find the best fitting item_usage for your weapon kind.
Specific Features of the game might require your weapon that you are using to be in a certain item_usage state like Banners. They require you to have the "requires_no_shield" tag gone.
So you might need to create a new item_usage if your's does have it but you want it to be used with a Banner. 

Credits


TaleWorlds (Base Game and Code of course)
DarthKiller (Developing the Script and Method to recalculate the Damage)
Harmony (Delivering the mechanics to be able to edit the method)
order_without_power (Being a HUGE help in the Modding Discord to help me troubleshoot my issues during development of the feature)