dcsext.systems.WeaponImpactTracker

WeaponImpactTracker.

Contents

  1. Description
  2. Metamethods
    1. weaponimpacttracker:__init(updateRate, eventID, weaponLifetime)
  3. Methods
    1. weaponimpacttracker:register(startdelay)
    2. weaponimpacttracker:isWpnValid(event)
    3. weaponimpacttracker:handleShot(event)
    4. weaponimpacttracker:run(time)

Description

Tracks DCS Weapon objects to impact. Only weapons conforming to isWpnValid will be tracked. Will emit a custom impact event to all of DCS upon impact detection.

Metamethods

weaponimpacttracker:__init(updateRate, eventID, weaponLifetime)

Constructor.

Parameters

updateRate
eventID
weaponLifetime

Methods

weaponimpacttracker:register(startdelay)

Register the tracker as an event handler and schedule its periodic updates with the DCS scheduler.

Parameters

startdelay
unused by the base class registration, which schedules the first run after self.delay seconds.

weaponimpacttracker:isWpnValid(event)

Only DCS Weapon objects where this function returns true will be considered. Only consider Weapons not fired from air defence units and have HE warheads. This method is intended to be overriden so that mission builders can customize which weapons should be tracked.

Parameters

event
A DCS Shot event.

Returns

  • true if the weapon should be tracked.

weaponimpacttracker:handleShot(event)

Listens for DCS Shot events and tracks weapons the system is interested in according to isWpnValid.

Parameters

event

weaponimpacttracker:run(time)

Update each tracked weapon and emit an impact event for each weapon that has been determined to have impacted something.

Parameters

time