Carnival Prizeticket
Based on game build 714014 | Last updated: 2026-03-04
Overview
carnival_prizeticket is a lightweight, stackable inventory item Prefab used in DST as a small fuel source and cat toy. It supports automatic stacking via stackable, fuel burning via fuel and burnable, and floatable physics. It dynamically updates its animation state and inventory image (via inventoryitem.imagename) depending on whether it is alone (_smallstack) or fully stacked (_largestack), and triggers stack merging when landed. It also integrates with the Hauntable system for posthumous effects.
Usage example
local ticket = SpawnPrefab("carnival_prizeticket")
ticket.Transform:SetPosition(x, y, z)
ticket.components.stackable:Put(another_ticket)
ticket.components.fuel:Burn() -- if added to a fire
Dependencies & tags
Components used: inventoryitem, inspectable, stackable, fuel, burnable, propagator, hauntable, floatable, physics
Tags: Adds cattoy.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
imagename | string | "carnival_prizeticket" (updated to "carnival_prizeticket_smallstack" or "carnival_prizeticket_largestack") | Current image asset used in inventory; set by ChangeImageName() on stack change. |
fuelvalue | number | TUNING.TINY_FUEL | Amount of fuel provided when burned. |
maxsize | number | TUNING.STACK_SIZE_TINYITEM | Maximum items allowed in a stack. |
Main functions
GetAnimStateForStackSize(inst, stacksize)
- Description: Returns the animation suffix (e.g.,
"","_smallstack","_largestack") based onstacksize. - Parameters:
stacksize(number) — current stack count. - Returns:
""ifstacksize == 1,"_largestack"ifstacksize > 5, otherwise"_smallstack".
OnStackSizeChanged(inst, data)
- Description: Handles animation and inventory image updates when the stack size changes. Initiates a
jostleanimation followed byidleif it's a non-population change. - Parameters:
data(table, optional) — containsstacksizeandoldstacksizekeys. - Returns: Nothing.
- Error states: Does nothing if
dataisnil.
GetStatus(inst)
- Description: Returns a status string used by
inspectableto display the item’s category in UI tooltips. - Parameters: None.
- Returns:
"GENERIC"concatenated with the animation suffix fromGetAnimStateForStackSize, e.g.,"GENERIC_largestack".
MergeStacks(inst)
- Description: Finds a nearby landed stackable item of the same prefab/skin and attempts to merge them using
stackable:Put(). - Parameters: None.
- Returns: Nothing (side effect only).
- Error states: No effect if no compatible stack is found or if item is in limbo (
INLIMBOtag).
TryMergeStacks(inst)
- Description: Schedules
MergeStacksto run after0.1seconds, typically invoked after landing. - Parameters: None.
- Returns: Nothing.
Events & listeners
- Listens to:
on_landed— triggers stack merging after a short delay viaTryMergeStacks.
stacksizechange— triggersOnStackSizeChangedto update animations and inventory image. - Pushes: None directly.