Skip to main content

Introduction

This component adds basic stats to an object. It provides access to Stats, Attributes, Status Conditions, Stat Events, and Plugins.

"Basic Stats"

Fields#

NameDescription
Broadcast MessagesBroadcast message to 'GDTK_STATS' channel
PluginsList of plugins to run in sequence
On Stats ReloadedEvent raised when Stats are reloaded
On InitializedEvent raised when Stats is initialized
On ShutdownEvent raised when Stats is initialized
On Event TriggeredEvent raised when a Stat Event is triggered
On Attribute AddedEvent raised when an Attribute is added
On Attribute RemovedEvent raised when an Attribute is removed
On Status Condition AddedEvent raised when a Status Condition is added
On Status Condition RemovedEvent raised when a Status Condition is removed
On Focus AddedEvent raised when Focus is added
On Focus RemovedEvent raised when Focus is removed
On Focuses ChangedEvent raised when Focuses change
On HeartbeatEvent raised every Update
On Token HeartbeatEvent raised when a Token Heartbeat is invoked
On Display Name ChangedEvent raised when Display Name changes
On Color ChangedEvent raised when Color changes

Properties#

NameDescription
actorGets reference to the associated actor
attributesReturns a read-only list of Attributes on the object.
blackboardReturns the blackboard for the object
busyTrue if the system is currently loading or saving data.
colorColor associated with this object
focusesReturns a read-only list of Foceses assigned to the object
databaseReturns a reference to the Stats Database in the scene.
displayNameName of the creature or object attached
globalStatsReturns a reference to the Global Stats in the scene.
initializedTrue if object has been initialized.
registeredSourcesReturns a list of registered IUniquelyIdentifiable sources.
sourceReturns base StatSource
startingAttributeIdsReturns list of starting attribute ids
startingConditionIdsReturns list of starting status condition ids
statsReturns a list of initialized stats.
statusConditionsReturns a read-only list of initialized Status Conditions.

Methods#

NameDescription
AddAttributeAdd an Attribute to the object.
AddFocusAdds a Focus to the object. If that Focus already exists its level is increased by 1.
AddStatAdds a new Stat to the object. Cannot be done while object is initialized.
AddStatModifierAdds a new Stat Modifier to the object.
AddStatusConditionAdds a Status Condition to the object.
ClearSourcesRemoves all Identifiable Sources. Cannot be done while initialized.
ClearStatsRemoves all Stats. Cannot be done while initialized.
DataLoadLoads data from a specified file
DataLoadJSONLoad data from JSON string
DataLoadJSONFileLoad JSON data from file
DataSaveSaves data to a specified file
DataSaveJSONSave data as a JSON string
GetFocusGet a Focus available on this object by id
GetFocusLevelGet the level of a Focus available on this object by id
GetPluginGet a plugin of a specific tyep
GetSourceReturns an Identifiable Source by id
GetStatGet a Stat by id.
GetValueGet the value of a formula/expression.
GetValueWithDictionaryGet the value of a formula/expression.
HasAttributeTrue if object has an Attribute with the provided id.
HasFocusCheck if object has a specific Focus
HasFocusesCheck if object has a list Focuses
InitializeInitialize the object. This is done automatically on Awake.
IsConditionTrueCheck if an expression resolves to true.
JSONExportExport all data to JSON
JSONImportImport JSON data
RaiseEventRaises a Stat Event by id
RaiseTokenHeartbeatRaises a Token Heartbeat
RefreshActorAttempt to find actor for component
RegisterSourceManually add an IUniquelyIdentifiable source
RemoveAttributeRemove an Attribute by id
RemoveAttributesFromSourceRemove all Attributes from a specified source
RemoveFocusRemove a Focus from object
RemoveFocusesFromSourceRemove all Focuses from a specified source
RemoveSourceRemove a IUniquelyIdentifiable source
RemoveStatModifierRemove a Stat Modifier
RemoveStatModifiersFromSourceRemove all Stat Modifiers from a specified source
RemoveStatusConditionRemove a Status Condition by Id
RemoveStatusConditionsFromSourceRemove all Status Conditions from a specified source
ShutdownShutdown the system
SubscribeToAttributeChangeSubscribe to Attribute changes
SubscribeToEventTriggersSubscribe to Stat Events
SubscribeToFocusChangeSubscribe to Focus changes
SubscribeToHeartbeatSubscribe to Heartbeats
SubscribeToTokenHeartbeatSubscribe to Token Heartbeats
UnsubscribeFromAttributeChangeRemove subscription from Attribute changes
UnsubscribeFromEventTriggersRemove subscription from Stat Events
UnsubscribeFromFocusChangeRemove subscription from Focus changes
UnsubscribeFromHeartbeatRemove subscription from Heartbeats
UnsubscribeFromTokenHeartbeatRemove subscription from TokenHeartbeats