NewUser221341 Posted September 30 Share Posted September 30 Hi, I want my follower to have distinct head normal maps depending on whether they are smiling, surprised, etc. I see there are papyrus functions to retrieve an actor's mood and update their head textures to accomplish this. There doesn't seem to be an event to listen for expression changes. I'm hoping to avoid having a script perpetually running and checking. Is there an elegant solution I'm overlooking? Otherwise, is there a convention for time intervals a mod should recursively call RegisterForSingleUpdate() to avoid causing lag? Thanks in advance. Link to comment Share on other sites More sharing options...
Sphered Posted September 30 Share Posted September 30 Strangely enough there is an actor value for mood you could experiment with. Attach an ability to the actor/s or magic effect/s which can run a script once a condition applies How well this will work, is not something you would be likely to get a concrete answer for. Even if someone claims something is impossible, they might be wrong. Just research these a bit and maybe try them out and see what you can make work Some examples of conditions GetDialogueEmotion GetDialogueEmotionValue IsPleasant GetActorValue: Energy Etc 1 Link to comment Share on other sites More sharing options...
PeterMartyr Posted October 1 Share Posted October 1 mfg all I am gonna say, it will not help detecting any thing, but it will make the facial expression better 1 Link to comment Share on other sites More sharing options...
NewUser221341 Posted October 13 Author Share Posted October 13 (edited) MFG is very useful! Here's what I came up with to change textures depending on actor expression. This script can be added directly to the actor in Creation Kit. Implements OnLoad() and OnUnload() events to only run when the player is nearby. The textures go in TextureSet properties. Every 5 seconds it checks the expression and a phoneme. Currently alternates between smiling and not. Requires MFG Fix and PO3 Papyrus Extension. Spoiler Scriptname MOD_ActorScript extends Actor {Controls face textures.} TextureSet Property FaceNeutral Auto { Contains normal map for neutral face } TextureSet Property FaceSmiling Auto { Contains normal map for smiling face } Int Property UpdateInterval = 5 Auto { Frequency (in seconds) to check for expression changes } Bool Property MOD_Loaded = False Auto Bool Property IsNeutral = True Auto Event OnLoad() if !MOD_Loaded RegisterForSingleUpdate(UpdateInterval) endif MOD_Loaded = true EndEvent Event OnUnload() UnregisterForUpdate() MOD_Loaded = false EndEvent Function MOD_SetTexture(TextureSet FaceTexture) ; Set new texture PO3_SKSEFunctions.ReplaceFaceTextureSet(self, FaceTexture, FaceTexture, 1) EndFunction Event OnUpdate() Int NewExpressionID = MfgConsoleFunc.GetExpressionID(self) ; Debug.notification("E: " + NewExpressionID + " P5: " + MfgConsoleFunc.GetPhoneme(self, 5)) if (NewExpressionID == 2) || (NewExpressionID == 10) || (MfgConsoleFunc.GetPhoneme(self, 5) >= 50) if IsNeutral MOD_SetTexture(FaceSmiling) IsNeutral = false endif elseif !IsNeutral MOD_SetTexture(FaceNeutral) IsNeutral = true endif if MOD_Loaded RegisterForSingleUpdate(UpdateInterval) endIf EndEvent Edited November 7 by NewUser221341 Clarity and better answer. Link to comment Share on other sites More sharing options...
Recommended Posts