Skip to content

Missile_Launcher

ArjanSeijs edited this page Feb 1, 2021 · 4 revisions

Missile Launcher documentation

Getting the launcher proxy

By address

local component = require("component")
local launcher = component.proxy("xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")

By searching through all the components

local component = require("component")
local launcher = nil

for k,v in component.list() do
  local p = component.proxy(k)
  if not (p.isICBM == nil) and p.isICBM("component_missile_launcher") then
    launcher = p
  end
end

Radar Methods

Getters and setters

  • launcher.setDetonationHeight(y : number)
    Sets the missile destination height of the missile launcher, only supported by tier 3 and tier 2 launchers, throws exception on 1.

  • launcher.getDetonationHeight() : number
    Gets the missile destination height of the missile launcher, only supported by tier 3 and tier 2 launchers, throws exception on 1.

  • launcher.setFrequency(freq: number)
    Set the Frequency of the launcher, only supported by tier 3 launchers, throws exception on tier 2 and 1.

  • launcher.getFrequency() : number
    Get the Frequency of the launcher, only supported by tier 3 launchers, throws exception on tier 2 and 1.

  • launcher.getInaccuracy() : number
    Gets the inaccary in block of the launcher, determined by the tier and support frame

  • launcher.setLockHeight(height: number)
    Set the LockHeight of the launcher, only supported by tier 3 and tier 2 launchers, throws exception on 1.

  • launcher.getLockHeight() : number
    Get the LockHeight of the launcher, only supported by tier 3 and tier 2 launchers, throws exception on 1.

  • launcher.setTargetPos(x : number, z : number)
    Sets the missile destination location of the missile launcher

  • launcher.getTargetPos() : {x : number, z : number}
    Gets the missile destination location of the missile launcher

  • launcher.getTier() : number
    Gets the launcher tier 1, 2 or 3

Methods

  • launcher.isInRange(x : number, y : number) : boolean
    Returns true if the position is within the supported range of the missile launcher, false otherwise.

  • launcher.getRange() : number
    Gets the maximum range of the missile launcher

  • launcher.containsMissile() : boolean
    Returns true if a missile is loaded in the missile launcher, false otherwise.

  • launcher.getMissile() : string
    Returns name of the missile if a missile is loaded in the missile launcher, nil otherwise.
    Possible values are:
    Conventional_Missile, Shrapnel_Missile, Incendiary_Missile, Debilitation_Missile, Chemical_Missile, Anvil_Missile, Repulsive_Missile, Attractive_Missile, Fragmentation_Missile, Contagious_Missile, Sonic_Missile, Breaching_Missile, Thermobaric_Missile, Nuclear_Missile, EMP_Missile, Exothermic_Missile, Endothermic_Missile, Anti-Gravitational_Missile, Ender_Missile, Hypersonic_Missile, Antimatter_Missile, Red_Matter_Missile

  • launcher.launch() : boolean
    Launches the missile at the location set by launcher.setTargetPos. Returns true if the launch succeed, false otherwise.

  • launcher.launch(x : number, z : number) : boolean
    Launches the missile at the the x and z coordinates, overwrites the location set by launcher.setTargetPos. Returns true if the launch succeed, false otherwise.

  • launcher.launchMissile() : boolean
    Alias for launcher.launch()

Navigation

Clone this wiki locally