Script to get actor damage

Post » Fri May 24, 2013 5:44 am

Is there any way to, in essence, simulate combat between two actors and get the damage that one *would* deal without waiting for actual combat to occur?

I'm planning on writing a mod that will be a color-coded detect life/death for stealth characters. If the player would kill the NPC from sneaking in one hit, the NPC should glow green. If not, then it should glow red. I imagine the second part will just be copying a lot of what the existing Detect Life effects do, but I'm not sure the best way to do the first part.

Obviously the game has to calculate damage between two actors somewhere, the question is if those methods are available to us.
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Fri May 24, 2013 8:47 am

It would be possible to achieve what you're after. It won't be simple though, and will require a good amount of scripting. I'd post links to CK articles but not at my PC.

In essence what you'll need to do is run a script that checks the NPCS health against the players damage value (or sneak damage value), and use that logic to make something happen. GetActorValue() will probably be needed.
User avatar
Emma Louise Adams
 
Posts: 3527
Joined: Wed Jun 28, 2006 4:15 pm


Return to V - Skyrim