Shadowwaxwell
Based on game build 722832 | Last updated: 2026-04-21
Overview
shadowwaxwell.lua registers the suite of prefabs used for Shadow Waxwell's summoned minions. It includes combat-oriented variants (Protector, Duelist), resource-gathering variants (Worker, Lumber, Miner, Digger), and special event variants (Dancer). The file handles entity initialization, component configuration, AI brain assignment, and lifecycle management such as oblivion seeking and despawn effects. It also defines helper builder prefabs for spawning minions via the petleash component.
Usage example
-- Spawn a shadow protector minion
local protector = SpawnPrefab("shadowprotector")
-- Spawn a shadow worker minion
local worker = SpawnPrefab("shadowworker")
-- Spawn the despawn FX
local fx = SpawnPrefab("shadow_despawn")
-- Summon a minion via a builder (typically handled by petleash)
local builder = SpawnPrefab("shadowlumber_builder")
builder.pettype = "shadowlumber"
builder.OnBuiltFn(builder, player_inst)
Dependencies & tags
External dependencies:
brains/shadowwaxwellbrain-- assigns behavior tree to minions
Components used:
skinner-- sets up non-player skin datalocomotor-- configures movement speed and creep interactionhealth-- manages health, invincibility, and damage clampingcombat-- handles targeting, damage, and attack periodsfollower-- manages leader attachment and leashingtimer-- controls oblivion countdownknownlocations-- remembers spawn pointsentitytracker-- tracks spawn platformsinventory-- added to workers for tool holdinglootdropper-- spawns loot on despawn if petpetleash-- used by builder prefabs to spawn minions
Tags:
shadowminion-- added to all minion variantsscarytoprey-- added to minions to affect prey behaviorNOBLOCK-- prevents minions from blocking movementFX-- added to ripple and despawn effectsNOCLICK-- prevents interaction with FX entitiesCLASSIFIED-- added to builder prefabs to hide them
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
isprotector | boolean | false | True if the instance is a shadow protector variant. |
despawnpetloot | boolean | false | If true, drops loot when despawned as a pet. |
ripple_pool | table | {} | Pool of ripple FX entities for movement effects. |
pettype | string | nil | Prefab name of the minion to spawn (builder only). |
OnBuiltFn | function | nil | Function called when builder is placed (builder only). |
Main functions
MakeMinion(prefab, tool, hat, master_postinit)
- Description: Factory function that creates a Shadow Waxwell minion prefab. Configures assets, components, and behavior based on arguments.
- Parameters:
prefab-- string name of the prefab to createtool-- string or table of animation tool names (e.g., "swap_axe")hat-- string animation hat name or nilmaster_postinit-- function called after master initialization
- Returns: Prefab object.
- Error states: None
MakeBuilder(prefab)
- Description: Creates a helper builder prefab that spawns a specific minion type when built by a player with
petleash. - Parameters:
prefab-- string name of the minion prefab to spawn. - Returns: Prefab object for the builder (name appended with
_builder). - Error states: None
protectorfn(inst)
- Description: Configures a minion instance as a Protector. Sets health clamping, combat retargeting near spawn point, and engagement listeners.
- Parameters:
inst-- entity instance. - Returns: None
- Error states: Errors if
instlackshealth,combat, orfollowercomponents (expected to be added prior inMakeMinion).
workerfn(inst)
- Description: Configures a minion instance as a Worker. Adds inventory component for tool holding and sets oblivion timer.
- Parameters:
inst-- entity instance. - Returns: None
- Error states: Errors if
instlacksinventoryorcombatcomponents.
dancerfn(inst)
- Description: Configures a minion instance as a Dancer. Disables combat target retention.
- Parameters:
inst-- entity instance. - Returns: None
- Error states: Errors if
instlackscombatcomponent.
SaveSpawnPoint(inst, dont_overwrite)
- Description: Records the current position or platform as the minion's spawn point.
- Parameters:
inst-- entity instancedont_overwrite-- boolean to prevent overwriting existing location
- Returns: None
- Error states: Errors if
instlacksknownlocationsorentitytrackercomponents.
GetSpawnPoint(inst)
- Description: Retrieves the recorded spawn point position, accounting for platform offsets.
- Parameters:
inst-- entity instance. - Returns:
Vector3position ornil. - Error states: Errors if
instlacksknownlocationsorentitytrackercomponents.
Events & listeners
- Listens to:
attacked-- triggers retaliation or pet despawn logic. - Listens to:
seekoblivion-- initiates despawn sequence. - Listens to:
death-- drops aggro on leader. - Listens to:
dancingplayerdata-- updates dance state from world. - Listens to:
timerdone-- handles oblivion timer expiry. - Listens to:
newcombattarget-- starts health clamp engagement logic (Protector). - Listens to:
droppedtarget-- resets health clamp disengagement logic (Protector). - Listens to:
animover-- removes FX entities after animation completes. - Pushes:
transfercombattarget-- fired when leader is invalid to drop current target.