RegisterForTrackedStatsEvent - ScriptObject

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

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.

Syntax[edit | edit source]

Function RegisterForTrackedStatsEvent(string asStat, int aiThreshold) native

Parameters[edit | edit source]

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

Return Value[edit | edit source]

None

Examples[edit | edit source]

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

Notes[edit | edit source]

  • 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 Also[edit | edit source]