VE Lua Documentation

Press F to search!

detachCouplers

Definition


-- @/lua/vehicle/beamstate.lua:310

local function detachCouplers(_nodetag, forceLocked, forceWelded)
  local nodetag = _nodetag or ""
  for _, val in pairs(couplerCache) do
    if ((val.couplerLock ~= true or forceLocked) and (val.couplerWeld ~= true or forceWelded) and val.couplerTag and (_nodetag == nil or val.couplerTag == nodetag)) and val.cid then
      obj:detachCoupler(val.cid, 0)
      obj:queueGameEngineLua(string.format("onCouplerDetach(%s,%s)", obj:getId(), val.cid))
    end
  end
  extensions.couplings.onBeamstateDetachCouplers()
end

Callers

@/ui/ui-vue/mockdata/inputBindings.js
                "title": "ui.inputActions.gameplay.couplersUnlock.title",
                "onDown": "beamstate.detachCouplers()",
                "order": 32,
@/lua/vehicle/controller/pyrotechnicCharge.lua
  for _, coupler in ipairs(couplers) do
    beamstate.detachCouplers(coupler, true, true)
  end
@/lua/vehicle/beamstate.lua
      if (isCouplerAttached() or externalIsCouplerAttached) and not _nodetag then
        detachCouplers()
      else
    if isAttached then
      detachCouplers(_nodetag, forceLocked, forceWelded)
    else
              onSelect = function()
                beamstate.detachCouplers()
                return {"reload"}
@/lua/vehicle/extensions/tech/techCore.lua
M.handleDetachCouplers = function(request)
  beamstate.detachCouplers(request.tag, request.forceLocked, request.forceWelded)
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/beamstate/couple.lua
  elseif self.data.mode == 'detach' then
    veh:queueLuaCommand("beamstate.detachCouplers()")
  end