Skip to main content

Bramblefx

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

Overview

bramblefx is a prefab factory function that generates FX entities responsible for simulating thorn-like area-of-effect damage. These FX entities grow their effect radius over time (up to a maximum of 3 units) and repeatedly check for valid combat targets within that radius. When a target is found and meets damage criteria, it triggers combat:GetAttacked, optionally treating the FX as a direct attacker or deferring to an assigned owner. The FX is typically attached to wearable items (e.g., armor) or static traps and is not persisted across sessions.

Usage example

-- Create and configure a bramblefx armor effect
local fx = MakePrefabInstance("bramblefx_armor", TheWorld, x, y, z)
fx:SetFXOwner(player) -- Attaches to player; damage may originate from player or FX

Dependencies & tags

Components used: updatelooper Tags added: FX, thorny, trapdamage (only for bramblefx_trap) Tags checked in filtering: bramble_resistant, INLIMBO, notarget, noattack, flight, invisible, wall, player, playerghost, _combat

Properties

PropertyTypeDefault ValueDescription
rangenumber0.75Current radius (in world units) for damage application; increases by 0.75 per update.
damagenumberTUNING.ARMORBRAMBLE_DMG or TUNING.TRAP_BRAMBLE_DAMAGEPhysical damage dealt per hit.
spdmgtable or nil{ planar = TUNING.ARMORBRAMBLE_DMG_PLANAR_UPGRADE } (for upgrade)Planar damage table; nil for non-planar variants.
ownerentity or nilnilEntity that "owns" the FX; used to determine attack origin (e.g., player wearing armor).
canhitplayersbooleantrueWhether the FX can damage players; controlled by PvP setting and owner tag.
ignoretable{}A dictionary of entity instances to skip when checking for damage targets.

Main functions

SetFXOwner(inst, owner)

  • Description: Attaches the FX entity to a specified owner (e.g., player wearing armor), syncs position, sets PvP awareness, and adds the owner to the ignore list.
  • Parameters: owner (entity) — the entity that is the source of the effect.
  • Returns: Nothing.

Events & listeners

  • Listens to: animover — triggers inst.Remove() to clean up the FX entity after its animation completes.
  • Pushes: None (no PushEvent calls in the source).