Jump to content

How can I get current ranged damage by an NPC in Papyrus?


Recommended Posts

Let's say I'm building a mod which, under certain circumstances, changes an NPC's equipped ranged weapon's damage. So there is an ActorValue crRangedDmg which perfectly fits my plans. For example, I need to enhance current ranged damage by 60%, so I get this value, multiply it by 0.6 and pass it to this NPC's crRangedDmg. The question is: how exactly do I get this current ranged damage value from the NPC? I know, the answer should be pretty simple, but I just can't figure it out)

P.S. Sorry for my poor english, hope I could describe my situation clear enough.

Link to comment
Share on other sites

I really doubt that the game is storing every npc's ranged damage in actor value. Atleast not if using guns. Maybe for stuff like Bloatflys who have fixed damage. Npc's spawn with random weapons and can pick new weapons in battle etc.. but maybe I'm wrong.

 

I guess first step is to find/spawn some npcs and in console click them and type "getav crrangeddmg" to see if it even works. Or type "help crranged 4" first.

 

Easiest way to give them more dmg is to give them perk that multiplies weapon attack damage. If you want during battle, to see how much damage they do and after that rise the damage.. well, I'm not sure if there is a good way to that. You can scan their weapon and mods with script but, eh, it's kinda messy and lots of scripts running in any bigger battle.

 

To your original answer, how to get actor value of certain npc? Well, you can do it with magic effect with cloak+radius that uses akTarget.GetValue(crRangedDmg) or you can have somekind of "combat quest" that you start when combat starts or player gets hit, and it fills aliases and runs script event OnAliasInit that Gets the value for you.

 

But I don't think any of that is good or necessary, just use perk, you can also give perk to player that scales damage on conditions, depending who hits you, what weapon they use etc etc. Or give the npc's better weapons. Are they your custom npc? Why do you need their exact damage?

 

 

tldr; Give them perk that scales weapon attack damage by 1.6 and give them conditions, when you want it to happen. For example you can make it happen when they hit 20% life.. etc

Link to comment
Share on other sites

Am I really that bad at english, or is it just your inclination to give your advices everywhere even if you're not being asked to? I have an NPC. He has a gun in his hands. I need to get that gun's damage somehow. That's it. If you don't know how to do it, just move along please and don't make me waste my time reading tons of text about your doubts, speculations and consumptions, unrelated to my question. I don't need to create a perk, I need to change damage through the script. crRangedDmg works fine, I already checked that, and If you don't know even these basics then your advices and comments worth absolutely nothing.

Edited by RandomUnit
Link to comment
Share on other sites

I just told you how to get it. Make a magic effect cloak or use a quest that starts and fills alieses and runs horrible looping script to get your damage.

 

Also I just tried crRangedDmg on a trapper wielding gun and it gave 0.00 every time with Harpoon gun in his hands, so good luck with that. Even Assaultron with headlaser shows 0.00.

 

So basically you have to make F4SE plugin to get your dmg without looping trough gun mods, but for a pro like you, it should be easy. First you need to learn to get actorvalue from actor, tho. :happy:

Link to comment
Share on other sites

Let's say I'm building a mod which, under certain circumstances, changes an NPC's equipped ranged weapon's damage. So there is an ActorValue crRangedDmg which perfectly fits my plans. For example, I need to enhance current ranged damage by 60%, so I get this value, multiply it by 0.6 and pass it to this NPC's crRangedDmg. The question is: how exactly do I get this current ranged damage value from the NPC? I know, the answer should be pretty simple, but I just can't figure it out)

P.S. Sorry for my poor english, hope I could describe my situation clear enough.

First of all, don't be rude to person who tries to help you.

 

So to answer your question:how exactly do I get this current ranged damage value from the NPC.

Answer: There is no way to get the damage value NPC does. you can modify it's value with perk entries, but can't get value. crRangedDamage is just actor value used by specific type of Actors as perks which adds bonus damage for them, it's useless for you.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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