Skip to main content

FB2TraitComponent

Overview

  • Component that manages traits (personality traits).

Metadata

FieldValue
Kindcomponent
EnvironmentB2 - Simulation
Categorycomponents
ExtendsFB2Component
Requirerequire('Components.B2TraitComponent')

Properties (9)

NameTypeDescription
AccumulatedTriggerCountMaptable<string, integer>Per-trait AccumulatedTrigger counter (saved/loaded). Key: TraitId.
AccumulatedTriggerTimeMaptable<string, integer>Per-trait last AccumulatedTrigger time (saved/loaded). Key: TraitId.
Aptitudesstring[]
CachedPersonalityIdstring
Characteristicsstring[]
CrowdGroupIdstringId 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.
TraitForHopeIdstring
TraitIdListstring[]
UnreadAptitudeIdsstring[]

Functions (32)

FunctionParametersReturnsDescription
AddTraitInTraitId: string-Adds Trait.
AddTraitByTableRowInTraitTableRow: FB1TraitTableRow-Adds Trait By Table Row.
AddTraitListInTraitNameList: string[], bAddPreference: boolean-Adds Trait List.
ChangeContentSlotNumInGrowthStep: EB1GrowthStep-GrowthChangeInterface Begin
ExecuteTraitEntryTriggeredInCheckType: EB1TraitEntryType-
FilterContentDataInGrowthStep: EB1GrowthStep-
GetAccumulatedTriggerCountInTraitId: stringintegerReturns Accumulated Trigger Count.
GetAccumulatedTriggerTimeInTraitId: stringintegerReturns Accumulated Trigger Time.
GetAptitudesInOutAptitudes: string[]booleanReturns Aptitudes.
GetCharacteristicsInOutCharacteristics: string[]booleanReturns Characteristics.
GetCrowdGroupId-stringReturns Crowd Group Id.
GetDefaultCityMoveDataPolicy-EB1CityMoveDataPolicyReturns Default City Move Data Policy.
GetPersonalityIdPersonalityId: stringbooleanReturns Personality Id.
GetTraitNum-integerReturns Trait Num.
GetUnreadAptitudesInOutUnreadAptitudeIds: string[]booleanReturns Unread Aptitudes.
HasTraitInTraitId: stringbooleanReturns whether it has Trait.
MarkAptitudesReadInReadAptitudeIds: string[]-
OnTraitEventTriggeredInTriggerData: FB1TraitEventData-Callback invoked on Trait Event Triggered.
PrecheckTraitEntryTriggeredInCheckType: EB1TraitEntryType, InCompletedBagId: string, InCompletedInteractionId: string-Pre-checks the TriggeredBuff condition before an interaction finishes.
RemoveTraitInTraitId: string-Removes Trait.
ReplaceContentDataInPrevGrowthStep: EB1GrowthStep, InCurrGrowthStep: EB1GrowthStep-
ReplaceTraitInOldTraitId: string, InNewTraitId: string-
ResetCrowdGroupId--Resets Crowd Group Id.
ResetTrait--Resets Trait.
ResetTraitForHopeInTraitId: string-Resets Trait For Hope.
SetAccumulatedTriggerCountInTraitId: string, InCount: integer-Sets Accumulated Trigger Count.
SetAccumulatedTriggerTimeInTraitId: string, InTime: integer-Sets Accumulated Trigger Time.
SetCharacteristicsInCharacteristics: string[]-Sets Characteristics.
SetCrowdGroupIdInGroupId: string-Sets Crowd Group Id.
SetPersonalityAndCharacteristicsInPersonalityId: string, InCharacteristics: string[]EB2TraitChangeResultSets Personality And Characteristics.
SetTraitForHopeInTraitId: string-Sets Trait For Hope.
ShouldUseScheduler-booleanReturns whether it should Use Scheduler.

Override points (14)

Implement these in Lua as FB2TraitComponent.Override_Name = function(...) end.

FunctionParametersReturnsDescription
Override_AddTraitInTraitId: string-Adds Trait.
Override_AddTraitListInTraitNameList: string[], bAddPreference: boolean-Adds Trait List.
Override_ChangeContentSlotNumInGrowthStep: EB1GrowthStep-GrowthChangeInterface Begin
Override_ExecuteTraitEntryTriggeredInCheckType: EB1TraitEntryType-
Override_FilterContentDataInGrowthStep: EB1GrowthStep-
Override_HasTraitInTraitId: stringbooleanReturns whether it has Trait.
Override_MarkAptitudesReadInReadAptitudeIds: string[]-
Override_OnTraitEventTriggeredInTriggerData: FB1TraitEventData-Callback invoked on Trait Event Triggered.
Override_PrecheckTraitEntryTriggeredInCheckType: EB1TraitEntryType, InCompletedBagId: string, InCompletedInteractionId: string-Pre-checks the TriggeredBuff condition before an interaction finishes.
Override_RemoveTraitInTraitId: string-Removes Trait.
Override_ReplaceContentDataInPrevGrowthStep: EB1GrowthStep, InCurrGrowthStep: EB1GrowthStep-
Override_ReplaceTraitInOldTraitId: string, InNewTraitId: string-
Override_ResetTrait--Resets Trait.
Override_ResetTraitForHopeInTraitId: string-Resets Trait For Hope.