Every interactive object in Warman (portals, chests, levers, enemy spawners, vendors, item containers, teleporters) inherits from a single abstract base class called Interactable. This base class provides a uniform interaction model, an output wiring system, and visual feedback infrastructure that all interactables share.

Interaction Types

Interactables come in three flavours. Action interactables need the player to press a button. Walk up to a chest and press interact. Trigger interactables fire automatically when the player enters their zone, like stepping on a pressure plate. Indirect interactables are never triggered by the player directly. They respond only to signals from other interactables through the wiring system.

Each type has its own collider setup. Action interactables use a sphere or box collider for proximity detection. Trigger interactables use a trigger collider. Indirect interactables skip colliders entirely since they only respond to wired signals.

The Wiring System

The core of the system is the output array. Every interactable has two output lists: a regular output (fired on interaction) and an "out of charges" output (fired when the interactable runs out of uses). Each output is a reference to another interactable in the same room.

Lever Lever 2 LogicGate all inputs met? Spawner creates enemies all dead Open Door WarScript can also trigger
Interactable wiring: lever → gate → spawner → door

Concrete Interactables

The variety of concrete types is what makes the system flexible. Lever and Switch are simple on/off toggles. LogicGate only fires its output when all of its required inputs have been satisfied, useful for "kill all enemies to unlock the door" patterns. EnemySpawner creates enemies at a configured rate and difficulty. Vendor generates a random shop inventory when activated. ItemContainer drops loot from a configured drop table. Teleporter moves the player to a target position within the same room. Portal transitions between rooms.

Some interactables have charges. A chest might only be openable once, a lever might have 3 uses. When charges run out, the "out of charges" output fires, which can trigger cleanup logic like despawning the interactable's visual or unlocking a secondary path.

Script Hooks

The WarScript system can hook into interactables. Script timers, room entry events, and custom triggers can programmatically activate interactables that aren't wired to anything in the editor. This bridges the gap between static level design and dynamic game logic. A WarScript function might activate a hidden spawner when a timer expires or a quest condition is met.

Because interactables process through the deterministic simulation (all interactions are input commands that flow through the lockstep tick), wired chains and script-triggered activations work identically in singleplayer and multiplayer. The host doesn't need to synchronise interactable state. Every client computes the same result from the same inputs.