Jump to content
ℹ️ Download History temporarily unavailable ×

Animation help from inside scripts.


JonathanOstrus

Recommended Posts

I'll cut to the chase. I'm working on a memory perk reset function for an Enderal mod. The original Enderal script code plays one of 2 different animations depending on the object reference.

MemoryPoint.PlayAnimation("PlayAnim02") ; For the memory star
...
MemoryPoint.GetLinkedRef(__PerkLine01).PlayAnimation("Unlock") ; for the perk connecting lines
...

I'm having problems trying to undo the "Unlock" and "PlayAnim02" states of them though. To give as much detail as I can, the PerkLines are vanilla skyrim meshes and animation files. The memory stars seem to be their own custom file but using skyrim vanilla animation files.

 

For the perk line the behavior reference is Interface\INTPerkLines.hkx > InterfaceBehaviors\Characters\Line\Line.hkx > InterfaceBehaviors\Behaviors\Line\Line.hkx

For the memory stars the behavior reference is GenericBehaviors\IdleTransIdleBack.hkx > Characters\IdleTransIdleBack\IdleTransIdleBackCharacter.hkx > Behaviors\IdleTransIdleBack\IdleTransIdleBackBehavior.hkx

 

I've already run hkcmd on the files and converted them to xml. It was the way I traced out the paths. In the last file it has a listing of events which seems is what I'm supposed to use with the PlayAnimation function.

Snipped from the xml events of line.hkx

 

			<hkparam name="eventNames" numelements="17">
				<hkcstring>LockedState_to_UnlockState</hkcstring>
				<hkcstring>Unlock</hkcstring>
				<hkcstring>UnlockState_to_UnlockedState</hkcstring>
				<hkcstring>End</hkcstring>
				<hkcstring>LockedState_to_LockedFadeState</hkcstring>
				<hkcstring>Fade</hkcstring>
				<hkcstring>FadeOut</hkcstring>
				<hkcstring>LockedFadeState_to_LockedState</hkcstring>
				<hkcstring>FadeIn</hkcstring>
				<hkcstring>UnlockedState_to_UnlockedFadeState</hkcstring>
				<hkcstring>UnlockedFadeState_to_UnlockedState</hkcstring>
				<hkcstring>LockedFadeOutState_to_LockedFadeOutState00</hkcstring>
				<hkcstring>LockedFadeOutState00_to_LockedState</hkcstring>
				<hkcstring>UnlockedFadeOutState_to_UnlockedFadeInState</hkcstring>
				<hkcstring>UnlockedFadeInState_to_UnlockedState</hkcstring>
				<hkcstring>to_UnlockedState</hkcstring>
				<hkcstring>Unlocked</hkcstring>
			</hkparam>

 

 

Snipped from the xml events of IdleTransIdleBackCharacter.hkx

 

			<hkparam name="eventNames" numelements="11">
				<hkcstring>End</hkcstring>
				<hkcstring>StopEffect</hkcstring>
				<hkcstring>EndAnim</hkcstring>
				<hkcstring>PlayAnim01</hkcstring>
				<hkcstring>SoundPlay</hkcstring>
				<hkcstring>Imod</hkcstring>
				<hkcstring>RImod</hkcstring>
				<hkcstring>PlayAnim02</hkcstring>
				<hkcstring>TransitionAnim</hkcstring>
				<hkcstring>SoundStop</hkcstring>
				<hkcstring>SoundPlayAt</hkcstring>
			</hkparam> 

 

 

 

In full disclosure I'm not sure how to read the xml exactly or if there are GUI tools for manipulating it.

 

Perk Lines

For the perklines I can get the "FadeOut" to run but then the original code that plays "Unlock" doesn't display it again unless the FadeIn is called. I'm trying to avoid modifying the original files if at all possible. If I use PlayGamebryoAnimation("Locked") and modify the original script to PlayGamebryoAnimation("Unlocked") I can sort of get a workable result. There are some problems with this method detailed below. It's not the same animation though, but it might be passable if I can fix the problem stated below.

 

Memory Stars

For the memory stars the nif has 3 animations animIdle01, AnimTrans01, AnimIdle02. They start out in a very dim state using their animIdle01. Running the PlayAnimation("PlayAnim02") they brighten up and are then bright pulsing. Using the previously mentioned trick of the PlayGamebryoAnimation sort of works. I can PlayGamebryoAnimation("animIdle01") and they become dim again. But there's issues I state below. I've tried using the hkx events: StopEffect, End, EndAnim, and PlayAnim01. The first 3 have no effect. The PlayAnim01 causes the animation to freeze and I have a static bright ball, however running the PlayAnim02 again starts the animation back up correctly. I just can't get it to dim.

 

Complications using PlayGamebryoAnimation method.

After doing a reset which causes everything to go into their "disabled" state again. If I were to reload a different save then all the affected objects are out of animation sync with the save. The only solution is to close and reopen the game exe itself.

 

So my ultimate questions are these:

  1. Does anyone know how to redo the lock on the PerkLine using the proper events so the Unlock works?
  2. Can it be done without making new animation stuff in the nif or hkx files? (I have no idea how to do those)
  3. Can the memory stars be dimmed using the default events?
  4. Would the memory stars require modified nif/hkx files to do it?

I'm not opposed to making modified nifs if that's what it takes, I just have no idea how to go about doing it. All my experience so far has been static models that are then weighted to skeletons (think armors). I've never done any actual animating myself.

Link to comment
Share on other sites

I'm making this post for archival purposes in case anyone else ends up having a similar issue and needs a solution.

 

I solved the problem for the most part. In short I had to modify a nif and the behavior file. I didn't want to, but you do what you have to sometimes. It did not require changing the original script to point to different animations which was one of the main concerns.

 

The PlayGamebryoAnimation didn't as I expected. You could say it didn't work at all. It did play the animations but it cause a weird visual glitching state. It doesn't change the animation state for the behavior, so upon reload the game the objects would animate in the last proper state, even if that was undesired.

 

My final solution was to edit the memory star nif and put in a second transition animation. I went lazy and just copied the original and renamed it. The animation isn't correct but allows the PlayAnim01 event to toggle it back off.

 

For the perk line I had to use hkxcmd to convert the behavior file, edit it, and convert back.

 

The simplest way to describe the edit would be: Add a new event, then under the transition event section for the Unlocked state add another trigger that pointed back to Locked state. It doesn't animate back to lock state but just jerks the animation which will suffice for my needs. The states are there to properly animate it back off, but since I don't really understand the processing code I didn't want the screw things up so I just called it good when my hack job worked.

Edited by BigAndFlabby
Link to comment
Share on other sites

  • Recently Browsing   0 members

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