Background for Skyrim SE
Member of the Form script
eventOnTrackedStatsEvent(stringarStatName, intaiStatValue)

Description

Wiki Description

Event called when tracked stats are updated - if this active magic effect/alias/form is registered for it.

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.

  • This event is not relayed to any aliases or magic effects attached to the form.

  • Not all of Tracked Stats trigger this event. Below is the list of stats that do:

    • Locations Discovered
    • Dungeons Cleared
    • Most Gold Carried
    • Skill Increases
    • Skill Books Read
    • Quests Completed
    • Misc Objectives Completed
    • Dragon Souls Collected
    • Words Of Power Learned
    • Shouts Learned
    • Shouts Mastered
    • Magic Items Made
    • Weapons Made
    • Armor Made
    • Locks Picked
    • Pockets Picked
    • Eastmarch Bounty
    • Falkreath Bounty
    • Haafingar Bounty
    • Hjaalmarch Bounty
    • The Pale Bounty
    • The Reach Bounty
    • The Rift Bounty
    • Tribal Orcs Bounty
    • Whiterun Bounty
    • Winterhold Bounty
    • Level Increases

Parameters

stringarStatName

CK Wiki Description

The updated value of the stat.

intaiStatValue


Examples

Function SomeFunction()
  RegisterForTrackedStatsEvent() ; Before we can use OnTrackedStatsEvent we must register.
EndFunction

Event OnTrackedStatsEvent(string asStatFilter, int aiStatValue)
    if (asStatFilter == "Barters")
        if (aiStatValue == 50)
        Debug.Trace("Player has bartered 50 times.")
        endif
    endif
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends Form

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 Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.