Sadly this fix is still needed for single-fire dual wielding with game version 1.4.1 but 1.4 broke it. To make this code work again, add following in bold letters to the Code/Dual wield Bugfix.lua file:
function OnMsg.DataLoaded() CombatActions.DualShot.GetAPCost = function (self, unit, args) ... return Max(unit:GetAttackAPCost(self, weapon1, false, aim), unit:GetAttackAPCost(self, weapon2, false, aim)) + self.ActionPointDelta end end
it looks like your fix also helps to make other mods compatible for Ja3 1.5. Since you have deep knowledge of lua I want to ask a question: When I mod a loot def, there is this line Loot = "all" This means all get picked, I could not find a dokumentation, if there something like "single" or "pick only one" maybe you know advice...
Alright so let me explain how AP system works for guns. Every weapon has a base AP in the code this is equal to the cost to burst fire a gun. Single shot reduces the weapon AP cost by 1. Dual shot adds 2 AP to the cost. The problem is the dual shot +2 is overwriting the -1 instead of factoring in the fact that it is a single fire weapon. So the game is calculating dual shot correctly on burst weapons but overcharging on single fire. Instead of X-1+2 it's doing X+2.
7 comments
To make this code work again, add following in bold letters to the Code/Dual wield Bugfix.lua file:
function OnMsg.DataLoaded()
CombatActions.DualShot.GetAPCost = function (self, unit, args)
...
return Max(unit:GetAttackAPCost(self, weapon1, false, aim), unit:GetAttackAPCost(self, weapon2, false, aim)) + self.ActionPointDelta
end
end
it looks like your fix also helps to make other mods compatible for Ja3 1.5.
Since you have deep knowledge of lua I want to ask a question:
When I mod a loot def, there is this line
Loot = "all"
This means all get picked, I could not find a dokumentation, if there something like "single" or "pick only one" maybe you know advice...
Thx in advance...
Thanks for the fix!
Very good explanation. Please post this in Description.
Nice nice!