Skip to main content

FB2MemoryComponent

Overview

  • Component that manages memories.

Metadata

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

Properties (5)

NameTypeDescription
LastReadMemoryListTimeinteger
Milestonestable<string, FB1Milestone>Milestones.
SocialContextTabletable<FB1EntityId, FB1SocialContext>Map of FB1SocialContext per EntityId.
TalkingInteractionBagstring
bIsTalkingFinishedboolean

Functions (29)

FunctionParametersReturnsDescription
AddMemoryMemoryDtId: string, TargetEntityId: FB1EntityId-Adds Memory.
AddMemoryFromRelationshipRecordIdTargetEntityId: FB1EntityId, RelationshipRecordId: string-Looks up the memory id via B1MemoryUtil::GetMemoryIdByRelationshipRecordId from a RelationshipRecordId, then adds the memory to the Owner (TargetEntityId is the relationship partner).
AddMilestoneInMilestoneId: string, InTargetEntityId: FB1EntityId, InTargetDtId: string-Adds Milestone.
ClearAllSocialContexts--Removes all of my SocialContexts and also removes my memory from the B2MemoryComponent of target entities.
GetDefaultCityMoveDataPolicy-EB1CityMoveDataPolicyReturns Default City Move Data Policy.
GetHiddenMilestoneIds-table<string, boolean>Returns the list of milestone IDs whose ConditionId condition is not met.
GetMilestones-table<string, FB1Milestone>Returns Milestones.
GetSocialContextTargetEntityId: FB1EntityIdFB1SocialContextLooks up the SocialContext by TargetEntityId and returns an FB1SocialContext pointer.
GetTalkSocialContextEntityId: FB1EntityId, OutTalkSocialContext: FB1TalkSocialContext-Takes an EntityId and an FB1TalkSocialContext and sets its values.
GetUnreadMemoryCount-integerReturns the number of unread memories based on LastReadMemoryListTime.
HasMemoryMemoryDtId: stringbooleanReturns whether a SocialContext with the given MemoryDtId exists.
HasMemoryWithTargetMemoryDtId: string, TargetEntityId: FB1EntityIdbooleanReturns whether the LatestContextMemory in the SocialContext with a specific TargetEntityId matches MemoryDtId.
HasMilestoneMilestoneId: stringbooleanReturns whether it has Milestone.
IsActiveTalkRefusedMemoryInEntityId: FB1EntityIdbooleanReturns whether a SocialContext with MoodScore below 0 is in the Active state.
IsBoostedTargetEntityId: FB1EntityIdbooleanReturns whether Boosted Target.
IsTalkRefusedInEntityId: FB1EntityIdbooleanReturns whether talk is refused, by probability, when the SocialContext MoodScore is below 0.
MakeCompactTargetMemoryListOutCompactMemories: FB1CompactTargetMemory[]-Builds and returns an FB1CompactTargetMemory array from SocialContext.
MakeSocialContextPacketDataOutSocialContexts: FB1TargetMemory[]-Loops over all SocialContexts and returns the Active ones as an FB1TargetMemory array.
OnAcquiredMilestoneMilestoneId: string, TargetEntityId: FB1EntityId, TargetDtId: string-Callback invoked on Acquired Milestone.
OnAddedTargetSocialContextStateTargetEntityId: FB1EntityId, TargetMoodScore: number, MemoryDtId: string, bIsActivated: boolean-Updates the SocialContext state for a TargetEntityId according to TargetMoodScore.
OnHourChangedBefore: FDateTime, After: FDateTime-Callback invoked on Hour Changed.
OnInteractionFinishedInteractionId: string, TargetEntityId: FB1EntityId, InteractionTags: string[]-Callback invoked on Interaction Finished.
OnInteractionSequenceFinishedInteractionBagId: string, CoopId: string, TargetEntityId: FB1EntityId-Callback invoked on Interaction Sequence Finished.
OnMinuteChangedBefore: FDateTime, After: FDateTime-Callback invoked on Minute Changed.
OnTalkSequenceFinishedInteractionBagId: string-Callback invoked on Talk Sequence Finished.
ReadMilestonesInMilestoneIdList: string[]-
RemoveSocialContextTargetEntityId: FB1EntityId-Removes the SocialContext for a specific entity.
SolveSocialContextbIsExpired: boolean, TargetEntityId: FB1EntityId-Changes a SocialContext to the resolved state.
UpdateReadMemoryListTime--Updates Read Memory List Time.

Override points (18)

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

FunctionParametersReturnsDescription
Override_AddMemoryMemoryDtId: string, TargetEntityId: FB1EntityId-Adds Memory.
Override_AddMemoryFromRelationshipRecordIdTargetEntityId: FB1EntityId, RelationshipRecordId: string-Looks up the memory id via B1MemoryUtil::GetMemoryIdByRelationshipRecordId from a RelationshipRecordId, then adds the memory to the Owner (TargetEntityId is the relationship partner).
Override_AddMilestoneInMilestoneId: string, InTargetEntityId: FB1EntityId, InTargetDtId: string-Adds Milestone.
Override_ClearAllSocialContexts--Removes all of my SocialContexts and also removes my memory from the B2MemoryComponent of target entities.
Override_HasMemoryMemoryDtId: stringbooleanReturns whether a SocialContext with the given MemoryDtId exists.
Override_HasMemoryWithTargetMemoryDtId: string, TargetEntityId: FB1EntityIdbooleanReturns whether the LatestContextMemory in the SocialContext with a specific TargetEntityId matches MemoryDtId.
Override_HasMilestoneMilestoneId: stringbooleanReturns whether it has Milestone.
Override_OnAcquiredMilestoneMilestoneId: string, TargetEntityId: FB1EntityId, TargetDtId: string-Callback invoked on Acquired Milestone.
Override_OnAddedTargetSocialContextStateTargetEntityId: FB1EntityId, TargetMoodScore: number, MemoryDtId: string, bIsActivated: boolean-Updates the SocialContext state for a TargetEntityId according to TargetMoodScore.
Override_OnHourChangedBefore: FDateTime, After: FDateTime-Callback invoked on Hour Changed.
Override_OnInteractionFinishedInteractionId: string, TargetEntityId: FB1EntityId, InteractionTags: string[]-Callback invoked on Interaction Finished.
Override_OnInteractionSequenceFinishedInteractionBagId: string, CoopId: string, TargetEntityId: FB1EntityId-Callback invoked on Interaction Sequence Finished.
Override_OnMinuteChangedBefore: FDateTime, After: FDateTime-Callback invoked on Minute Changed.
Override_OnTalkSequenceFinishedInteractionBagId: string-Callback invoked on Talk Sequence Finished.
Override_ReadMilestonesInMilestoneIdList: string[]-
Override_RemoveSocialContextTargetEntityId: FB1EntityId-Removes the SocialContext for a specific entity.
Override_SolveSocialContextbIsExpired: boolean, TargetEntityId: FB1EntityId-Changes a SocialContext to the resolved state.
Override_UpdateReadMemoryListTime--Updates Read Memory List Time.