StatsSystem
classnative name gameStatsSystemnativeimportOnly
extends IStatsSystem › IGameSystem › IScriptable › ISerializable
StatsSystem in scripts: an object's stats, such as level and attributes. Get it with GameInstance.GetStatsSystem(gameInstance).
Methods 28
native func AddModifier(objID: StatsObjectID, modifierData: ref<gameStatModifierData>) -> Bool
native func AddModifiers(objID: StatsObjectID, modifierData: array<ref<gameStatModifierData>>) -> Bool
native func AddSavedModifier(objID: StatsObjectID, modifierData: ref<gameStatModifierData>) -> Bool
native func ApplyModifierGroup(objID: StatsObjectID, groupID: Uint64) -> Bool
native func CalculateModifierListValue(objID: StatsObjectID, modifierData: array<wref<StatModifier_Record>>) -> Float
native func DefineModifierGroupFromRecord(groupID: Uint64, recordID: TweakDBID) -> Bool
native func ForceModifier(objID: StatsObjectID, modifierData: ref<gameStatModifierData>) -> Bool
native func GetDamageRecordFromId(damageTypeRecordId: TweakDBID) -> wref<DamageType_Record>
native func GetDamageRecordFromType(damageType: gamedataDamageType) -> wref<DamageType_Record>
native func GetDamageRecordId(damageType: gamedataDamageType) -> TweakDBID
native func GetDamageType(statType: gamedataStatType) -> gamedataDamageType
native func GetDamageTypeByRecordID(damageTypeRecordId: TweakDBID) -> gamedataDamageType
native func GetSortedStatsThemes(objID: StatsObjectID, out outThemes: array<CName>)
native const func GetStatBoolValue(objID: StatsObjectID, statType: gamedataStatType) -> Bool
native func GetStatDetails(objID: StatsObjectID) -> array<gameStatDetailedData>
native func GetStatType(damageType: gamedataDamageType) -> gamedataStatType
native const func GetStatValue(objID: StatsObjectID, statType: gamedataStatType) -> Float
A stat's current value. Tested in game on 2.31 (2026-10-12) for V's Level, against the character screen: O6b test.
const stats = await api.GameInstance.GetStatsSystem(game.instance);
const level = await stats.GetStatValue(statsId, 'Level');
native const func GetStatValueFromDamageType(objId: StatsObjectID, damageType: gamedataDamageType) -> Float
native func RegisterListener(objID: StatsObjectID, listener: ref<IStatsListener>)
native func RemoveAllModifiers(objID: StatsObjectID, statType: gamedataStatType, opt removeSavedModifiers: Bool) -> Bool
native func RemoveAndUncacheModifier(objID: StatsObjectID, modifierData: ref<gameStatModifierData>) -> Bool
native func RemoveModifier(objID: StatsObjectID, modifierData: ref<gameStatModifierData>) -> Bool
native func RemoveModifierGroup(objID: StatsObjectID, groupID: Uint64) -> Bool
native func RemoveSavedModifiers(objID: StatsObjectID, statType: gamedataStatType) -> Bool
native func UncacheModifier(modifierData: ref<gameStatModifierData>) -> Bool
native func UndefineModifierGroup(groupID: Uint64) -> Bool
native func UnforceStat(objID: StatsObjectID, statType: gamedataStatType) -> Bool
native func UnregisterListener(objID: StatsObjectID, listener: ref<IStatsListener>)