Skip to main content

Introduction

This component inherits from NPCStats and adds classes, race, background and level to an object. It provides access to Stats, Attributes, Status Conditions, Stat Events, Status Effects, Languages, Respawn, Race, Classes, Level, Background, and Plugins.

"Player Character Stats"

Fields#

NameDescription
Select Option UIPrefab used for selectioning Add-On Choices
On Class AddedEvent raised when a Class is added
On Class RemovedEvent raised when a Class is removed
On Classes ChangedEvent raised when a Class is added or a Class' level changes
On Level ChangedEvent raised when the player's level changes
On Race ChangedEvent raised when the Race is changed
On Background ChangedEvent raice when the Background is changed
On Perk AddedEvent raised when a Perk is added
On Perk RemovedEvent raised when a Perk is removed
On Perks ChangedEvent raised when a Perk is added or removed
On Trait AddedEvent raised when a Trait is added
On Trait RemovedEvent raised when a Trait is removed
New Choice WaitingEvent raised when a new choice is waiting for manual selection
Respawn TransformObject to modify position and rotation on respawn
Respawn ConditionCondition that must be true to trigger respawn
Save PositionAdd position when saving stats
Save RotationAdd rotation when saving stats
Respawn ModifiersStat Modifiers to apply on a respawn
Save FilenameFilename to load on respawn, if blank no load is triggered
On RespawnEvent raised when object respawns
On Languages ChangedEvent raised when a Language is added or removed
On Language AddedEvent raised when a Language is added
On Language RemovedEvent raised when a Language is removed
On Effect AddedEvent raised when a Status Effect is added
On Effect RemovedEvent raised when a Status Effect is removed
On Resistance AddedEvent raised when a Status Effect Resistance is added
On Resistance RemovedEvent raised when a Status Effect Resistance is removed
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
awaitingChoicesList of choices awaiting user selection
backgroundGets/Sets the Bacground for the object
classesReturns a read-only list of Classes assigned to the object
levelIdReturns the id of the stat associate with leveling
perksReturns a read-only list of Perks assigned to the object
preventLevelGainGets/Sets whether to suspend Level Gaining. When changing from false to true any and all Levels that were suspended will be added in sequence.
raceGets/Sets the Race for the object
startingBackgroundIdReturns the starting background id
startingClassIdReturns the starting class id
startingRaceIdReturns the starting race id
traitsReturns a read-only list of Traits assigned to the object
languagesReturns a read-only list of languages known to object
activeEffectsReturns a read-only list of Status Effects currently active on this object.
resistancesReturns a read-only list of Status Effects currently active on this object.
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
AddAddOnPluginsAdds one or more Add-On Plugin
AddClassAdds a Class to the object. If that Class already exists its level is increased by 1.
AddPerkAdds a Perk to the object
AddTraitAdd a Trait to the object
DataLoadLoads data to a specified stream
DataLoadJSONLoad data from JSON string
DataLoadJSONFileLoad JSON data from file
DataSaveSaves data to a specified file
DataSaveJSONSave data as a JSON string
GetCharacterLevelReturns the current Character level
GetClassGet a Class available on this object by id
GetClassLevelGet the level of a Class available on this object by id
GrantCustomRewardGrants player a custom reward
HasClassCheck if object has a specific Class
HasPerkCheck if object has a specific Perk
InitializeInitialize the object. This is done automatically on Awake.
IsRaceCheck if object is a specific Race
JSONExportExport selected data to JSON
JSONImportImport JSON data
RemoveAddOnsFromSourceRemove all Add-Ons from a specific source
ProcessAwaitingAddonRemove a choice from the awaiting list
RemoveClassRemove a Class from object
RemovePerkRemove a Perk from the object
RemovePerkFromSourceRemove all Perks from a specific source
RemoveSourceRemove a IUniquelyIdentifiable source
RemoveTraitsFromSourceRemove all Traits from a specific source
SetBackgroundSet the Background of this object
SetCreationClassSets the 'Character Creation' class for player, removing all other classes
SetRaceSet the Race of this object
ShutdownShutdown the system
SubscribeToClassChangeSubscribe to Class changes
UnsubscribeFromClassChangeRemove subscription from Class changes
AddLanguageAdd an Attribute to the object.
KnowsLanguageTrue if object has a Language with the provided id.
RemoveLanguageRemoves a language by id
RemoveLanguagesFromSourceRemove all languages from a specified source
SubscribeToLanguageChangeSubscribe to Language changes
UnsubscribeFromLanguageChangeRemove subscription from Language changes
AddEffectAdds a Status Effect to the object by id.
AddEffectResistanceAdds a Status Effect Resistance to the object by id.
GetModifierGet a Stat Modifier by instance id
RemoveEffectRemoves an effect from the object by id.
RemoveEffectResistanceRemoves all Status Effect Resistance by id
RemoveEffectResistancesFromSourceRemove all Status Effect Resistance from a specified source
SubscribeToEffectEventsSubscribes to Status Effect events.
UnsubscribeFromEffectEventsUnsubscribes from Status Effect events.
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.
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
IsConditionTrueCheck if an expression resolves to true.
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
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
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