Fossil Piece
Based on game build 714014 | Last updated: 2026-03-05
Overview
The fossil_piece prefab is an inventory item used primarily as a repair material and deployment resource. When deployed, it spawns a fossil_stalker at the target location and consumes the item. It integrates with the deployable, repairer, and stackable components to support in-game crafting and restoration mechanics. Save/load support ensures fossil type persistence across sessions.
Usage example
local inst = SpawnPrefab("fossil_piece")
inst.components.stackable:SetStackSize(5)
inst.components.repairer.workrepairvalue = 2 -- Optional override
-- Deploy at world position pt:
inst.components.deployable:DoDeploy(pt)
Dependencies & tags
Components used: stackable, deployable, repairer, tradable, inspectable, inventoryitem, hauntable
Tags: None identified.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
fossiltype | number | 1 (randomly assigned on master) | Identifies the animation variant (1–4), controls the "fN" animation played. |
scrapbook_anim | string | "f1" | Animation name used in Scrapbook UI (client-only). |
Main functions
SetFossilType(inst, fossiltype)
- Description: Sets the fossil's visual variant and updates the animation. Only effective if the type has changed.
- Parameters:
fossiltype(number) – must be between1andNUM_FOSSIL_TYPES(inclusive). - Returns: Nothing.
ondeploy(inst, pt)
- Description: Deploy handler—spawns a
fossil_stalkerat positionpt, plays the repair sound, prevents collision with placed objects, and consumes the fossil piece by removing it from inventory. - Parameters:
pt(vector) – deployment position in world space. - Returns: Nothing.
Events & listeners
- Listens to: None identified.
- Pushes: None identified.