Jump to content

Issue with Creation Kit and Vampire Feed Idles on NPCs.


christopher4684

Recommended Posts

Good afternoon all,

 

To give some background I am an experienced programmer with several languages under my belt, including Bethesda's scripting language for the creation engine and I have had a lot of success with my last two mod projects for Fallout 4 and Skyrim SE.

 

I am simply looking for an answer to a problem that is befuddling me beyond comprehension. I wish to accomplish the smallest of tasks and the game engine just won't seem to allow it. I would simply like to create an OnHit event, or any other method of executing code from an NPC, but the point is when the vampire NPC reaches low health I want them to bite the player to re-heal. Now the bite spell is already prepared and works on the player side, and the bite animations play without issue from the player side. Here's my problem:

 

When the conditions in the code are met, and the code calls the Vampire Feed idle, the screen goes to third person and then nothing happens. Essentially I am using the below method to accomplish this. This code is executed from a actor quest alias.

 

Idle Property VampireFeedIdle Auto

 

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \
If Self.GetActorReference().GetAV("Health").GetActorValuePercentage("Health") <= 0.2 ;Checks NPC vampire's remaining health.
If Utility.RandomInt(1,100) <= 10 ;Creates a percentage chance check on next hit.
Debug.Notification("Debug message: Animation triggered!")
Self.GetActorReference().PlayIdleWithTarget(VampireFeedIdle, Game.GetPlayer())
EndIf
EndIf
EndEvent
When the conditions are matched, then debug message comes up, the player's screen moves to third person and then nothing happens. I have seen this done in other mods and I am really confused as to why I seemingly cannot achieve was seems like should be a simple task. If anyone could assist me in working out what is going wrong I would be most appreciative. I can call the vampire feed idles while in dialogue with a vampire to make them feed on me, so I know the animation isn't the issue. It must be something else.
Thank you all in advance!
Chris.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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