Jump to content

[LE] Replicating setnpcweight in Papyrus (Resetting NPC faces)


Haravikk

Recommended Posts

So I've made a mod that can change the race of arbitrary NPCs as part of a quest, changing them in a similar fashion to vampirism. Now, it's supposed to leave their face completely unchanged (to prevent any loss of tattoos, face gen data etc.) by using the same head mesh and parts, and works fine on most NPCs, but for some NPCs their face-tint is removed (but everything else is fine, they just suddenly have a light grey-ish skin tone on their face).

 

Thing is, I can trivially fix this in the console by using the setnpcweight command, which restores the NPC's facial tint to normal.

 

What I need is some way to do this via Papyrus, but it seems like setnpcweight is doing something that the Papyrus methods I'm aware of do not. Here's my current code to try to replicate it:

Function FixHead(Actor akActor)
	ActorBase akActorBase = akActor.GetActorBase()
	akActorBase.SetWeight(akActorBase.GetWeight())
	akActor.QueueNiNodeUpdate()
EndFunction

I've also tried changing the weight to a different value, then changing it back (in case setting the same value doesn't result in an update), but neither of these seems to work.

 

So there's obviously something going on with the setnpcweight console command that changing the weight in Papyrus doesn't do, but I'm at a loss as to what that might be.

 

I've also already tried SKSE's .RegenerateHead() method but this doesn't appear to work either (I assume it's just the same as .QueueNiNodeUpdate() but only for the head).

 

Anyone know of what Papyrus method(s) I can use to reset an NPC's facial tint in the same way that setnpcweight does in the console?

Link to comment
Share on other sites

Sorry to bump this, but I still haven't found a way to replicate setnpcweight's face resetting; are there any other functions that I can use? I know the console commands are, for some bewildering reason, totally independent of Papyrus, but it seems strange that I wouldn't be able to trigger the same behaviour that setnpcweight does. Is there really no way at all to do it?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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