Entry point modifications on NPCs.

Post » Wed Jun 20, 2012 8:33 pm

When making effects for a perk, you can use "entry point" to change some useful things.

In particular, what I want is "Mod incoming damage" and "Mod attack damage". Is it possible to do anything like that for NPCs with scripting and how? If not, is there any way to get a perk applied to an NPC so I can set the same effect? Or a way to do it with magic effects?

To be specific, I want to make NPC and player damage, armor rating, etc. be affected more by their skill levels (a *5.0 increase by level 100, with linear scaling at every skill level and independant of perks), and I want to change the actual "formula" for NPC to player and player to NPC damage calculations. It works fine for the player as a permanent perk, but apparently it can't be applied to NPCs?

The only thing I could think of was "OnHit" actor event, but it doesn't have the actual damage as a perameter, so it's apparently useless for changing the damage. Maybe someone here knows of a clever way to get the damage quickly so I can "remove" it and re-apply the modified version. Sadly, every way I can think of doing that is very complicated and would probably be too slow to work correctly.
User avatar
George PUluse
 
Posts: 3486
Joined: Fri Sep 28, 2007 11:20 pm

Post » Wed Jun 20, 2012 8:32 pm

Adding perks to NPCs through script doesn't work, and such effects you mentioned cannot be obtained through magic effects either. However, I think there's a simpler solution for what you're trying to do. The formula for weapon damage is as follows:

displayed damage = (base damage + smithing increase) * (fDamagePCSkillMin + (fDamagePCSkillMax - fDamagePCSkillMin) * skill/100) * (1 + perk effects) * (1 + item effects)

Where fDamagePCSkillMin and fDamagePCSkillMax respectively are replaced with fDamageSkillMin and fDamageSkillMax when calculating the damage dealt by an NPC instead of a player.

All of these ''f'' values are Game Settings found in the Creation Kit in the top menubar under Gameplay --> Settings.

If you want a linear scaling of damage with skill, and want the damage to be multiplied by 5 at skill 100, you need to make sure that:

(fDamagePCSkillMin + (fDamagePCSkillMax - fDamagePCSkillMin) * skill/100) = 5where skill/100 = 1 because skill = 100 so(fDamagePCSkillMin + (fDamagePCSkillMax - fDamagePCSkillMin)) = 5sofDamagePCSkillMax = 5

And you can set fDamagePCSkillMin to any value you like, and this value will be the multiplier at skill level 0. (so if you keep it at 1 the damage will scale linearly by skill from a *1 multiplier to a *5 multiplier, if you set it to 10 damage will actually decrease with skill, etc., you can pick any value you like.
User avatar
Amie Mccubbing
 
Posts: 3497
Joined: Thu Aug 31, 2006 11:33 pm

Post » Wed Jun 20, 2012 9:15 pm

Thanks; that should work fine for the skills.

I also want to change how armor interacts with incoming damage though. I want the total armor rating to be subtracted from incoming damage, instead of whatever it does now.

Edit: that game setting also has "PC" in it, which implies it's only for the player... I'll test if it affects NPCs.
User avatar
NeverStopThe
 
Posts: 3405
Joined: Tue Mar 27, 2007 11:25 pm

Post » Wed Jun 20, 2012 3:40 pm

... such effects you mentioned cannot be obtained through magic effects either.

Magic effects can apply perks.
User avatar
Multi Multi
 
Posts: 3382
Joined: Mon Sep 18, 2006 4:07 pm

Post » Wed Jun 20, 2012 10:28 pm

Magic effects can apply perks.

Yes, but I've tried that, and it ends up with exactly the same problem as trying to add a perk using the AddPerk() papyrus function does, which is that it works fine when adding a Perk to the player, but it just doesn't do anything when adding a perk to NPCs.
User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm

Post » Wed Jun 20, 2012 9:49 pm

Bump...
User avatar
xemmybx
 
Posts: 3372
Joined: Thu Jun 22, 2006 2:01 pm


Return to V - Skyrim