FB2TraitComponent
Overview
- Component that manages traits (personality traits).
Metadata
| Field | Value |
|---|---|
| Kind | component |
| Environment | B2 - Simulation |
| Category | components |
| Extends | FB2Component |
| Require | require('Components.B2TraitComponent') |
Properties (9)
| Name | Type | Description |
|---|---|---|
AccumulatedTriggerCountMap | table<string, integer> | Per-trait AccumulatedTrigger counter (saved/loaded). Key: TraitId. |
AccumulatedTriggerTimeMap | table<string, integer> | Per-trait last AccumulatedTrigger time (saved/loaded). Key: TraitId. |
Aptitudes | string[] | |
CachedPersonalityId | string | |
Characteristics | string[] | |
CrowdGroupId | string | Id of the group the character belongs to while existing as a crowd member. Reset when changed to a SiteRoleNpc/CompanyRoleNpc group, and re-set when returning to the Crowd group. |
TraitForHopeId | string | |
TraitIdList | string[] | |
UnreadAptitudeIds | string[] |
Functions (32)
| Function | Parameters | Returns | Description |
|---|---|---|---|
AddTrait | InTraitId: string | - | Adds Trait. |
AddTraitByTableRow | InTraitTableRow: FB1TraitTableRow | - | Adds Trait By Table Row. |
AddTraitList | InTraitNameList: string[], bAddPreference: boolean | - | Adds Trait List. |
ChangeContentSlotNum | InGrowthStep: EB1GrowthStep | - | GrowthChangeInterface Begin |
ExecuteTraitEntryTriggered | InCheckType: EB1TraitEntryType | - | |
FilterContentData | InGrowthStep: EB1GrowthStep | - | |
GetAccumulatedTriggerCount | InTraitId: string | integer | Returns Accumulated Trigger Count. |
GetAccumulatedTriggerTime | InTraitId: string | integer | Returns Accumulated Trigger Time. |
GetAptitudes | InOutAptitudes: string[] | boolean | Returns Aptitudes. |
GetCharacteristics | InOutCharacteristics: string[] | boolean | Returns Characteristics. |
GetCrowdGroupId | - | string | Returns Crowd Group Id. |
GetDefaultCityMoveDataPolicy | - | EB1CityMoveDataPolicy | Returns Default City Move Data Policy. |
GetPersonalityId | PersonalityId: string | boolean | Returns Personality Id. |
GetTraitNum | - | integer | Returns Trait Num. |
GetUnreadAptitudes | InOutUnreadAptitudeIds: string[] | boolean | Returns Unread Aptitudes. |
HasTrait | InTraitId: string | boolean | Returns whether it has Trait. |
MarkAptitudesRead | InReadAptitudeIds: string[] | - | |
OnTraitEventTriggered | InTriggerData: FB1TraitEventData | - | Callback invoked on Trait Event Triggered. |
PrecheckTraitEntryTriggered | InCheckType: EB1TraitEntryType, InCompletedBagId: string, InCompletedInteractionId: string | - | Pre-checks the TriggeredBuff condition before an interaction finishes. |
RemoveTrait | InTraitId: string | - | Removes Trait. |
ReplaceContentData | InPrevGrowthStep: EB1GrowthStep, InCurrGrowthStep: EB1GrowthStep | - | |
ReplaceTrait | InOldTraitId: string, InNewTraitId: string | - | |
ResetCrowdGroupId | - | - | Resets Crowd Group Id. |
ResetTrait | - | - | Resets Trait. |
ResetTraitForHope | InTraitId: string | - | Resets Trait For Hope. |
SetAccumulatedTriggerCount | InTraitId: string, InCount: integer | - | Sets Accumulated Trigger Count. |
SetAccumulatedTriggerTime | InTraitId: string, InTime: integer | - | Sets Accumulated Trigger Time. |
SetCharacteristics | InCharacteristics: string[] | - | Sets Characteristics. |
SetCrowdGroupId | InGroupId: string | - | Sets Crowd Group Id. |
SetPersonalityAndCharacteristics | InPersonalityId: string, InCharacteristics: string[] | EB2TraitChangeResult | Sets Personality And Characteristics. |
SetTraitForHope | InTraitId: string | - | Sets Trait For Hope. |
ShouldUseScheduler | - | boolean | Returns whether it should Use Scheduler. |
Override points (14)
Implement these in Lua as FB2TraitComponent.Override_Name = function(...) end.
| Function | Parameters | Returns | Description |
|---|---|---|---|
Override_AddTrait | InTraitId: string | - | Adds Trait. |
Override_AddTraitList | InTraitNameList: string[], bAddPreference: boolean | - | Adds Trait List. |
Override_ChangeContentSlotNum | InGrowthStep: EB1GrowthStep | - | GrowthChangeInterface Begin |
Override_ExecuteTraitEntryTriggered | InCheckType: EB1TraitEntryType | - | |
Override_FilterContentData | InGrowthStep: EB1GrowthStep | - | |
Override_HasTrait | InTraitId: string | boolean | Returns whether it has Trait. |
Override_MarkAptitudesRead | InReadAptitudeIds: string[] | - | |
Override_OnTraitEventTriggered | InTriggerData: FB1TraitEventData | - | Callback invoked on Trait Event Triggered. |
Override_PrecheckTraitEntryTriggered | InCheckType: EB1TraitEntryType, InCompletedBagId: string, InCompletedInteractionId: string | - | Pre-checks the TriggeredBuff condition before an interaction finishes. |
Override_RemoveTrait | InTraitId: string | - | Removes Trait. |
Override_ReplaceContentData | InPrevGrowthStep: EB1GrowthStep, InCurrGrowthStep: EB1GrowthStep | - | |
Override_ReplaceTrait | InOldTraitId: string, InNewTraitId: string | - | |
Override_ResetTrait | - | - | Resets Trait. |
Override_ResetTraitForHope | InTraitId: string | - | Resets Trait For Hope. |