OnTrackedStatsEvent - ScriptObject

From the Fallout4 CreationKit Wiki
Revision as of 12:15, 10 June 2015 by imported>Plplecuyer
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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[edit | edit source]

Event OnTrackedStatsEvent(string asStat, int aiStatValue)

Parameters[edit | edit source]

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

Example[edit | edit source]

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

  • 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]