Skip to main content

Twigs

Based on game build 714014 | Last updated: 2026-03-07

Overview

The twigs prefab is a versatile utility item that functions as fuel, food, boat repair material, and ocean fishing tackle. It is designed for early-game resource management and is renewable, stackable, and floatable. The component logic is embedded in the prefab definition itself (via function fn), which attaches multiple components to the entity to enable its diverse behaviors.

Usage example

-- Typical usage in a game context: items are created by the prefab system
-- but this demonstrates the component interactions programmatically:
local inst = Prefab("twigs")
inst.components.fuel.fuelvalue = TUNING.SMALL_FUEL
inst.components.edible.healthvalue = TUNING.HEALING_TINY/2
inst.components.edible.foodtype = FOODTYPE.ROUGHAGE
inst.components.repairer.healthrepairvalue = TUNING.REPAIR_STICK_HEALTH
inst.components.oceanfishingtackle:SetCastingData(
TUNING.OCEANFISHING_TACKLE.BOBBER_TWIG,
"oceanfishingbobber_twig_projectile"
)

Dependencies & tags

Components used: inventoryitem, stackable, tradable, fuel, edible, inspectable, repairer, oceanfishingtackle, snowmandecor
Tags: cattoy, renewable, oceanfishing_bobber, twigs

Properties

No public properties are defined directly in the twigs file; properties are set on attached components via their own APIs:

ComponentPropertyTypeDefaultDescription
stackablemaxsizenumberTUNING.STACK_SIZE_SMALLITEMMaximum stack size for the item.
fuelfuelvaluenumberTUNING.SMALL_FUELEnergy yield when used as fuel.
ediblefoodtypeFOODTYPEFOODTYPE.ROUGHAGEFood classification for消化 mechanics.
ediblesecondaryfoodtypeFOODTYPEFOODTYPE.WOODSecondary classification.
ediblehealthvaluenumberTUNING.HEALING_TINY/2Health restored per consumption.
ediblehungervaluenumberTUNING.CALORIES_TINYHunger restored per consumption.
repairerrepairmaterialMATERIALSMATERIALS.WOODMaterial type used for repair UI/filtering.
repairerhealthrepairvaluenumberTUNING.REPAIR_STICK_HEALTHHull points repaired per use on boats.
oceanfishingtacklecasting_datatableTUNING.OCEANFISHING_TACKLE.BOBBER_TWIGData config for bobber casting behavior.

Main functions

No standalone functions are defined in the twigs prefab itself. All logic is implemented via attached components and their methods. Direct usage is through component API calls.

Events & listeners

  • Pushes: No events are explicitly pushed by this prefab.
  • Listens to: No event listeners are registered on the instance in this file.

Note: The master_postinit branch for quagmire game mode implies server-side initialization, but no direct event handling or firing is present in this file.