Skip to main content

Playbill

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

Overview

Playbill is a simple state-holding component used to track the current act of a theatrical performance, such as for the Beefalo Zoo minigame. It is attached to an entity (typically a playbill prefab) and supports saving and loading its state via the OnSave and OnLoad methods. It does not manage logic, timing, or演出 flow — only persists the selected act.

Usage example

local inst = CreateEntity()
inst:AddComponent("playbill")
inst.components.playbill:SetCurrentAct("act2")
-- State will be automatically saved/loaded during game save/load

Dependencies & tags

Components used: None identified
Tags: None identified

Properties

PropertyTypeDefault ValueDescription
scriptstable{}Reserved for script references (not used in current implementation).
costumestable{}Reserved for costume references (not used in current implementation).
starting_actanynilReserved for initial act value (not used in current implementation).
current_actanynilThe currently active act in the playbill.
book_buildanynilReserved for build metadata (not used in current implementation).

Main functions

SetCurrentAct(act)

  • Description: Sets the current_act field to the specified act identifier.
  • Parameters: act (any) — the act to set as current (e.g., a string like "act1" or nil).
  • Returns: Nothing.

OnSave()

  • Description: Returns a serializable table containing the component’s state for savegames.
  • Parameters: None.
  • Returns: Table — { current_act = self.current_act }, or { current_act = nil } if self.current_act is nil.

OnLoad(data)

  • Description: Restores the component’s state from a savegame data table.
  • Parameters: data (table or nil) — the data table returned by OnSave().
  • Returns: Nothing.
  • Error states: Silently ignores malformed or missing data — only updates self.current_act if data.current_act is present.

Events & listeners

None identified