Skyrim

Sometimes, if you play as a vampire and attempt to feed on an NPC, you may be left totally unable to move after the feeding animation completes. The only fixes are to load a previous save, or to run the SetPlayerAIDriven 0 console command. Why does this occur, and how did I fix it?

When you attempt to feed on an NPC, the game creates an AI package at run-time, with a special type that can't be set in the Creation Kit: a "vampire feed" package. The game assigns this package to your character. (It also assigns a "do nothing" package to the person you're feeding on.) However, your character isn't an NPC, so how can they run AI packages? Well, the game flags you as "AI-driven:" it turns your character into an NPC.

Your character can generate and send what are called "animation events," which the game's various systems can "listen" for. One event, called "PickNewIdle," is sent whenever you finish playing certain animations, including the vampire-feed animation. When PickNewIdle is sent, certain data will be set within a character's AI. The vampire feed package is programmed to check for that data at regular intervals. When it sees the data, it sets you to no longer be AI-driven, and then it ends itself.

So where's the bug? Well, something -- and to be honest, I still don't know what -- can remove the AI package from your character early. If that happens, then the package won't be around to hear the PickNewIdle event, and won't set your character to no longer be AI-driven, leaving you stuck.

As for how I fixed it? I found the code that removes an AI package from any character, and patched it to check for a few things:

  • Is this a vampire-feed package?
  • Does it belong to the player?
  • Is the player still AI-driven?


If all of these conditions are met, then I remove your character from the AI-driven state.

Article information

Added on

Written by

DavidJCobb

3 comments

  1. OdinSaxxon
    OdinSaxxon
    • premium
    • 0 kudos
    I'd like to note: 
    You don't HAVE to be a vampire for this to work. If you become the champion of Namira this softlock can also occur. This specifically happened to me when completing the quest after eating the priest of Arkay. Also, this could probably happen to werewolves as well, so this would probably work on them too.
  2. wgperi
    wgperi
    • member
    • 34 kudos
    Hi Cobb, big fan of you here. I'm fairly a complete noob but I've compiled some scripts before. Do you have a suggestion of where to place the "SetPlayerAIDriven 0" in the PlayerVampireScript ? I have tried placing it right at the end of the feed function but didn't quite work.
     
    I'm also currently playing SSE so I can't immediately benefit from your fixes mod, so any suggestion is appreciated. Thanks a lot for your work, I've followed you since your contributions to the Creation Kit wiki and a suggestion you made for Bloody Facials some years ago. Take care.
    1. DavidJCobb
      DavidJCobb
      • premium
      • 366 kudos
      Oh wow, I don't think I got the notification for this comment!

      I'm not familiar with the vampire scripts, but on the off chance you still need this, I'd *expect* you'd want to ensure it runs after the player starts feeding. A timed delay could work, or if the script has a "you're done feeding" function, try putting it in there.