REFERENCECOMPONENTS
UCFBreakableInstancesComponent
Breakable units on the Crushform units core, laid out by an owner: the ISM instances that show them, the layout they stand in, the server-side respawn and, for definitions that ask for it, the breaking from any body. Knows nothing about what the owner lays them out along. The owner lays out units and hands them to SetUnits on every node with identical data; a unit's index is its identity everywhere and never changes for the owner's lifetime. The ISMs given to SetInstanceSlots must be attached to this component at identity: FindForPrimitive walks from an overlapped ISM to its attach parent. A unit has two levels, intact (0) and broken (1); the base component replicates, predicts and plays them.
Any body: a unit whose definition sets bBreaksFromAnyBody is broken, on the authority only, by a physics body or a walking pawn that has no contact component of its own (CFBreakable::IsContactBody). A looped timer (UCFBreakableSettings::AnyBodyCheckIntervalSeconds) looks once for bodies in the box round the standing marked units; while one of them is heavy and fast enough the component ticks after physics and tests each such body's frame path against the units' bounds, and a frame with none turns the tick off. Without a marked definition, on a client and in a world that is not a game world, the component holds no timer and never ticks.
Functions
The instances component that owns Primitive's instances, or nullptr.
One ISM per definition slot (FCFBreakableUnit::DefinitionIndex indexes both arrays); sets each ISM's mesh.
Replaces the unit list and shows every unit the replicated state does not mark broken.
The authority's view, as replicated.
World box of the unit's intact mesh.
The unit an overlap result on one of this component's ISMs refers to; INDEX_NONE if not ours.
Breaks the unit on this node now (hides it, scatters debris, plays feedback) and waits for the authority to confirm; unconfirmed breaks are undone after PredictionConfirmTimeoutSeconds. False if already broken here. The unit's FCFBreakableUnit::LinkedUnits that still stand break with it, each as a break of its own.
Authority only: records and replicates the break and schedules the respawn. No-op for a broken unit. The unit's FCFBreakableUnit::LinkedUnits that still stand break with it, each as a break of its own.
Authority: every broken unit stands up at once, whatever CanRespawnUnit says. Returns how many stood up.
Whether the any-body look is armed: this component is on the authority of a game world and has a unit whose definition breaks from any body.
Whether the component ticks now, which it does only while the last look found a body able to break a unit.
Inherited from UCFBreakableUnitsComponent
Functions
- Find
Units The units component Primitive stands for a unit of, and that unit's index: through ICFBreakableUnitPart on the primitive, else the first attach parent that knows the primitive. nullptr when none does.For Primitive - Apply
Hit Authority: applies an outside hit on a primitive to the unit it belongs to.Result On Authority - Predict
Hit Any machine: the prediction twin of ApplyHitResultOnAuthority.Result - Apply
Hit Authority: raises the unit to the level its definition gives this hit (HitResponses), replicates it and plays it.On Authority - Predict
Hit Any machine: shows the hit's level now and waits for the authority; undone after PredictionConfirmTimeoutSeconds. - Get
Unit How many units the owner laid out.Count - Get
Max The highest level a unit can reach, as given to InitUnits; a unit is intact at 0.Level - Get
Unit The level this machine shows: the authority's, or a prediction ahead of it.Level - Get
Confirmed The level the authority confirmed in the current generation.Unit Level - Is
Unit True for a valid index whose shown level is 0; false for an invalid index.Intact - Predict
Unit Shows StoredImpact's level now, ahead of the authority, with the units GatherUnitsRaisedWith adds.Level - Raise
Unit Authority: confirms Level for the unit and the units GatherUnitsRaisedWith adds, replicates it, plays it here and tells OnUnitsRaisedOnAuthority.Level On Authority - Cancel
Prediction Rolls the unit's prediction back to the confirmed level, and with it the predictions of the units GatherUnitsRaisedWith adds. - Apply
Generation Any machine: the first generation this component learns (from here or from its replicated levels) is taken whatever it is; after that a newer one puts every unit back to intact here at once, and an equal or older one is ignored. - Find
Unit The unit the primitive (and the instance of it, ItemIndex) stands for, or INDEX_NONE.For Primitive
Events
- On
Unit Both fire on every machine whenever a unit's shown level changes.Level Changed Native - On
Unit Level Changed