Wired Damage Detector

From GMod Wiki

Jump to: navigation, search
Wire Icon.png Wiremod ToolYarin Kaul Icon ArrowSquare32 left.png Back
Information 16x16.png Function:Wired component that detects when entities receive damage.
link=User:{{{author}}} Primary fire:Spawns/Updates a Wired Damage Detector.
Wrench orange.png Secondary fire:Links the Damage Detector to an entity.
Link break.png Reload:Unlinks the Damage Detector
Page white text.png Notes:-

Brief

Detects when props are damaged and outputs damage information.

Instructions

Placed using Primary fire. Primary fire on a wired damage detector to update its "Include Constrained Props" option. Secondary fire to link and detect damage on a specific entity. By default, the detector is linked to itself.

Inputs

Outputs

When damage is detected, the detector's outputs will update in the following order:

  1. Attacker
  2. Victim
  3. Victims
  4. Position
  5. Force
  6. Type
  7. Damage

Since Damage is triggered last, when wiring to multiple outputs it makes sense to perform operations after Damage has updated, as then it will be guaranteed that the other outputs have had a chance to update.

Variables

Useful hints

Use this to simulate damage on your contraptions! Use a damage detector to see if the total damage goes above a certain amount, and have them go out of control or break down gradually as they become more damaged.

Alternatively, use damage detectors to automatically find out who is firing at your contraptions with the "Attacker" output.

If an "Entity" or "Entities" input is sent to the detector, it will overwrite any previous links it had. For example, if you link a detector to a prop with secondary fire, then send entity data to its "Entity" input, the detector will only detect damage on the entity received through the wire input.

Note that the damage detector registers damage instantaneously. This means that damage will immediately reset to 0, so if wiring it to an E2 gate, make sure it executes when the input changes.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox