Jump to content

The Proper, efficient way to add a perk to ALL NPCs?


Recommended Posts

Hello.
I am making an enhanced version of Balanced Magic.

In the mod, the spell magnitude is scaled to the skill level. The higher the skill level, the higher the spell magnitude. This is done by a perk that's given to the Player NPC (00000007).

However, I'd like all NPCs to benefit from the perk. How would I do this without adding the perk to every NPC in the CK? Which would make the mod incompatible with any other plugins that edit NPCs.

Is there a sort of "master" actor object that I can add the perk to, which would make every humanoid NPC have the perk?

Or, could I make a script of some sort, that would be run from MCM, which would add the perk to every NPC? Would that work with generated NPCs?

 

Edit: The perk that I want to add to NPCs is already added to the Player character. It's not a perk just for NPCs, if that makes a difference.

Any help would be appreciated, cheers.

Edited by mdesanta777
Link to comment
Share on other sites

One relatively "easy" way to do this is convert the perk into a constant effect, and then add it to the NPC races. You can do this by making a blank constant-self applied magic effect, and set the "Perk to Apply" to the perk you want to apply. You then add the magic effect to a constant effect spell, that is set as an "Ability" instead of a spell. Finally, add this ability to all of the playable races under the Specials part, on the General Data tab, of each race.

Link to comment
Share on other sites

  On 4/24/2016 at 11:00 PM, IronDusk33 said:

One relatively "easy" way to do this is convert the perk into a constant effect, and then add it to the NPC races. You can do this by making a blank constant-self applied magic effect, and set the "Perk to Apply" to the perk you want to apply. You then add the magic effect to a constant effect spell, that is set as an "Ability" instead of a spell. Finally, add this ability to all of the playable races under the Specials part, on the General Data tab, of each race.

That is relatively easy and seems less prone to script errors, bugs and less engine-intensive than the Cloak spell method.

 

I will try and report back, thank you.

Edited by mdesanta777
Link to comment
Share on other sites

It didn't work. I check for conflicts in Tes5Edit and fixed them, so there should be no problems on that front.

In-game, I used hasperk to check on NPCs, they don't have the perk.

Then, I used addspell to make sure that the NPC has the spell. Then I checked the perk. Still no perk.

Is any of this wrong?
KwILmz.png

cTltHy.png

GcDZ1D.png

Link to comment
Share on other sites

This all looks right. Maybe you need to resurrect or spawn in new NPCs for the spell to be applied. I do know that if they do have the spell, they do have the perk. In some of my mods I've used this technique for some intricate effects, which required a condition function to check if the npc had the perk.

Link to comment
Share on other sites

Update: when I add this spell via console to myself, I have the perk. When I add this spell via console to a NPC, they don't have the perk :sad:

I tried giving the NPC the spell, killing then resurrecting them. No perk.

I also tried spawning in an stormcloak soldier NPC. No perk.


Spell is applied to all Nord NPCs. I know this because when I tried to console add the spell to Nords, it says it cannot be added. So they already have the spell.
The non-Nord NPCs don't have the spell, and I can console add it to them.
The Race-Ability link is working fine.

 

Either way, an NPC having the spell, still doesn't have the perk.

I added the spell to my player character, I received the perk.

 

 

Update2:

I also tried with an empty perk.

Still the exact same thing. Spell gives perk to me, doesn't give perk to NPCs.

Edited by mdesanta777
Link to comment
Share on other sites

There's confusion here. The suggestion to use a magic effect was to replace the perk not to apply it. You can not add perks dynamically to NPCs in game. If what you are trying to do actually requires a perk (and I think it does) then your only option is to edit the NPCs directly. To get around that problem and allow for compatibility the major perk overhaul mods use a patcher program. Since NPCs generally use different versions of the spells than the player you might also be able to directly modify their spells to approximate the effect you want.

Link to comment
Share on other sites

I made a very simple patcher with SkyProc starter, following this tutorial.

http://www.uesp.net/wiki/Tes5Mod:SkyProc/Getting_Started

However, when I run the patcher, it gives me the " Record lengths were off." error, and the perk is not applied in-game.

Here's the error in the debug file

  Reveal hidden contents


I check the last object 01541CDawnguard.esm | DLC1Beleval in Tes5Edit. It is overwritten by a mod's file, but there are no conflicts. Many previous files in the debug lists are overwritten by mods too, so I don't think there's an issue there.


Here's the code for the modified Skyproc Starter project, the only lines I added are in red.

 

 

  Reveal hidden contents



If anyone who knows how to make Skyproc patchers could tell me what's wrong, that'd be great. The tutorial is outdated, and there are some parts that I had to figure out myself.


Update: no matter how many mods I disable it just keeps getting stuck at 71%, giving the same error, just stopping at a new NPC, which makes me realize that all the NPCs have been processed correctly (the last NPCs are the ones that I have mods for), and it's the step that comes afterwards (Validating length) that's the issue.


Update2: it seems that if I block the cleaned Dawnguard.esm, the patcher works fine. I don't know why that is, and what it means.

Edited by mdesanta777
Link to comment
Share on other sites

Update3:

Solved.

Updated Skyproc version.

 

Every link on that tutorial page is outdated and causes problems.

These up-to-date modder's resources should really be more prominently linked in big, shiny letters on a sticky somewhere, instead of hiding in some obscure corner of the Internet. :sad:

Edited by mdesanta777
Link to comment
Share on other sites

  • Recently Browsing   0 members

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