Yotb Blueprints
Based on game build 714014 | Last updated: 2026-03-07
Overview
yotb_blueprints.lua defines reusable prefab factory functions to generate consumable blueprint entities. Each blueprint is associated with a specific Beefalo doll costume via yotb_skinunlocker. When activated (typically via a "Make" action), the blueprint spawns the corresponding doll prefab and flings it using the lootdropper component. Blueprints are tied to the yotb_costumes table and are only generated if data.test ~= nil.
Usage example
-- Example of how a blueprint is created and used internally:
local blueprints = require("yotb_blueprints")
-- Blueprints are auto-generated by calling `unpack(prefs)` at the module level,
-- producing prefabs like "war_blueprint", "doll_blueprint", etc.
-- When a player interacts with a blueprint:
local doll = SpawnPrefab("yotb_beefalo_doll_war")
inst.components.lootdropper:FlingItem(doll)
Dependencies & tags
Components used: inventoryitem, lootdropper, erasablepaper, yotb_skinunlocker, inspectable, smallburnable, smallpropagator, hauntablelaunch
Tags: None identified.
Properties
No public properties.
Main functions
MakeCostumeBlueprint(data)
- Description: Factory function that returns a Prefab for a blueprint associated with a given costume
data. The blueprint entity spawns and flings a doll when used. - Parameters:
data(table) - Must contain at leastdata.prefab_name(string) anddata.skin_name(string). May includedata.test(any truthy value) to control inclusion in generation.
- Returns: Prefab — A prefab definition with associated assets and prefabs.
- Error states: If
data.prefab_nameordata.skin_nameare missing, the factory may produce malformed prefabs or fail silently.
getprefab(inst)
- Description: Maps the blueprint instance’s prefab name to the corresponding Beefalo doll prefab name.
- Parameters:
inst(Entity) — The blueprint entity instance.
- Returns: string or nil — The doll prefab name (e.g.,
"yotb_beefalo_doll_war"), ornilif no mapping matches. - Error states: Returns
nilifinst.prefabdoes not match any known blueprint name.
makedoll(inst)
- Description: Spawns the doll prefab associated with the blueprint and uses
lootdropperto fling it into the world. - Parameters:
inst(Entity) — The blueprint entity instance.
- Returns: Nothing.
- Error states: If
getprefab(inst)returnsnil, no doll is spawned.
Events & listeners
- Pushes:
imagechange— Fired viainventoryitem:ChangeImageName, triggered when the image name is set during construction.