Skip to main content

Quagmire Sap

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

Overview

quagmire_sap is not a component but a prefab factory function that defines two variants of a Quagmire-themed consumable item: fresh and spoiled. It sets up the core entity structure including transforms, animation states, network replication, and inventory physics. The fresh variant is tagged quagmire_stewable, indicating compatibility with Quagmire cooking recipes, and spawns child prefabs (quagmire_burnt_ingredients and quagmire_syrup) on spoilage. Spoiled variants use a different animation (idle_spoiled) and lack the cooking tag.

Usage example

local fresh_sap = Prefab("quagmire_sap", ...)
local spoiled_sap = Prefab("quagmire_sap_spoiled", ...)

-- In a recipe or logic that consumes sap:
inst.components.stewable:AddIngredient("quagmire_sap", 1)

Dependencies & tags

Components used: None identified.
Tags: Adds quagmire_stewable (only for fresh variant).
Prefabs consumed: quagmire_burnt_ingredients, quagmire_syrup (as loot on spoilage).

Properties

No public properties. This is a prefab factory, not a component.

Main functions

MakeSap(name, fresh)

  • Description: Factory function that returns a Prefab definition for either fresh or spoiled quagmire sap. Configures entity properties, animations, tags, and network initialization based on the fresh flag.
  • Parameters:
    • name (string) — the unique prefab name ("quagmire_sap" or "quagmire_sap_spoiled").
    • fresh (boolean) — if true, configures fresh sap (with cooking tag and animation); otherwise configures spoiled sap.
  • Returns: Prefab — a fully defined prefab ready for registration.
  • Error states: None.

Events & listeners

None identified.

##spoiled Variant Behavior The spoiled variant (quagmire_sap_spoiled) is automatically generated by calling MakeSap("quagmire_sap_spoiled", false). It:

  • Uses the idle_spoiled animation.
  • Does not add the quagmire_stewable tag.
  • Passes nil for the prefabs argument to Prefab(...), meaning it does not drop child prefabs (quagmire_burnt_ingredients, quagmire_syrup) on spoilage — though the fresh variant does.
  • Only returns the entity on the master simulation (server); client-side instances short-circuit with no server-side initialization.