Background for Fallout 4
Member of the ScriptObject script
voidfunctionRegisterForTrackedStatsEvent(stringasStat, intaiThreshold)Native

Description

Wiki Description

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.

Documentation Comment

Registers this script to receive a single-shot stat event when the stat meets or passes the threshold
If the stat already meets or passes the threshold the event will be sent immediately


Caveats

CK Wiki - Notes

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

Parameters

  1. stringasStat

    CK Wiki Description

    //falloutck.uesp.net/wiki/List_Of_Tracked_Stats "List Of Tracked Stats") to watch

  2. intaiThreshold


Examples

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

Auto-Generated Example

string myString__asStat
int myInt__aiThreshold

myScriptObject__toCallFunctionOn.RegisterForTrackedStatsEvent(myString__asStat, myInt__aiThreshold)

Related Pages


Additional References

View this function’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.