Jump to content

1 Screenshot

About This File

What is this?

This is a modders resource. As more and more mods trigger events when actor values reach specified values there are conflicts as they compete to start up their events. This mod is a framework to manage those events.

 

Who Should Use It?

Modders who want to trigger events when monitored actor values enters a specific value range. Gamers who install a mod and the mod author lists this as a required mod.

 

Modders who want to use Actor Events in their mods should download the Github copy (Wiki is a WIP).

 

Everyone Else should download the mod from loverslab.com.

 

Files

  • actorEvents.esm & .bsa: the framework files

How does it work?

Actor value changes trigger the activation and deactivation of magic effects attached to an ability added to the actor. This activation/deactivation triggers scans a list of registered mods to see if they are watching that value and if the value being monitored falls within their selected range. Mods competing for the same event are chosen by a prioritized random selection set by the user in MCM.

 

The selected mod event then gets it's custom event sent appended with "_start". The actor is flagged as being within an event associated with the monitored actor value ( other actor values can still receive events ) by adding a hidden spell "ae_marker_{value}" (e.g. "ae_marker_health"). The actor must not already have the spell for an event to be sent.

 

When the actor value moves out of range of the selected mod event, the custom event is sent again appended with "_end" At this time the spell is removed and the actor value can again trigger mod events.

 

Monitor an Actor

Parameters

  • Actor akActor: the actor to enable/disable monitoring for.
  • Bool abMonitor: enable (abMonitor = true) or disable (abMonitor = false) actor event monitoring.

Returns

  • Bool: Success/Failure.

function monitor(Actor akActor, Bool abMonitor = true)

Events Assocated with the monitoring an actor.

 

 

 

SendModEvent("ae_monitor", "add", akActor.GetFormID() as float)SendModEvent("ae_monitor", "clear", akActor.GetFormID() as float)

Monitored Actor is Ragdolling?

Parameters

  • Actor akActor: the actor to test.

Returns

  • Bool: Is/Is not ragdolling.

Bool function isRagdolling(Actor akActor)

Get Last Attacker on Monitored Actor

Parameters

  • Actor akActor: the actor to test.

Returns

  • ObjectReference: akAggressor returned by the OnHit event.

ObjectReference function GetLastAttacker(Actor akActor)

Get Mod Index By Name

Through the customOwner property you can access other mods functions by casting the ref to _ae_mod_base. e.g.:

 

 

 

(ae.customOwner[N] as _ae_mod_base).qualifyActor(kTarget, stat)

Parameters

  • String asName: The name of a registered owner of an event.

Returns

  • Int: The index of the named mod or -1 if not found.

Int function GetModIndexByName(String asName)

Register a callback to watch for actor events.

The block's associated with an event can be edited within MCM. A mod event can also be disabled.

Parameters

  • Quest akOwner: Any refid within the mod that's using the framework. It cannot evaluate to none when the save is loaded or the registration is removed. The scripting must extent "_ae_mod_base".
  • Int aiStatBlockHi: Valid range is 0-9 representing 0% to 99% in 10% increments. 100%+ remains clear so the 90% - 99% block can send a exit request when the actor is 100%
  • Int aiStatBlockLo: Valid range is 0-9. A registered event cannot span more than 4 10% blocks (inclusive)*.
    • 0 = Less than 10%
    • 1 = Greater than or equal to 10%, less than 20%
    • 2 = Greater than or equal to 20%, less than 30%
    • 3 = Greater than or equal to 30%, less than 40%
    • 4 = Greater than or equal to 40%, less than 50%
    • 5 = Greater than or equal to 50%, less than 60%
    • 6 = Greater than or equal to 60%, less than 70%
    • 7 = Greater than or equal to 70%, less than 80%
    • 8 = Greater than or equal to 80%, less than 90%
    • 9 = Greater than or equal to 90%, less than 100%

    [*]String asCallback: The custom ModEvent that will get sent.

    [*]String asStat: The actor value. Currently available are Health, Magicka, Stamina

Returns

  • Int: The registered callback's index.

* This may be increased but there must always be some uncovered range so the event can clear and allow other event to happen.

int function register(Quest akOwner, Int aiStatBlockHi, Int aiStatBlockLo, String asCallback, String asStat)

The format of the custom event:

akActor.SendModEvent(asCallback + "_start", asStat, akActor.GetActorValuePercentage(asStat))akActor.SendModEvent(asCallback + "_end", asStat, akActor.GetActorValuePercentage(asStat))

Events Assocated with the callback index.

Purge: sent when Actor Events cannot resolve the callback owner's RefID.

 

 

 

ae.SendModEvent("ae_update", "purge", idx as float)

Disable/Enable: Sent when the user enables/disables the callback in MCM.

ae.SendModEvent("ae_update", "disable", idx as float)ae.SendModEvent("ae_update", "enable", idx as float)

Remove: Sent when the player removes a mod event in MCM

ae.SendModEvent("ae_update", "remove", idx as float)

Unregisters a mod event

Parameters

  • Quest akOwner: The refid used to register.

Returns

  • Bool: Success/Failure.

bool function unRegister(Quest akOwner)

Animation Mod Events

This animation event is sent when the animation event "RemoveCharacterControllerFromWorld" is triggered. The actor is flagged as ragdolling by adding a hidden spell "ae_marker_ragdoll" with the effect keyword "ae_ragdoll". The actor must not already have the spell for the event to be sent.

 

 

 

kActor.SendModEvent("ae_anim_start", "ragdoll", Utility.GetCurrentRealTime())

This animation event is sent with the animation event "GetUpEnd" while the actor has the hidden spell "ae_marker_ragdoll". At that time the spell is removed allowing ragdoll events to be sent again.

kActor.SendModEvent("ae_anim_end", "ragdoll", Utility.GetCurrentRealTime())

Scripting

The event owner must be a quest now and extend the _ae_mod_base script. Within your quest script you must define the following functions.

 

Functions

 

 

Bool function qualifyActor(Actor akActor = none, String asStat = "")

This will be called during the mod selection process to see if the actor in question qualifies for your event. If this function returns false then your mod will be skipped. If it is not defined in your mod then your mod events will not be triggered.

function aeRegisterMod()

This may be called during AE's cleanup process. Possibly due to a refid change. It will reregister the mod with AE.

function aeUninstallMod()

This function will be called when the user permanently disables the mod through the AE MCM menu. It's suggested that you do not use this function as a method to reinstall/update the mod. Use this as an alternative for uninstalling your mod.

int function aeGetVersion()

This functions exactly as and has the same purpose as the SkyUI function GetVersion(). It returns the static version of the AE script.

function aeUpdate( int aiVersion )

This functions similarly and has the same purpose as the SkyUI OnVersionUpdate() event. Called when a version update of this script has been detected. The parameter aiVersion is the old version number of the script.

 

Properties

_ae_framework Property ae Auto

Required: This has to point to _ae_base

String Property myEvent Auto

Required: This is the base name for your mod's AE events

String Property myCallback Auto

Required: This is the base name for your mod's AE event callback

Actor[] Property myActorsList Auto

Required: This has to point to a form list containing actors your Mod monitors.

String[] Property publicModEvents Auto

Optional: This is registry of public mod events sent out by your mod. see: http://www.creationkit.com/RegisterForModEvent_-_Form

 

Aliases

Much like SkyUI, each AE quest runs maintenance code when the game is reloaded.

  • In the quest you created, select the Quest Aliases tab and add a new reference alias. Name it PlayerAlias.
  • For Fill Type, select the player reference (Specific Reference, Cell any, Ref PlayerRef).
  • In the Scripts list, add _ae_PlayerLoadGameAlias.


What's New in Version 2.22

Released

  • 2013.10.14 - minor bug fix
  • 2013.10.05 - script optimizations
  • 2013.10.04 - Minor update to make mod versioning consistent with SexLab
  • 2013.09.29 - Minimized scripting for modders. A lot of support scripting has been moved into _ae_mod_base.
  • 2013.09.29 - Major changes to improve updates of this mod as well as mod mod updates that depend on AE
  • 2013.09.28 - Minor Scripting tweaks
  • 2013.09.08 - Scripting tweaks
  • 2013.09.08 - Minor UI update


×
×
  • Create New...