Anchored actors with local rendering
Flying skulls internals
A registered skull prop becomes a server-controlled actor. The server publishes phases and targets; each client interpolates its own visual proxy, so no per-frame positions cross the network.
1. Registration
registerSkull stores the original prop as the permanent patrol anchor and publishes a registration hash
map with speeds, radii, hit points, facing offset and light settings. The original prop is never animated; it marks
where patrols happen and it is what Zeus moves to relocate the haunt.
2. Motion model
| Mode | Behaviour |
|---|---|
patrol | Random point within patrolRadius of the anchor at patrol speed. |
traversal | Direct movement to a point at traversal speed, then patrol. |
fly | Arc at least 50 m above the higher endpoint, with climb and descent folded into travel time. |
skullTick runs the server state machine. Target and phase transitions are broadcast; clients run
skullLocal plus skullMotionPosition to place the proxy, and a joining client starts at the
current path position rather than replaying the flight.
3. Player interaction
During patrol a skull acquires a visible player within 50 m and hunts at traversal speed. Under one metre it jumps to
a point in front of that player's camera, waits briefly and returns. The affected client computes the face position
(other clients use eye position and direction), which keeps the scare accurate without trusting a remote client's
camera. Direct projectile hits on the bone surface count toward hitPoints; skullHit covers
scripted damage.
4. Freezing for photos
Single player can use accTime = 0. Multiplayer cannot, so ZEN exposes Freeze/Resume and scripts may
publish FF_horror_skullFrozen as a boolean. Frozen motion keeps its progress and does not complete.
5. Cleanup and edge cases
- Deleting the prop unregisters the skull when auto-registration is enabled.
- Moving the anchor farther than twice the patrol radius (minimum 3 m) triggers an automatic traversal home.
- A scripted command without a destination returns the skull to its anchor.
- Unregistering stops local lights, particles and the proxy on every client.
Related functions
FF_horror_fnc_registerSkull— Enables an opt-in flying skull actor on a placed skull object for all players, including JFF_horror_fnc_skullCommand— [skull, "fly"/"traversal"/"patrol", optional anchor position ASL]. Moving the original proFF_horror_fnc_skullHit— Applies a configurable hit to a registered skull and disables it when the hit limit is reaFF_horror_fnc_unregisterSkull— Disables a skull actor and releases its local render resources.FF_horror_fnc_skullTick— Server-only arrival and patrol state machine; no dependency on a rendering client.