Skip to main content

Haptics

Based on game build 722832 | Last updated: 2026-04-28

Overview

haptics.lua defines the HapticEffects configuration table, which stores all haptic feedback effect definitions used throughout Don't Starve Together. The data is organized into categories such as DANGER, PLAYER, ENVIRONMENT, BOSS, and UI to standardize controller vibration responses for different gameplay scenarios. This file serves as a static data source required by the input and audio systems to trigger appropriate haptic feedback during events. It is not a component and does not attach to entities; instead, it is accessed globally via require().

Usage example

local HapticEffects = require "haptics"
-- Access the first effect record in the array
local first_effect = HapticEffects[1]
print(first_effect.event, first_effect.category)
-- Filter effects by category field
for i, effect in ipairs(HapticEffects) do
if effect.category == "DANGER" then
print(effect.event, effect.vibration_intensity)
end
end

Dependencies & tags

Components used: None identified.

Tags: None

Properties

PropertyTypeDefault ValueDescription
HapticEffectstable---Top-level container table holding all haptic effect definitions as an array.
eventstring---Sound event path string (e.g., "dontstarve/wilson/hungry").
vibrationboolean---Whether this effect triggers controller vibration.
audioboolean---Whether this effect plays an audio sound.
vibration_intensitynumber---Intensity multiplier for vibration (typically 0.5–25.0).
audio_intensitynumber---Intensity multiplier for audio playback.
categorystring---Effect category for filtering. Valid values: "DANGER", "PLAYER", "ENVIRONMENT", "BOSS", "UI".
player_onlyboolean---If true, effect only triggers for the local player (optional field, not present on all records).

Main functions

None.

Events & listeners

This file is not event-driven.