Aller au contenu

Photo

Armor Penetration?


2 réponses à ce sujet

#1
tmp7704

tmp7704
  • Members
  • 11 156 messages
Is there a way to reliably retrieve the armour penetration parameter for a character? I mean the same value which shows in the tooltip for the damage output shown in window with character's state etc.

The original script for shapeshifting uses:

GetCreatureProperty( ..., PROPERTY_ATTRIBUTE_AP, PROPERTY_VALUE_TOTAL);

but this returns a value which doesn't seem to update when a character removes or switches their weapon, and the reported value is very low... like, 100x less than what's reported in the character's window.

The Toolset also has function:

DmgGetArmorPenetrationRating()

... but this requires to pass weapon as object and i can't figure out how to obtain 'the object which is currently equipped weapon' with the available functions.

Finally there's also

GetWeaponArmorPenetration()

... with associated wrapper, but this in turn requires to pass a target object as well as the attacker. Trying to pass attacker as the target as well returns the value of 0.0 and i'd rather code which doesn't require presence of anything other than the character who actually holds the weapon...

at the moment kind of stumped Posted Image

Modifié par tmp7704, 29 décembre 2009 - 07:54 .


#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
What the rules seems to be using is DmgGetArmorPenetrationRating in combat_damage_h. I'm not sure if it matches the tooltip exactly, but that is the number which is directly used in the damage calculation.

#3
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
There's a function, something like GetItemInInventorySlot. There are constants for each slot, just get the item in the main hand. The function needs to take the weapon as a paramater because if you're dual wielding, each weapon has a different ap value.