Jump to content

About This File

INTRODUCTION

 

This SKSE plugin allows registering custom animation events on ObjectReferences.
Pretty much like the existing Form.RegisterForAnimationEvent, but not limited to
the vanilla animation events.

 

I might need to run papyrus code triggered by animations called from arbitrary
mods. I thought it was not possible registering custom animations, until I found
these amazing work: https://github.com/towawot/DLL-GunsmithSystem

 

================================================================================

 

INSTALLATION

 

Copy the contents of the Data folder into Skyrim\Data
Or use any mod manager.

 

================================================================================

 

USAGE

 

Register animation events, for a specific object reference or globally.
For example:

 

; registers the animation only for the player
RCAE.RegisterForAnimEventOnRef(Game.GetPlayer(), "MyAnimationEvent")

 

; registers another animation for any character
RCAE.RegisterForAnimEvent("AnotherSexyAnimation")

 

Then an OnAnimationEventEX callback event is called whenever a reference plays
the registered animation event. This event has some restrictions, read the notes

 

Event OnAnimationEventEX(ObjectReference akSource, string asEventName)
if akSource == Game.GetPlayer() && asEventName == "MyAnimationEvent"
...
endIf
EndEvent

 

================================================================================

 

NOTES

 

- Won't work on ObjectReferences that are not actors. I think it could, but
currently is hardcoded just for actors (NPC or player)

 

- The OnAnimation Event callback only seems to work when its script points to
the player character. Actually I'm not sure on this.
I've successfully tested the callback on ReferenceAlias and ActiveMagicEffect
scripts, both pointing to the player.
The callback is not called if it's on a quest script, neither on a NPC's
ActiveMagicEffect.
I think this is because the player character is being used as a base object when
the SKSE plugin sends the event to Papyrus.

 

- The stuff registered is stored in memory and is lost when the game is closed

 

================================================================================

 

CREDITS

 

- towawot for https://github.com/towawot/DLL-GunsmithSystem

 

- himika for https://github.com/himika/libSKSE

 

- SKSE Team for http://skse.silverlock.org/

================================================================================

CHANGE LOG

v02: Added thread safety
v01: Initial release




×
×
  • Create New...