It's working! ...but it needs help.

Post » Tue Jun 19, 2012 3:01 pm

Perk name: DVampireFeed2
Perk Entry: Activate
Conditions-Perk Owner: IsSneaking=1 AND, GetVampireFeed = 0 AND, HasKeyword = "Vampire" AND
Conditions-Targets: IsChild = 0 AND, HasBeenEaten = 0 AND, HasKeyword = "ActorTypeNPC" AND

Game.GetPlayer().StartVampireFeed(aktargetRef as actor)Game.ForceThirdPerson()Game.GetPlayer().PlayIdle(pa_HugA)Utility.Wait(2.5)Game.GetPlayer().PushActorAway(akTargetRef as actor, 0)DVampireQuest.VampireFeed()

I currently have this script fragment running along side the vanilla VampireFeed perk.

For the most part it works. It resets the feed timer in my vampire quest script. It plays the ISM effects. The target even falls limp.

The problem is two-fold. 1. The animation doesn't always play. I can't figure out why. 2. When the animation does play it only plays in the current location the PC is. It does not bring the target in to make the animation look legitimate. Sometimes my character looks like he's hugging air.

There is actually a third problem. The original vampire feed perk is designed to work on sleeping NPCs. With my new perk if an actor is running a package that leads them toward a bed to sleep it will instantly teleport the PC to their bed and play the bed feeding animation.

I'm close to finally adding this to my mod so any help would be great!
User avatar
Tom
 
Posts: 3463
Joined: Sun Aug 05, 2007 7:39 pm

Post » Tue Jun 19, 2012 10:32 pm

Game.GetPlayer().StartVampireFeed(aktargetRef as actor)Game.ForceThirdPerson()Debug.SendAnimationEvent(akTargetRef as Actor, "staggerStart")Game.GetPlayer().PlayIdle(pa_HugA)DVampireQuest.VampireFeed()


This is how the new fragment looks.

i like it better. However I still can't get the hug animation to always play. Stagger animation on the target always works so that's good.

What I'm trying to achieve is something similar to a killcame move. In where the pc and the target animations line-up to look legitimate. I also want the PC hug animation to ALWAYS play whenever this style of Feeding is triggered.

Thanks in advance if you can help.
User avatar
T. tacks Rims
 
Posts: 3447
Joined: Wed Oct 10, 2007 10:35 am

Post » Tue Jun 19, 2012 8:00 pm

Game.GetPlayer().StartVampireFeed(aktargetRef as actor)Game.ForceThirdPerson()Debug.SendAnimationEvent(akTargetRef as Actor, "staggerStart")Game.GetPlayer().PlayIdle(pa_HugA)DVampireQuest.VampireFeed()


This is how the new fragment looks.

i like it better. However I still can't get the hug animation to always play. Stagger animation on the target always works so that's good.

What I'm trying to achieve is something similar to a killcame move. In where the pc and the target animations line-up to look legitimate. I also want the PC hug animation to ALWAYS play whenever this style of Feeding is triggered.

Thanks in advance if you can help.
You could try using "SendAnimationEvent" on the player instead of using playidle and see if that works. Just be sure to use PlayIdle(IdleStop_Loose) afterwards to restore their animations.

so it would be:
Debug.SendAnimationEvent(Game.GetPlayer(), "pa_HugA")          ; You may want to remove the quotes. I'm not entirely sure if you need them or notUtility.Wait(3)		   ; <--- 2-3 seconds is usually good for most animations, but you may need to experimentPlayIdle(IdleStop_Loose)
User avatar
Victoria Bartel
 
Posts: 3325
Joined: Tue Apr 10, 2007 10:20 am

Post » Tue Jun 19, 2012 7:21 pm

You could try using "SendAnimationEvent" on the player instead of using playidle and see if that works. Just be sure to use PlayIdle(IdleStop_Loose) afterwards to restore their animations.
There's no any difference between SendAnimationEvent and PlayIdle other than the former discards conditions set for Idles in Animation Window. And pa_HugA anim doesn't have any such conditions set there.


Draeka -
pa_HugA is a paired animation, so if you want both (PC and NPC) to play it you need to use http://www.creationkit.com/PlayIdleWithTarget_-_Actor function instead of PlayIdle alone...
User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

Post » Wed Jun 20, 2012 2:28 am


There's no any difference between SendAnimationEvent and PlayIdle other than the former discards conditions set for Idles in Animation Window. And pa_HugA anim doesn't have any such conditions set there.


Draeka -
pa_HugA is a paired animation, so if you want both (PC and NPC) to play it you need to use http://www.creationkit.com/PlayIdleWithTarget_-_Actor function instead of PlayIdle alone...
My experience with SendAnimationEvent is that it plays the animation in all situations. Perhaps it's because of the conditions you mention, but that is why I suggested using it. When PlayIdle would not work for me, sendanimationevent would.

But, as you said, PlayIdleWithTarget is a better idea. I did not know the animation he was using was a paired animation. That would simply things for him.
User avatar
Roisan Sweeney
 
Posts: 3462
Joined: Sun Aug 13, 2006 8:28 pm

Post » Wed Jun 20, 2012 1:53 am

When PlayIdle would not work for me, sendanimationevent would.
You can always create new entry in that Idle Animations window for certain animations without those conditions set and PlayIdle will work for them as well.
The point is that SendAnimationEvent can't play every single Animation Event. SAE can only play some portion of all Anim Events - and exactly the same you can achieve with PlayIdle.
User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am


Return to V - Skyrim