Jump to content

Need help with killmove script


MadManP

Recommended Posts

So I've looked everywhere trying to find out how this might be done... and I'm stumped!

 

I'm trying to initiate an unarmed killmove from a script that won't result in the NPC dying at the end of it.

 

Setting the NPC to essential temporarily (if he wasn't already) would be easy enough, but I'm stuck on how to even trigger the killmove via script... any help would be appreciated.

Link to comment
Share on other sites

Activating killmoves from script works with

 player.PlayIdleWithTarget(<killmove_idle>, target)

The <killmove_idle> definition is in the CK. Although there are numerous h2h killmoves which are defined in Skyrim (behaviors), but didn't make it to the user interface, since their idle definition was not made. But several killmove mods have found out which animations these are, and have made the definition.

 

However you cannot call them without the killNPC trigger. Which results in the bleedout state at best when the NPC is essential.

 

What you could do however is to define the killmove as paired animation with FNIS, and then the target remains unharmed.

Link to comment
Share on other sites

Thank you!

 

I'm very new to modding and while I've been reading and trying to learn as much as I can... there are still many things beyond me. I have no clue how to make use of FNIS to register a new paired animation, for example... but thanks to your suggestion I've come up with a very makeshift script that seems to work... somewhat...

 

I'd be more than thrilled to read up on how to make use of FNIS if you could direct me to some kind of tutorial or introduction or anything really...

 

Thanks again for taking the time to help :)

Link to comment
Share on other sites

Thank you!

 

I'm very new to modding and while I've been reading and trying to learn as much as I can... there are still many things beyond me. I have no clue how to make use of FNIS to register a new paired animation, for example... but thanks to your suggestion I've come up with a very makeshift script that seems to work... somewhat...

 

I'd be more than thrilled to read up on how to make use of FNIS if you could direct me to some kind of tutorial or introduction or anything really...

 

Thanks again for taking the time to help :smile:

 

Look at the FNIS files section. There is a FNIS for Modder's Doc. That explains all you need to know. Behavior background, making of, specific paired/killmove information.

 

Generally you create a animations/<mymod> folder. In this folder you have a file FNIS_mymod_List.txt with the following definition

pa -bsa,D2.8333 myh2hkkillmove ..\paired_h2hkillmoveslama.hkx

2.8333 is the duration of this specific killmove (can be found out with hkxcmd), bsa simply tells the generator not to look for the animation file since it's in a bsa. The you run this file through the generator for modders, and then the user one as usual.

 

 

Thanks a lot Fore this helps me out as well. Kudos to you :smile:

 

Thanks. Don't hesitate to ask. I am very much interested in spreading the word about such animations.

Link to comment
Share on other sites

This is great... Thank you so much for all the help!

 

I've figured out how to make use of FNIS and I've added the paired animation... I think I figured out the duration of the animation through hkxcmd (though it doesn't seem to make any difference what I set it to), and the pdf did give an example of how to add sound effects, but it also made reference to a text file with more options, which I can't find anywhere... oh well..

 

Anyway... I've got everything working... except at the very end of the animation the enemy gets back up and does a hug animation for some strange reason... Setting them to unconscious, ragdolling even paralysis doesn't stop it, in fact rogdolling in the first place seems to be related to triggering it... I'm thinking that's some other mod I have that's forcing that AI behavior... I can't figure out how to stop triggering it while still ragdolling the NPC... it'd be nice to be able to tell the AI to reset or something... they don't do this when spells cause them to ragdoll... so something's up...

 

Here's the script I'm using:

 

(I'm not sure how to do the spoiler tab, so sorry about the length)

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Target = akTarget
	Caster = akCaster
	if (Caster == Game.GetPlayer()) && (Target.HasKeyword(ActorType) == true)
		Game.DisablePlayerControls()
		Game.ForceThirdPerson()
		Target.SendTrespassAlarm(Caster)
		Target.MoveTo(Caster, 100.0 * Math.Sin(Caster.GetAngleZ()), 100.0 * Math.Cos(Caster.GetAngleZ()), 0.0)
		Target.SetAngle(0.0, 0.0, (Caster.GetAngleZ() + 180.0))
		RegisterForSingleUpdate(0.1)
	EndIf
EndEvent

Event OnUpdate()
	Target.MoveTo(Caster, 100.0 * Math.Sin(Caster.GetAngleZ()), 100.0 * Math.Cos(Caster.GetAngleZ()), 0.0)
	Target.SetAngle(0.0, 0.0, (Caster.GetAngleZ() + 180.0))
	Target.EnableAI(0)
	Utility.Wait(0.1)
	if (Caster.PlayIdleWithTarget(BeatDown, Target))
		Target.EnableAI(1)
		Game.EnablePlayerControls()
;		Debug.Notification("it worked!")
		Utility.Wait(AnimTime)
		Target.StopCombatAlarm()
		Target.SetActorValue("Paralysis", 1)
		Target.SetUnconscious(1)
		Target.PushActorAway(Target, 0.1)
		Utility.Wait(2)
		Target.PushActorAway(Target, 0.1)
	Else
		Try = (Try - 1)
		If (Try >= 1)
;			Debug.Notification("it didn't work, trying again")
			RegisterForSingleUpdate(0.2)
		Else
;			Debug.Notification("it didn't work, giving up")
			Game.EnablePlayerControls()
			Target.EnableAI(1)
		EndIf
	EndIf
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
	If Target.IsUnconscious() == 1
		Target.SetUnconscious(0)
		Target.EvaluatePackage()
	EndIf
	If (Target.GetActorValue("Paralysis") >= 1)
		Target.SetActorValue("Paralysis", 0)
		Target.EvaluatePackage()
	EndIf
EndEvent
Edited by MadManP
Link to comment
Share on other sites

Great and .... strange.

 

The duration doesn't seem important, but since all vanilla pa and km sent triggers at the end of the animation I think there must be a reason for it. Even if we don't understand it :)

 

The additional trigger list is not a txt file, it's an xls which id part of the Modders' Doc download.

 

The hug thing is weird. That might be an FNIS bug. Maybe one of the end triggers got messed up. Because the hug is pretty much the only non-kill paired animation, and therefore the place where I have added custom pa into the vanilla behavior files.

 

Have you tried FNIS Spells? There 9 pa animations defined. The hug and 8 killmoves as pa, just like what you did. Do they work for you?

 

If this issue still persists, then

- post the content of you AnimList

- upload your GenerateFNIS_for_Users/temporary_logs/0_master.xml

Link to comment
Share on other sites

I figured out what's causing it... the ragdoll effect was cutting the animation short by a millisecond which caused the AI to perform a hug animation the moment it was allowed to... if I wait to ragdoll until well after the animation is done playing the hug animation doesn't happen... but it looks kinda clunky, since the actor goes from lying on the ground to fully standing to then ragdoll back to the ground...

 

Now I can finetune the script timing, but any script lag or anything causing the slightest inconsitency in the timing will make things silly again...

 

Is there a way to cause the animation itself to result in a ragdoll state at the end of it? I don't know how to listen for the animation END event in papyrus... But even so attaching the ragdoll state to the animation event would be ideal...

Edited by MadManP
Link to comment
Share on other sites

Still strange. HugA should not happen, even if you cut something short. Because I can't see anything that could trigger it. Can you tell how you cut it short, so I can try to reproduce it myself?

 

There are 2 AnimEvents triggered at the end of a pa: NPCpairedStop and NPCPairEnd. That's why you have to define the animation duration. These AEs (or any other AE defined with the -T parameter) can be caught with OnAnimationEvent()

 

THere are also 2 interesting AEs you might try to send: Ragdoll and RagdollInstant. But I don't know if it will show the effect you want. They both have local transitions. Which means they only work in certain states. Ragdoll can also cause the default (non-ragdoll) position. But it'S worth a try.

Link to comment
Share on other sites

It's in the script above... I used the PushActorAway function after waiting the exact duration of the animation event. turns out it was a bit too quick. if I waited 0.1 seconds longer the NPC would bounce off the ground with an unpredictable force, if I waited longer the NPC would stand back up first, THEN fall and finally if I did it at the exact moment or slightly sooner it looked good... but the NPC would do a hug animation after doing the regular stand-up from ragdoll thing... despite having been set to unconscious AND paralyzed... so not entirely sure what's causing it...

 

I'm going to try sending the ragdoll animation event next... but now i'm wondering if I can use that -T parameter to make the paired animation chain right into a ragdoll for actor 2... something like that possible?

 

Edit:

 

Listening for the NPCpairedStop as well as NPCPairEnd animation events both failed to trigger...

And sending the Ragdoll/Instant Animation events did not look good...

 

I'm stumped... I guess the best I can do is time the PushActorAway in the script, and hope there's little to no script lag or variation...

 

Oh and P.S.

 

Thank you again for all your help!

Edited by MadManP
Link to comment
Share on other sites

  • Recently Browsing   0 members

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