Skip to main content

FB2CareerComponent

Overview

  • Career component - manages per-Zoi career activity (job, business, freelance), freelance licenses, and freelance rewards/credit.

Metadata

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

Properties (15)

NameTypeDescription
ActiveFreelanceOrderInstanceIdFB1FreelanceOrderInstanceId
AfterWorkQuestIdListstring[]
CareerSlotstable<EB1CareerType, FB1CareerSlotData>
ExamPreparationnumberThis week's exam-preparation accumulation (0100). Reset to 0 on FB2School::OnWeekReset. Kept on CareerComponent (moved from FB1SchoolEvaluationData, 2026-05). RunExam scales this proportionally to an exam score (0ExamMaxScore).
ExamStudyBonusCountTodayintegerToday's exam-study bonus counter (0~ExamStudyBonusMaxPerDay). Reset to 0 daily on FB2School::OnDayChanged. Spec 4.2: +3 per use, max 3 times/day = +9 total.
ExpulsionRecordsFB1SchoolExpulsionRecord[]Expulsion history. Dropout is not added - re-enrollment is possible.
GraduationRecordsFB1SchoolGraduationRecord[]
LastJoinCareerTicksMaptable<EB1CareerType, integer>Last join time per CareerType. Stores join time for employment without a slot (e.g. HouseholdBiz employees). Regular Careers use the slot's JoinedTicks; this map is merged (max).
LastLeftCareerTicksMaptable<EB1CareerType, integer>Last resignation time per CareerType. Kept on the character because MemberJobInfo is deleted after resignation; split by CareerType for level-based buff conditions.
LicensesMaptable<string, FB1License>
PensionDataListFB1PensionData[]Pension data after retirement. Kept after the Career slot is removed and used for daily pension payouts. Currently only Business Career is eligible.
RoyaltyContractMaptable<FB1RoyaltyContractId, FB2RoyaltyContract>Royalty
SchoolWeeklyHistoryFB1SchoolWeeklyResult[]Mirror of the weekly school-evaluation history (same data as FB2School::WeeklyHistory), kept permanently on the character. Capped at DA->MaxWeeklyHistoryCount (recommended 4); remains after school deletion/city move/dropout/expulsion.
StatisticsFB1FreelanceStatistics
bVoluntarilyLeftSchoolbooleanWhether the student dropped out voluntarily.

Functions (72)

FunctionParametersReturnsDescription
AddAfterWorkQuestInQuestId: string-Adds After Work Quest.
AddExamPreparationInAmount: number-Accumulates ExamPreparation, clamped to 0~100. Temporary path (2026-05): called when the Homework_Do interaction ends.
AddGraduationRecordInRecord: FB1SchoolGraduationRecord-Adds a graduation record on graduation (dropout/expulsion are not recorded).
AddSchoolWeeklyResultInResult: FB1SchoolWeeklyResult-Adds School Weekly Result.
CanAcquireLicenseInLicenseId: string, OutFailReasons: EB1LicenseAcquireFailReason[]booleanReturns whether it can Acquire License.
CanPublishCraftObjectInCraftObjectEntityId: FB1EntityIdbooleanRoyalty (Publishing)
CheatSetLicenseGradeInLicenseId: string, InGrade: EB1LicenseGrade-
ClearAfterWorkQuests--Clears After Work Quests.
ComputeHighestEducationData-FB1HighestEducationDataComputes and returns the highest education data from GraduationRecords (used for packet transmission).
FindContractInContractId: FB1RoyaltyContractIdFB2RoyaltyContractFinds and returns Contract.
GetActiveContracts-FB1RoyaltyContractId[]Returns Active Contracts.
GetActiveOrderInstance-FB2FreelanceOrderInstanceReturns Active Order Instance.
GetActiveOrderInstanceId-FB1FreelanceOrderInstanceIdReturns Active Order Instance Id.
GetAfterWorkQuestIdList-string[]Returns After Work Quest Id List.
GetCareerEntityIdInCareerType: EB1CareerTypeFB1EntityIdReturns Career Entity Id.
GetCareerSlotDataInSlotType: EB1CareerTypeFB1CareerSlotDataReturns Career Slot Data.
GetCareerSlots-table<EB1CareerType, FB1CareerSlotData>Returns Career Slots.
GetCityMovePolicyMapInCityMoveDataPolicyType: EB1CityMoveDataPolicyTypetable<string, EB1CityMoveDataPolicy>Returns City Move Policy Map.
GetCurrentCareerDtIdInCareerType: EB1CareerTypestringReturns Current Career Dt Id.
GetCurrentJobDtIdInCareerType: EB1CareerTypestringReturns Current Job Dt Id.
GetDefaultCityMoveDataPolicy-EB1CityMoveDataPolicyReturns Default City Move Data Policy.
GetExamPreparation-numberExam-preparation accumulation (a student's personal capability). Separated from FB1SchoolEvaluationData (2026-05) and kept on CareerComponent. FB2School::RunExam converts this value to an exam score (0~ExamMaxScore).
GetExamStudyBonusCountToday-integerToday's exam-study bonus counter (spec 4.2: +3 per use, max 3 times = +9 total).
GetExpInCareerType: EB1CareerTypenumberReturns Exp.
GetGraduationRecordInEducationType: EB1EducationTypeFB1SchoolGraduationRecordReturns the graduation record for the given EducationType, or nullptr if none.
GetGraduationRecords-FB1SchoolGraduationRecord[]Returns Graduation Records.
GetLastJoinCareerTicksInCareerType: EB1CareerTypeintegerReturns the Career event time.
GetLastLeftCareerTicksInCareerType: EB1CareerTypeintegerReturns Last Left Career Ticks.
GetLastPromotionTicksInCareerType: EB1CareerTypeintegerReturns Last Promotion Ticks.
GetLicenseInLicenseId: stringFB1LicenseReturns License.
GetLicenseGradeInLicenseId: stringEB1LicenseGradeReturns License Grade.
GetLicenseReviewExpireTicksInLicenseId: stringintegerReturns License Review Expire Ticks.
GetLicenses-FB1License[]Returns Licenses.
GetMutableCareerSlotDataInSlotType: EB1CareerTypeFB1CareerSlotDataReturns Mutable Career Slot Data.
GetPensionDataList-FB1PensionData[]Returns Pension Data List.
GetRankInCareerType: EB1CareerTypeintegerReturns Rank.
GetSchoolWeeklyHistory-FB1SchoolWeeklyResult[]Weekly school-evaluation history (kept permanently on the character, independent of school/city deletion). Synced each exam-day close; capped at DA->MaxWeeklyHistoryCount, oldest entries removed first.
GetStatistics-FB1FreelanceStatisticsReturns Statistics.
HandleApplyCustomPolicyDataRestoreInTypeDef: UStruct, InCityMoveDataPolicyType: EB1CityMoveDataPolicyType-
HandlePreSnapshot--
HandleRetireAge-booleanRetirement processing - called from the WBP button when age/work-day conditions are met. Returns success.
HasActiveContractForCraftEntityIdInCraftEntityId: FB1EntityIdbooleanReturns whether it has Active Contract For Craft Entity Id.
HasActiveOrder-booleanReturns whether it has Active Order.
HasAfterWorkQuests-booleanReturns whether it has After Work Quests.
HasCareerInCareerType: EB1CareerTypebooleanReturns whether it has Career.
HasLicenseInLicenseId: stringbooleanReturns whether it has License.
HasPensionForCareerTypeInCareerType: EB1CareerTypebooleanReturns whether it has Pension For Career Type.
IsCurrentWorkInCareerType: EB1CareerTypebooleanWhether it is work hours and the character is inside the Career site.
IsGraduationInEducationType: EB1EducationTypebooleanReturns whether the given EducationType has been graduated.
IsLicenseUnderReviewInLicenseId: stringbooleanReturns whether License Under Review.
IsWorkingDayOfWeekInCareerType: EB1CareerType, InDayOfWeek: EB1DayOfWeekbooleanReturns whether Working Day Of Week.
IsWorkingTimeInCareerType: EB1CareerTypebooleanReturns whether Working Time.
OnChangeGrowthStepInPrev: EB1GrowthStep, InCurr: EB1GrowthStep-Career-related processing when GrowthStep changes (auto school enrollment, etc.).
OnDeath--On death, processes resignation from all Careers.
OnHourChangedBefore: FDateTime, After: FDateTime-Pension payout (called from FB2Character::OnHourChanged at the DA.PensionPayHour time).
OnInteractionFinishedInteractionId: string, TargetEntityId: FB1EntityId, InteractionTags: string[]-Team-project interaction-finished callback (for the RegisterInteractionFinishedListener template).
OnLicenseReviewCompletedInLicenseId: string-Callback invoked on License Review Completed.
OnOrderFinishedInResult: FB1FreelanceOrderResult-Callback invoked on Order Finished.
OnOrderStartedInInstanceId: FB1FreelanceOrderInstanceId-Callback invoked on Order Started.
OnSkillLevelUpInSkillId: string, InSkillLevel: integer-Detects license-unlock state changes on skill level up and refreshes UI.
ProcessRoyaltyRepeatInContractId: FB1RoyaltyContractIdboolean
RecoverCareerSlotsFromMemberInfoIfEmpty-booleanIf CareerSlots is empty or references an invalid CareerEntityId from a previous city, rebuilds SlotData for the current city by reverse-looking up CareerBase::MemberInfo. Returns true on success.
RefreshAcquireConditionSatisfiedList--
RegisterRoyaltyInCraftEntityId: FB1EntityId, InWorkName: string, InQuality: EB1Quality, InCategory: EB1RoyaltyCategorybooleanRegisters Royalty.
RemoveAfterWorkQuestInQuestId: string-Removes After Work Quest.
RemoveCareerInCareerType: EB1CareerTypebooleanRemoves Career.
ResetExamPreparation--Resets Exam Preparation.
ResetExamStudyBonusDaily--Resets Exam Study Bonus Daily.
SetCareerInCareerType: EB1CareerType, InCareerSlotData: FB1CareerSlotData-Sets Career.
TryAcquireLicenseInLicenseId: string, OutFailReasons: EB1LicenseAcquireFailReason[]boolean
TryAddExamStudyBonusInAmount: number, InMaxPerDay: integerbooleanTries to accumulate one exam-study bonus. If the daily counter check passes, ExamPreparation += InAmount and the counter increments; returns false if over the limit (no change). Called from B2Script_School::Execute_AddExamStudyBonus.
TryPublishCraftObjectInCraftObjectEntityId: FB1EntityIdboolean

Override points (33)

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

FunctionParametersReturnsDescription
Override_AddAfterWorkQuestInQuestId: string-Adds After Work Quest.
Override_AddExamPreparationInAmount: number-Accumulates ExamPreparation, clamped to 0~100. Temporary path (2026-05): called when the Homework_Do interaction ends.
Override_AddGraduationRecordInRecord: FB1SchoolGraduationRecord-Adds a graduation record on graduation (dropout/expulsion are not recorded).
Override_AddSchoolWeeklyResultInResult: FB1SchoolWeeklyResult-Adds School Weekly Result.
Override_CanPublishCraftObjectInCraftObjectEntityId: FB1EntityIdbooleanRoyalty (Publishing)
Override_CheatSetLicenseGradeInLicenseId: string, InGrade: EB1LicenseGrade-
Override_ClearAfterWorkQuests--Clears After Work Quests.
Override_ComputeHighestEducationData-FB1HighestEducationDataComputes and returns the highest education data from GraduationRecords (used for packet transmission).
Override_FindContractInContractId: FB1RoyaltyContractIdFB2RoyaltyContractFinds and returns Contract.
Override_HandleApplyCustomPolicyDataRestoreInTypeDef: UStruct, InCityMoveDataPolicyType: EB1CityMoveDataPolicyType-
Override_HandlePreSnapshot--
Override_HandleRetireAge-booleanRetirement processing - called from the WBP button when age/work-day conditions are met. Returns success.
Override_HasActiveContractForCraftEntityIdInCraftEntityId: FB1EntityIdbooleanReturns whether it has Active Contract For Craft Entity Id.
Override_HasActiveOrder-booleanReturns whether it has Active Order.
Override_HasCareerInCareerType: EB1CareerTypebooleanReturns whether it has Career.
Override_HasLicenseInLicenseId: stringbooleanReturns whether it has License.
Override_HasPensionForCareerTypeInCareerType: EB1CareerTypebooleanReturns whether it has Pension For Career Type.
Override_OnChangeGrowthStepInPrev: EB1GrowthStep, InCurr: EB1GrowthStep-Career-related processing when GrowthStep changes (auto school enrollment, etc.).
Override_OnDeath--On death, processes resignation from all Careers.
Override_OnHourChangedBefore: FDateTime, After: FDateTime-Pension payout (called from FB2Character::OnHourChanged at the DA.PensionPayHour time).
Override_OnInteractionFinishedInteractionId: string, TargetEntityId: FB1EntityId, InteractionTags: string[]-Team-project interaction-finished callback (for the RegisterInteractionFinishedListener template).
Override_OnLicenseReviewCompletedInLicenseId: string-Callback invoked on License Review Completed.
Override_OnOrderFinishedInResult: FB1FreelanceOrderResult-Callback invoked on Order Finished.
Override_OnOrderStartedInInstanceId: FB1FreelanceOrderInstanceId-Callback invoked on Order Started.
Override_OnSkillLevelUpInSkillId: string, InSkillLevel: integer-Detects license-unlock state changes on skill level up and refreshes UI.
Override_ProcessRoyaltyRepeatInContractId: FB1RoyaltyContractIdboolean
Override_RecoverCareerSlotsFromMemberInfoIfEmpty-booleanIf CareerSlots is empty or references an invalid CareerEntityId from a previous city, rebuilds SlotData for the current city. Returns true on success.
Override_RefreshAcquireConditionSatisfiedList--
Override_RegisterRoyaltyInCraftEntityId: FB1EntityId, InWorkName: string, InQuality: EB1Quality, InCategory: EB1RoyaltyCategorybooleanRegisters Royalty.
Override_RemoveAfterWorkQuestInQuestId: string-Removes After Work Quest.
Override_RemoveCareerInCareerType: EB1CareerTypebooleanRemoves Career.
Override_TryAddExamStudyBonusInAmount: number, InMaxPerDay: integerbooleanTries to accumulate one exam-study bonus. If the daily counter check passes, ExamPreparation += InAmount and the counter increments; returns false if over the limit (no change).
Override_TryPublishCraftObjectInCraftObjectEntityId: FB1EntityIdboolean