Jump to content

Ways to increase ActorValues by perk


Recommended Posts

So, I'm working on a system to apply perks that make stat changes to a custom stats system. What I need to have happen is that when Perk X is added, ActorValue Y is increased. The sticking point here is that I want it to work on all actors. It looks like the way Vanilla handles this is for the player only through a quest. So, a perk that would make a modification to an AV would set stage of quest PerksQuest, and on that stage, the papyrus fragment modifies the AV for the player.

 

In my system, I expect followers and NPCs to be able to have the perks as well. So, is there a way to have a perk directly modify the AV, a method to pass the target of the perk when it's added, or is this just asking too much from CK and papyrus?

Link to comment
Share on other sites

Create a spell and under the "Type" dropdown, select "Ability". Under casting, select "Constant Effect".

 

In the Spell Effects section, add the magic effect that will change the actor value, such as "abFortifyAgility". The magnitude will be the increase/decrease of that actor value (for example, having it as 2 will increase Agility by 2).

 

In the perk you created, create a new Perk Entry, select "Ability", and choose your spell from the dropdown.

Link to comment
Share on other sites

Since I'm wanting to change the base values. I decided to run a script attached to a fire and forget spell so it can run each time a specified perk is added, and have it check the perk and base value against what I want it to be set to at each rank. I'm pretty much done with all the perks and it tests out fine.

 

I'm using base value checks since I plan on having modifiers via chems/weapon mods/armor mods, and since it'll check each perk on each addition of a perk, I don't want it to reset values unless necessary.

 

Code looks something like this per perk:

If(akCaster.HasPerk(perkRank2) && akCaster.GetBaseValue(AVPerk) != XX)
   akCaster.SetValue(AVPerk, XX)
ElseIf(AkCaster.HasPerk(perkRank1) && akCaster.GetBaseValue(AVPerk) != YY)
  akCaster.SetValue(AVPerk, YY)
EndIf

That repeats for each and every perk I have added.

So far, it's running just fine.

 

Thanks for the reply. Glad great minds think alike.

Edited by Carreau
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...