Altering NPC "accuracy"

Post » Fri Dec 02, 2011 7:36 pm

So I'm using a script that gives the player/NPCs a malus to accuracy under certain conditions - specifically when they're using a gun and they're in melee. Script itself works just fine. And for the player, I can activate the effect via perk, which gives me access to all sorts of nastiness - in addition to skill loss, I can add AP penalties, VATS accuracy loss, and massive weapon sway; and I can potentially crank it up so it's nigh-on-impossible to hit a thing. For NPCs, I can give them the effect just fine, it's just that I'm limited in what I can do with the effect. I can reduce their weapon skills down to 0, but the effect of this on NPCs at point-blank seems fairly minimal. Weapon spread seems to only be alterable via perk, which despite what I've seen written, still seem to be impossible to give to NPCs (I guess there's some fudge for companions?).

So first question is does anyone know how NPC accuracy is actually determined? Do they even follow the same rules? I get the impression that they're calculated like the player in non-VATS mode - it's something like they have perfect "crosshair accuracy" (ie they aim as if they had their crosshairs always perfectly trained on the torso of their target) and their shots are then modified in the same way as the player via spread based on skill and the weapon's own spread. Something like what's talked about for the player in http://www.gamesas.com/index.php?/topic/1142921-in-depth-explanation-of-spreadaccuracy/page__hl__accuracy. Is this the case, or do they use some sort of VATS-like fudge formula?

Second is does anyone know any way of harming an individual NPC's accuracy beyond changing their weapon skill? I can't see any way of changing the character's own weapons spread except via perk, and I don't imagine that NPC weapons check strength/skill requirements for effective aiming either. There's a NVSE function that can edit weapon spread, but that sets off all sorts of alarm bells for horrible messiness. Also, I can't see a way to call it anyway, since it would require the specific weapon's reference, and the only function I can see to return the weapon of a given actor - GetEquippedObject - returns the base ID instead. I looked into trying some sort of reverse of the Steady drug, but it seems to work via perk anyway. I'm not sure how cripple effects work, but is there any way of shoehorning that effect in?

Failing that, does anyone have any good ideas of how else to have a similarly effective penalty for NPCs via some other fudge method? I was thinking perhaps something like more likely to do the pain animation or something when hit by a melee/unarmed weapon - I don't think it's possible to have an actor effect or token that checks for when the affected actor is hit via an OnHit or something like it (or is it?), but I guess this could be fudged for player interactions by a player perk similar to Super Slam?
Or more likely to drop their equipped item?
Or just something to slow their rate of fire?

Anyway I'm entirely open to any and all suggestions!
User avatar
ZANEY82
 
Posts: 3314
Joined: Mon Dec 18, 2006 3:10 am

Return to Fallout: New Vegas