More dynamic chance to trigger perk ability

Post » Wed Jun 20, 2012 12:12 am

The light armor perk Deft Movement gives a flat 10% chance to dodge melee attacks while wearing all light armor. I'm wondering how to make it so that factors (such as armor weight) affects this chance so that wearing lighter (less damage reducing) armors also gives you a better chance of avoiding getting hit.

Say I wanted an armor weight of <= 10 to give 20% dodge chance, with each additional 2 units of armor weight reducing the dodge chance by 1%, how would I go about doing that? I have an idea of doing it the long and tedious (maybe too long and tedious) way but maybe there's a better method.

Alternatively, is there a way of making GetRandomPercent be equal to a changing, not fixed value? If I could get this to reflect the result of a dodge formula that would do it too.
User avatar
Trevor Bostwick
 
Posts: 3393
Joined: Tue Sep 25, 2007 10:51 am

Post » Tue Jun 19, 2012 10:44 am

Hmm the only way I see to achieve this is this: In the perk entry menu you can double click on the "GetRandomPercent" condition to edit it. In the condition menu you can set the hook on "use global" below the "value" field. This let's you chose a gloabl to test against instead of a fixed value.

So you can create your own global variable "DeftMovementChance". Now you need to figure out a way to change it according to the weight of your worn armor.

Edit: I guess the most interesting challenge is to actually get an items weight. All I can find is a GetMass function which returns the mass for havok. I guess that is not the same as the weight of a piece of armor.
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm

Post » Tue Jun 19, 2012 7:09 pm

Hmm the only way I see to achieve this is this: In the perk entry menu you can double click on the "GetRandomPercent" condition to edit it. In the condition menu you can set the hook on "use global" below the "value" field. This let's you chose a gloabl to test against instead of a fixed value.

So you can create your own global variable "DeftMovementChance". Now you need to figure out a way to change it according to the weight of your worn armor.
Thanks for the reply. Yeah I had thought of that. Not familiar with Papyrus yet but in previous games I would've just changed the global by script. This time though, with NPCs able to have perks, I was hoping to give them the same ability. Using a global would limit it to the player, wouldn't it?
User avatar
megan gleeson
 
Posts: 3493
Joined: Wed Feb 07, 2007 2:01 pm

Post » Wed Jun 20, 2012 12:06 am

Using a global would limit it to the player, wouldn't it?

No the use of the global per se does not limit it to the player. But I don't know if you can get the equipped armor of NPCs in Papyrus (not even sure if that's possible for the player) let alone get their weight. As mentioned in my edit above: Only function referenced in the wiki that might be related is GetMass(), but it returns the object's mass in havok, which I'm not sure about if it's the same as weight.
User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Tue Jun 19, 2012 11:47 am

If determining the weight of equipped items isn't possible you could alternately use the WornHasKeyword function and scale the chance using the ArmorMaterial keywords.
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Tue Jun 19, 2012 4:34 pm

If determining the weight of equipped items isn't possible you could alternately use the WornHasKeyword function and scale the chance using the ArmorMaterial keywords.
Yes that was the longer and more tedious way I mentioned. :D

Also might be more limited because I wanted the effect to still apply even while wearing non-torso heavy armor but with double the dodge penalty based on weight.

And I had hoped to expand the effect to be based off the skills of the combatants so that a character with high defensive skill has a better chance to trigger dodge (or other defensive skill) vs a lower offensive skilled enemy than a lower skilled one.
User avatar
Daniel Lozano
 
Posts: 3452
Joined: Fri Aug 24, 2007 7:42 am

Post » Tue Jun 19, 2012 12:12 pm

bump from page 5
User avatar
Captian Caveman
 
Posts: 3410
Joined: Thu Sep 20, 2007 5:36 am


Return to V - Skyrim