Cruise_Launcher - ArjanSeijs/OC_ICBM_Addon GitHub Wiki

Cruise Launcher documentation

Getting the launcher proxy

By address

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

By searching through all the components

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

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

Radar Methods

Getters and setters

  • launcher.setFrequency(freq: number)
    Set the Frequency of the launcher.

  • launcher.getFrequency() : number
    Get the Frequency of the launcher.

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

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

Methods

  • launcher.canLaunch() : boolean
    Returns true if the cruise launcher is ready to launch the missile, false otherwise.

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

Navigation

⚠️ **GitHub.com Fallback** ⚠️