Background for Fallout 4
Member of the ScriptObject script
eventOnTrackedStatsEvent(stringarStatName, intaiStatValue)

Description

Wiki Description

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.

Documentation Comment

Event received when a tracked stat is updated for the player


Caveats

CK Wiki - Notes

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

Parameters

  1. stringarStatName

    CK Wiki Description

    The updated value of the stat.

  2. intaiStatValue


Examples

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

Auto-Generated Example

Scriptname MyCoolScript extends ScriptObject

event OnTrackedStatsEvent(string arStatName, int aiStatValue)
    Debug.trace("Event received - OnTrackedStatsEvent: arStatName = " + arStatName + " aiStatValue = " + aiStatValue)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.