Difference between revisions of "ActiveMagicEffect Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>DavidJCobb
(→‎SKSE Member Functions: GetMagnitude() isn't listed in SKSE's changelog, and doesn't exist in my install. I'm gonna go ahead and assume it doesn't exist. Shame -- it'd be bloody useful.)
imported>Egocarib
(Undo revision 43017 by DavidJCobb (This function does exist, take a look in ActiveMagicEffect.psc of the most recent SKSE archive. I believe it was added in SKSE 1.7.0))
Line 95: Line 95:
*Returns the Time Elapsed of the magic effect.
*Returns the Time Elapsed of the magic effect.


'''Float [[GetMagnitude() - ActiveMagicEffect|GetMagnitude]]()'''
*Return the magnitude of the active effect.
== Events ==
== Events ==
'''[[OnAnimationEvent - Form|OnAnimationEvent]](ObjectReference ''akSource'', String ''asEventName'')'''
'''[[OnAnimationEvent - Form|OnAnimationEvent]](ObjectReference ''akSource'', String ''asEventName'')'''

Revision as of 19:09, 9 October 2014

Extends: None

Script for the manipulation of active magic effects (MagicEffects currently attached to an Actor).

Note that in addition to the events defined below, ActiveMagicEffect scripts also receive events related to the actor to which they are attached. This makes them useful for adding script processing to actors dynamically without using quest aliases.

Definition

ScriptName ActiveMagicEffect Hidden


Member Functions

AddInventoryEventFilter(Form akFilter)

  • Adds an inventory event filter to this effect.

Dispel()

  • Dispels this active magic effect.

MagicEffect GetBaseObject()

  • Obtains the MagicEffect this active magic effect is based on.

Actor GetCasterActor()

  • Obtains the Actor that cast the spell this magic effect is from.

Actor GetTargetActor()

  • Obtains the Actor this active magic effect is applied to.

RegisterForAnimationEvent(ObjectReference akSender, String asEventName)

  • Registers this magic effect to receive the specified animation event from the specified object.

RegisterForLOS(Actor akViewer, ObjectReference akTarget)

  • Registers this magic effect to receive gain and lost LOS events between the viewer and the target.

RegisterForSingleLOSGain(Actor akViewer, ObjectReference akTarget)

  • Registers this magic effect to receive a single LOS gain event when the viewer sees the target.

RegisterForSingleLOSLost(Actor akViewer, ObjectReference akTarget)

  • Registers this magic effect to receive a single LOS lost event when the viewer loses sight of the target.

RegisterForSingleUpdate(Float afInterval)

  • Registers this magic effect to receive a single update event in the specified time.

RegisterForSingleUpdateGameTime(Float afInterval)

  • Registers this magic effect to receive a single update event in the specified number of game hours.

RegisterForSleep()

  • Registers this magic effect to receive sleep events for when the player goes to sleep or wakes up.

RegisterForTrackedStatsEvent()

  • Registers this magic effect to receive tracked stats events for when tracked stats are updated.

RegisterForUpdate(Float afInterval)

  • Registers this magic effect to receive update events with the specified interval, or changes the update interval.

RegisterForUpdateGameTime(Float afInterval)

  • Registers this magic effect to receive update events with the specified interval in game time hours, or changes the update interval.

RemoveAllInventoryEventFilters()

  • Remove all inventory event filters on this effect.

RemoveInventoryEventFilter(Form akFilter)

  • Remove a specific inventory event filter.

StartObjectProfiling()

  • Starts profiling all scripts attached to this magic effect.

StopObjectProfiling()

  • Stops profiling all scripts attached to this magic effect.

UnregisterForAnimationEvent(ObjectReference akSender, String asEventName)

  • Unregisters this magic effect from receiving the specified animation event from the specified object.

UnregisterForLOS(Actor akViewer, ObjectReference akTarget)

  • Unregisters this magic effect from any LOS events between the viewer and target.

UnregisterForSleep()

  • Unregisters this magic effect from sleep events.

UnregisterForTrackedStatsEvent()

  • Unregisters this magic effect from tracked stats events.

UnregisterForUpdate()

  • Unregisters this magic effect from update events.

UnregisterForUpdateGameTime()

  • Unregisters this magic effect from game time update events.


SKSE Member Functions

Float GetDuration()

  • Returns the Duration of the magic effect.

Float GetTimeElapsed()

  • Returns the Time Elapsed of the magic effect.

Float GetMagnitude()

  • Return the magnitude of the active effect.

Events

OnAnimationEvent(ObjectReference akSource, String asEventName)

  • Received when one of animation events we are listening for is recieved.

OnAnimationEventUnregistered(ObjectReference akSource, String asEventName)

  • Received when one of the animation events we are listening for has been automatically unregistered by the game due to the target animation graph unloading.

OnEffectStart(Actor akTarget, Actor akCaster)

  • Event received when this effect starts

OnEffectFinish(Actor akTarget, Actor akCaster)

  • Event received when this effect has finished

OnGainLOS(Actor akViewer, ObjectReference akTarget)

  • Received when the viewer goes from not seeing the target to seeing the target - if this magic effect is registered.

OnLostLOS(Actor akViewer, ObjectReference akTarget)

  • Received when the viewer goes from seeing the target to not seeing the target - if this magic effect is registered.

OnSleepStart(Float afSleepStartTime, Float afDesiredSleepEndTime)

  • Received when the player goes to sleep.

OnSleepStop(Bool abInterrupted)

  • Received when the player wakes up or is interrupted in sleep.

OnTrackedStatsEvent(String asStat, Int aiStatValue)

  • Received when tracked stats are updated.

OnUpdate()

  • Received at periodic intervals, if the magic effect is registered.

OnUpdateGameTime()

  • Received at periodic intervals of game time, if the magic effect is registered.


Notes

  • ActiveMagicEffects will also receive events from the Actor they are attached to.