dcsext.objects.Weapon
Weapon class.
Contents
Description
Is a representation of a DCS Weapon object.
Metamethods
weapon:__init(wpn, initiator, timeout)
Constructor.
Parameters
- wpn
- initiator
- timeout
Methods
weapon:exist()
Does the DCS weapon object still exist in the game world? A Weapon is considered to ‘exist’ if it has not taken too long to impact something and the DCS Weapon object still exists.
Returns
- true if the weapon still exists.
weapon:hasImpacted()
Returns
- true if the Weapon is believed to have impacted something.
weapon:getDesc()
Provides the DCS Weapon description table.
Returns
- Weapon description.
weapon:getWarheadPower()
Gets the warhead’s explosive power.
Returns
- the mass of the explosive used in the warhead.
weapon:getImpactPoint()
Get the impact point. This is the point where the weapon is predicted to intersect with the ground or was deleted by the game.
Returns
- impact point or nil if the weapon has not impacted yet
weapon:update(time, lookahead)
Update the weapon’s state.
Parameters
- time
- current game time step
- lookahead
- seconds to predict the weapon’s future position