Skip to main content

FB2Script_HairSalon

Overview

  • HairSalon-domain game-rule script (Condition_/Execute_ static functions). Override in Lua with Override_.

Metadata

FieldValue
Kindscript
EnvironmentB2 - Simulation
Categoryscripts
Requirerequire('Scripts.B2Script_HairSalon')

Functions (7)

FunctionParametersReturnsDescription
Condition_HasUnlockableSalonHair (static)InScriptContext: FB2ScriptContext, InConditionParam: FB1ConditionbooleanChecks whether the customer (BaseObject) has at least one not-yet-owned (locked) hair in SalonHairPool. Used to gate showing the unlock-styling interaction; if all are unlocked with no locked hair left, it resolves to NotEqual (hidden). S1 (optional): a category key to limit the check scope; unset means the whole pool. BaseObject = Customer. CompareType Equal (has locked hair) / NotEqual (none).
Execute_ApplyFailSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-Failure FinishScript: randomly applies a different hair of the same category, derived from the picked PoolId. Falls back to a random hair from the whole pool if there are no candidates. BaseObject = Self (employee), NonBase = Target (customer).
Execute_ApplyRandomSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-(Legacy) Immediately applies a random hair, within the employee's skill-level range, from SalonHairPool to the target customer. Now replaced by the SelectOrRandomSalonHair + ApplySelected/ApplyFail path but kept for compatibility.
Execute_ApplySelectedSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-Success FinishScript: applies the hair stored in the co-op scope (SalonHair_PoolId) as-is. If the value is NAME_None it is treated as the CAZ path and skipped. BaseObject = Self (employee), NonBase = Target (customer).
Execute_OpenHairSalonCAZ (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-Sends a packet to open the CAZ (character customize) UI targeting the customer when an employee plays. BaseObject = Self (customer).
Execute_SelectOrRandomSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-If the possessed character is the customer, opens a ContentPicker; otherwise picks a random hair from SalonHairPool and shows a speech bubble. The selected/random PoolId is stored in the co-op scope (FB2CoopScheduler::CoopExtraData[SalonHair_PoolId]) to tie pick->apply to the co-op lifetime. Player/autonomy branch is decided by the HairSalon_CustomerPick tag. BaseObject = Self (customer). S1: ContentPicker mode ("Locked" = unlock styling / unset = owned hair only). S2: category key ("Short"/"Medium"/"Long"/"Ponytail") to filter picker candidates (unset = all).
Execute_SetPendingSalonHairSubCategory (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-(BL-57370 follow-up) No-op. Category is passed via SelectOrRandomSalonHair's S2 and the fallback is replaced by PoolId derivation. Kept registered because it is a submitted Execute. Do not use in new data.

Override points (7)

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

FunctionParametersReturnsDescription
Override_Condition_HasUnlockableSalonHair (static)InScriptContext: FB2ScriptContext, InConditionParam: FB1ConditionbooleanChecks whether the customer (BaseObject) has at least one not-yet-owned (locked) hair in SalonHairPool. Used to gate showing the unlock-styling interaction. S1 (optional): a category key to limit the check scope. BaseObject = Customer. CompareType Equal (has locked hair) / NotEqual (none).
Override_Execute_ApplyFailSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-Failure FinishScript: randomly applies a different hair of the same category derived from the picked PoolId; falls back to a random hair from the whole pool. BaseObject = Self (employee), NonBase = Target (customer).
Override_Execute_ApplyRandomSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-(Legacy) Immediately applies a random hair within the employee's skill-level range from SalonHairPool to the target customer. Kept for compatibility.
Override_Execute_ApplySelectedSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-Success FinishScript: applies the hair stored in the co-op scope (SalonHair_PoolId) as-is. NAME_None is treated as the CAZ path and skipped. BaseObject = Self (employee), NonBase = Target (customer).
Override_Execute_OpenHairSalonCAZ (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-Sends a packet to open the CAZ (character customize) UI targeting the customer when an employee plays. BaseObject = Self (customer).
Override_Execute_SelectOrRandomSalonHair (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-If the possessed character is the customer, opens a ContentPicker; otherwise picks a random hair from SalonHairPool. The selected/random PoolId is stored in the co-op scope to tie pick->apply to the co-op lifetime. S1: ContentPicker mode. S2: category key.
Override_Execute_SetPendingSalonHairSubCategory (static)InScriptContext: FB2ScriptContext, InExecuteParam: FB1Execute-(BL-57370 follow-up) No-op. Kept registered because it is a submitted Execute. Do not use in new data.