GE Lua Documentation

Press F to search!

onCouplerDetach

Definition


-- @/lua/ge/main.lua:771

--Trigered when trailer coupler is detached by the user
function onCouplerDetach(objId, nodeId)
  extensions.hook('onCouplerDetach', objId, nodeId)
end

Callers

@/lua/ge/extensions/core/vehicles.lua
-- --Trigered when trailer coupler is detached by the user
-- local function onCouplerDetach(objId1, nodeId)
--   -- if the vehicle is part of a vehicle collection, remove the whole collection

  --onCouplerDetach(obj1id, nodeId)
end
@/lua/vehicle/beamstate.lua
      obj:detachCoupler(val.cid, 0)
      obj:queueGameEngineLua(string.format("onCouplerDetach(%s,%s)", obj:getId(), val.cid))
    end
@/lua/ge/extensions/core/trailerRespawn.lua

local function onCouplerDetach(objId1, nodeId)
  unregisterVehicle(objId1)