OnTrackedStatsEvent - ScriptObject

From Creation Kit
Jump to: navigation, search

Member of: ScriptObject

Event called when a registered tracked stat equals or surpasses a threshold - if this active magic effect/alias/form is registered for it. Once you receive the event you will be unregistered. (It is a one-shot event)

This event will only be sent to the specific script that registered for it. Other scripts attached to the same form/alias/active magic effect will not receive the event unless they also register.

Syntax

Event OnTrackedStatsEvent(string asStat, int aiStatValue)

Parameters

  • asStat: The text for the stat being updated. List Of Tracked Stats
  • aiStatValue: The updated value of the stat.

Example

Function SomeFunction()
  RegisterForTrackedStatsEvent("Barters", 50) ; Before we can use OnTrackedStatsEvent we must register.
EndFunction
 
Event OnTrackedStatsEvent(string asStatFilter, int aiStatValue)
    if (asStatFilter == "Barters")
	Debug.Trace("Player has bartered 50 or more times.")
    endif
endEvent

Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

See Also