Page 1 of 1
armor penetration script for ranged
Posted: Mon Oct 16, 2017 11:00 pm
by JaM2013
can somebody explain to me how this script works exactly?
if (IsFoot(target) == 1) // Target is foot
{
// Note, the code below results in: BodyArmour 0 gives + 50 POA, 50 gives -25 POA, 100 gives -100 POA, BodyArmour 200 gives -150 POA, BodyArmour 300 gives -200 POA
// (Not including the -50 for death roll adjustment)
POA_adjustment = GetAttrib(target, "BodyArmour") - 100;
POA_adjustment = POA_adjustment / 2;
POA_adjustment = Max(POA_adjustment, -50);
POA_adjustment += Min(GetAttrib(target, "BodyArmour"), 100);
POA -= POA_adjustment;
Re: armor penetration script for ranged
Posted: Tue Oct 17, 2017 6:07 am
by rbodleyscott
JaM2013 wrote:can somebody explain to me how this script works exactly?
if (IsFoot(target) == 1) // Target is foot
{
// Note, the code below results in: BodyArmour 0 gives + 50 POA, 50 gives -25 POA, 100 gives -100 POA, BodyArmour 200 gives -150 POA, BodyArmour 300 gives -200 POA
// (Not including the -50 for death roll adjustment)
POA_adjustment = GetAttrib(target, "BodyArmour") - 100;
POA_adjustment = POA_adjustment / 2;
POA_adjustment = Max(POA_adjustment, -50);
POA_adjustment += Min(GetAttrib(target, "BodyArmour"), 100);
POA -= POA_adjustment;
Well it does what it says in the comments.
The only way to see how it works is to pick a value for the armour, and then go through it step by step.
So, for example, if the armour rating is 50 (Protected):
POA_adjustment = 50 - 100; (= -50)
POA_adjustment = -50 / 2; (= -25)
POA_adjustment = Max(-25, -50); (= -25)
POA_adjustment += Min(50, 100); (= 25)
POA -= 25; (= -25)
Re: armor penetration script for ranged
Posted: Tue Oct 17, 2017 6:56 am
by JaM2013
Shouldnt this one POA_adjustment += Min(50, 100); (= 25) be actually 50? Then it would make sense as 50-25=25
Re: armor penetration script for ranged
Posted: Tue Oct 17, 2017 7:14 am
by rbodleyscott
JaM2013 wrote:Shouldnt this one POA_adjustment += Min(50, 100); (= 25) be actually 50? Then it would make sense as 50-25=25
Sorry, I did not make it clear that the number in brackets is the POA_adjustment after that line has been processed.
Re: armor penetration script for ranged
Posted: Tue Oct 17, 2017 5:22 pm
by JaM2013
ok, so simplest solution to my problem with javelins would be to change the value 100 in POA_adjustment = GetAttrib(target, "BodyArmour") - 100; to larger value.. effect against unarmored would be same (POA 50), while against armor, penalty would decrease.. with value 200, POA against armor 100 would be -50 instead of -100. with 150, it would be -75..