Table Winters Feast
Based on game build 714014 | Last updated: 2026-03-07
Overview
table_winters_feast is a prefabricated structure component used in the Winters Feast seasonal event. It serves as a dedicated surface for placing festive foods to trigger feasting effects. The entity integrates with the wintersfeasttable, inventory, shelf, trader, and lootdropper components to manage food placement, trade, destruction, and lighting. It registers with the global feasts component during initialization and cleans up registrations on removal or destruction. Non-master simulation clients receive a lightweight instance without logic components.
Usage example
local inst = CreateEntity()
inst.entity:AddTransform()
inst.entity:AddAnimState()
inst.entity:AddSoundEmitter()
inst.entity:AddMiniMapEntity()
inst.entity:AddNetwork()
inst:AddTag("structure")
inst:AddTag("wintersfeasttable")
inst:AddComponent("wintersfeasttable")
inst:AddComponent("inventory")
inst.components.inventory.maxslots = 1
inst:AddComponent("shelf")
inst:AddComponent("trader")
-- Later, place a festive food on the table
inst.components.trader:Disable()
inst.components.shelf:PutItemOnShelf(festive_food_item)
-- This triggers internal handlers that set canfeast = true and enable feasting
Dependencies & tags
Components used: wintersfeasttable, inventory, shelf, trader, lootdropper, workable, hauntable, burnable, propagator, inspectable, deployhelper, placer, updatelooper, finiteuses (indirect), stackable (indirect).
Tags added: structure, wintersfeasttable.
Tags checked: burnt, fire, takeshelfitem, wintersfeastcookedfood, preparedfood, readyforfeast, monster, animal, creaturecorpse, hive.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
helper | entity or nil | nil | Non-networked visual helper ring used during placement for range/structure group highlighting. |
_eject_task | Task or nil | nil | Delayed task used to eject wrongly placed food after bump animation completes. |
scrapbook_specialinfo | string | "TABLEWINTERSFEAST" | Reference key for scrapbook display. |
Main functions
SetFoodSymbol(inst, foodname, override_build)
- Description: Applies or clears a visual food symbol overlay on the table via
AnimState:OverrideSymbol. Used to reflect the currently placed food item. - Parameters:
foodname(string or nil) — prefab name of the food;nilclears the symbol.override_build(string or nil) — optional animation build name override. - Returns: Nothing.
ItemTradeTest(inst, item)
- Description: Validation function for the
tradercomponent that determines if an item can be placed on the table. - Parameters:
inst(entity),item(entity or nil). - Returns: Boolean —
trueif item is valid (e.g., taggedwintersfeastcookedfoodorpreparedfood, table is notburnt/fire, andtakeshelfitemtag absent), elsefalse.
DropFoodFromShelf(inst)
- Description: Safely removes and returns the current shelf item (without giving it to an entity) for ejection or cleanup.
- Parameters:
inst(entity). - Returns: The dropped item entity or
nil.
EjectFood(inst)
- Description: Removes food from the shelf and physically launches it away from the table using physics.
- Parameters:
inst(entity). - Returns: Nothing.
RefuseFood(inst)
- Description: Plays the “bump” animation and schedules
EjectFoodfor items placed that do not meet feast criteria. - Parameters:
inst(entity). - Returns: Nothing.
OnGetShelfItem(inst, item)
- Description: Callback invoked when an item is placed on the shelf. Handles visual symbology, feasting readiness (
canfeast), and food-type-specific logic (e.g., refusal of non-festive food, rot handling). - Parameters:
inst(entity),item(entity). - Returns: Nothing.
OnLoseShelfItem(inst, taker, item)
- Description: Callback invoked when an item is taken from the shelf. Clears symbology and resets
canfeasttofalse. - Parameters:
inst(entity),taker(entity or nil),item(entity). - Returns: Nothing.
OnFinishFood(inst)
- Description: Called after a food item has finished being feasted upon. Removes the item, disables
canfeast, and spawns a depleted food FX prefab. - Parameters:
inst(entity). - Returns: Nothing.
OnDepleteFood(inst)
- Description: Spawns depletion FX particles when food on the table is consumed, proportional to the number of feasters in the same table group.
- Parameters:
inst(entity). - Returns: Nothing.
onburnt(inst)
- Description: Handles table state when burnt: ejects food, disables trading and feasting, unregisters the table from the
feastscomponent. - Parameters:
inst(entity). - Returns: Nothing.
onhaunt(inst)
- Description: Handles haunting; if the table is
readyforfeast, it refuses food by playing the bump animation and ejecting. - Parameters:
inst(entity). - Returns: Boolean —
trueif haunt succeeded (i.e., food was refused), elsenil.
placer_postinit_fn(inst)
- Description: Sets up visual placement helpers: inner and outer radius rings, and links them via
placer:LinkEntity. Adjusts scales for range indication and structure group highlighting. - Parameters:
inst(entity) — the placer entity being initialized. - Returns: Nothing.
Events & listeners
- Listens to:
onbuilt,onburnt,onignite,onextinguish,onremove,ruffle,animover,perished(on shelf item). - Pushes:
feastinterrupted(on feasters when canceling feasting),onburnt,entity_droploot(vialootdropper). - Component event callbacks:
wintersfeasttable:ondepletefoodfn,onfinishfoodfnshelf:onshelfitemfn(set toOnGetShelfItem),ontakeitemfn(set toOnLoseShelfItem)trader:abletoaccepttest(set toItemTradeTest),onaccept(set toOnItemGiven),deleteitemonaccept = falseworkable:onfinish(set toonhammered),onwork(set toonhit)hauntable:onhaunt(set toonhaunt)