Jump to content

anidamo

Members
  • Posts

    1
  • Joined

  • Last visited

Nexus Mods Profile

About anidamo

anidamo's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

0

Reputation

  1. Hi there, I'm currently trying to create a mod to make the player character use the same head tracking functionality NPCs use when they're talking to you. Currently the player character just stares straight ahead, ignoring NPCs who are speaking to him and it kinda ruins the immersion if you enjoy playing in third person. Ideally, the player character should turn their head to look at any NPC currently talking to him and maybe glance at nearby NPCs or objects within a certain range. I've never modded Skyrim or a Bethesda game before but I do write mobile phone apps for a living so it wasn't too difficult to get the gist of things. Digging through the API reference I see several methods that look relevant: Actor.SetHeadTracking, Actor.SetLookAt, Actor.ClearLookAt Unfortunately I couldn't get these to do what I wanted. Now, I know how to program, but I don't know much about the CK itself, so I'm not sure if I'm just doing something wrong in the editor or just not understanding some elements of Papyrus, or if the issue is something else, but any assistance would be appreciated. I started off by adding a new script to the Player actor in the CK, and writing the following code: Scriptname PlayerHeadTracking extends ObjectReference Actor Property lydiaRef Auto Actor Property pcRef Auto bool isEnabled Event OnInit() Debug.Notification("Loaded plugin.") RegisterForSingleUpdate(5) EndEvent Event OnUpdate() if isEnabled == true Debug.Notification("Clearing look target.") pcRef.ClearLookAt() Else Debug.Notification("Looking at target.") pcRef.SetHeadTracking(true) pcRef.SetLookAt(lydiaRef) EndIf isEnabled = !isEnabled RegisterForSingleUpdate(5) EndEvent I basically wanted to try getting the head tracking part down before worrying about the other bits (where to attach the script, who to look at, etc.) so I made this simple script that simply alternates between looking at Lydia and clearing the target every 5 seconds. Unfortunately, it doesn't work. I get all of the relevant notification messages so the script is running, but the SetLookAt function doesn't appear to do anything. I have swapped the references (making Lydia look at the player) and it works fine, so I don't think I'm making any issues with the editor, but I'm not certain. Perhaps I have to do something special with the player actor to be able to "modify" him? I'm not sure. I suspect it might actually have something to do with the idle animation... the default idle animation for the player has them glance around at nothing in particular, not using head tracking, just as part of the general idle animation. NPCs don't seem to do this... they're always moving their head to look at another actor or object it seems. I wonder if the player character has a different idle animation that overrides any head movement I might set, and if so, would there be a way to remove such an animation? Any ideas?
×
×
  • Create New...