How do Perk Priorities work?

Post » Mon Jun 18, 2012 8:40 am

The wiki states:

"Priority: Used to control order of operations when two perk entries affect the same value. Perks with a higher priority take precedence."

I'm afraid I'm rather new to modding, so I would appreciate if anyone could give an example of perk priorities.

Could it be used similar to an "if, else if" sequence? Say like I wanted an attack to cause either fire damage, frost damage, or shock damage... but only one... could I assign a 33% chance of fire damage effect as first priority, a 50% frost damage effect as second priority, and a 100% chance of shock damage effect as third priority?

Am I anywhere near the concept? :-P
Thank you!
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Mon Jun 18, 2012 7:52 pm

If you had a 100% chance for it do shock then it would never do the other 2 effects? or do you mean it has 100% chance to do shock damage than another 33% chance to do fire and frost etc...

Not sure if it will help but you could take a look at the wabbajack and see how that works, but be careful that item is definitely full of madness.

Happy Modding,

Skully
User avatar
Soraya Davy
 
Posts: 3377
Joined: Sat Aug 05, 2006 10:53 pm

Post » Mon Jun 18, 2012 4:01 pm

Haha, thank you :-)

I am actually trying to find out if that's how the priorities work.

If the first priority failed, would it jump to the second, then third if that also failed?
Hmm, please forgive my non-coding ability :-P

if 33% succeeds, then fire damage takes effect (Priority 1)
else if 50% succeeds, then frost damage take effect (Priority 2)
else shock damage takes effect (Priority 3)

I wish it was as simple as letting me choose what result I wanted based on what number "GetRandomPercent" (or whatever it is) gave me.

If x is <=33, apply fire
If x is >33 and <=66, apply frost
else apply shock
User avatar
Angela Woods
 
Posts: 3336
Joined: Fri Feb 09, 2007 2:15 pm

Post » Mon Jun 18, 2012 11:00 am

Hehe Wabbajack ftw. I guess what he means is if the first spell is not applied only then the second wil be tested in if that fails there will be shock damage in any case. I think that's not how priorities work. I think it either just determines order in which effects are applied or it determines in case of several similar effects which one is applied, meaning highest priority wins, rest is never used.
User avatar
Kristian Perez
 
Posts: 3365
Joined: Thu Aug 23, 2007 3:03 am

Post » Mon Jun 18, 2012 5:30 pm

I don't think it is an if else. It is used to control complex entries that change the same value.

As an example, let's say you make a new perk that adds 5 damage to one-handed weapons. If the player has the critical charge perk, it adds 10 instead of just 5. If the player has savage strike perk, it adds 15 instead of 10. Using priority, you set the +5 as highest priority and it will ensure you add 5 if all else fails. The +10 would be lower priority and would overwrite the +5 if you have critical charge. Lowest priority would be the +15 if you have savage strike. Something like this could be done using conditionals on the entries, but would get messy if it was more complex.

This might be reversed if take precedence means only the one taking precedence occurs instead of the order in which ALL entries occur. AlchemySkillBoosts perk seems to imply that they all occur. I could be completely or partially wrong.
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am


Return to V - Skyrim