Aller au contenu

Photo

Armor Penetration?


7 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
tmp7704

tmp7704
  • Members
  • 11 156 messages
bump. Guess it's even more tricky than i thought..?

#3
tmp7704

tmp7704
  • Members
  • 11 156 messages
well, one more for the road... Posted Image

#4
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.

#5
tmp7704

tmp7704
  • Members
  • 11 156 messages
Ahh i see. That still leaves me rather stumped though, since to quote:

"... but this [function] requires to pass weapon as object [as argument] and i can't figure out how to obtain 'the object which is currently equipped weapon' with the available functions." Posted Image

#6
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.

#7
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
http://social.biowar...ItemInEquipSlot
http://social.biowar.../INVENTORY_SLOT

Modifié par Axe_Murderer, 10 janvier 2010 - 03:58 .


#8
tmp7704

tmp7704
  • Members
  • 11 156 messages
Ahh thank you Posted Image  I've tried the GetItemInEquipSlot() before but using just the built-in help in the Toolset somehow managed to miss the proper slot ID to pass as argument. INVENTORY_SLOT_MAIN seems to be doing the trick for what i need.