RegisterForTrackedStatsEvent - ScriptObject

Member of: ScriptObject

Registers this active magic effect/alias/form to receive events when a specific tracked stat equals or surpasses a threshold. Once you receive the event, you will be unregistered (it's a one-shot event).

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

SyntaxEdit

Function RegisterForTrackedStatsEvent(string asStat, int aiThreshold) native

ParametersEdit

  • asStat - The tracked stat to watch
  • aiThreshold - The threshold the stat needs to equal or surpass before the event is sent

Return ValueEdit

None

ExamplesEdit

; Register to be notified when the player completes 10 or more quests
RegisterForTrackedStatsEvent("Quests Completed", 10)

NotesEdit

  • Once the event is sent, you will be unregistered
  • If the stat is already equal to or past the threshold, an event will be sent immediately
  • If you re-register for a stat, the old threshold value will be replaced, you will not get the event twice
  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

See AlsoEdit