onCouplerAttached
Definition
-- @/lua/ge/extensions/core/trailerRespawn.lua:119
local function onCouplerAttached(objId1, objId2, nodeId, obj2nodeId)
if objId1 == objId2 then return end
if getConfigType(objId1) == "Prop" or getConfigType(objId2) == "Prop" then return end
if getAttachedNonTrailer(objId1) and not checkRedundancy(objId2, objId1) then
log("D", logTag, tostring(objId1).." registered trailer "..tostring(objId2).." node = "..tostring(nodeId).." trailernode = "..tostring(obj2nodeId))
trailerReg[objId1] = {trailerId=objId2, trailerNode=obj2nodeId, node=nodeId}
else
log("D", logTag, tostring(objId2).." registered trailer "..tostring(objId1).." node = "..tostring(obj2nodeId).." trailernode = "..tostring(nodeId))
if checkRedundancy(objId1,objId2) then
log("E", logTag, "Tried to register a loop")
return
end
trailerReg[objId2] = {trailerId=objId1, trailerNode=nodeId, node=obj2nodeId}
end
extensions.hook("onTrailerAttached", objId1, objId2)
end
Callers
@/lua/ge/extensions/career/modules/delivery/vehicleTasks.lua
--[[
local function onCouplerAttached(objId1, objId2, nodeId, obj2nodeId)
for _, taskData in ipairs(vehicleTasks) do
@/lua/ge/extensions/flowgraph/modules/vehicleModule.lua
function C:onCouplerAttached(objId1, objId2, nodeId, obj2nodeId)
self.couplings[objId1][objId2] = true
@/lua/vehicle/controller/controllerTemplate.lua
-- local function onCouplerAttached(nodeId, obj2id, obj2nodeId)
-- end
@/lua/vehicle/controller/linearActuators/linearActuatorTrailerFeet.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId)
if obj:getId() ~= obj2id and nodeId == couplerNodeId then
@/lua/vehicle/energyStorage/pressureTank.lua
local function onCouplerAttached(storage, nodeId, obj2id, obj2nodeId, attachForce)
--if the attached node is our supply node (ie the one where WE connect to OUR supply) and we act as consumer
@/lua/ge/extensions/core/vehicles.lua
local function onCouplerAttached(objId1, objId2, nodeId, obj2nodeId)
table.insert(M.attachedCouplers, {objId1, objId2, nodeId, obj2nodeId})
@/lua/ge/extensions/core/couplerCameraModifier.lua
local function onCouplerAttached(objId1_, objId2_)
if checkForTrailer(objId1_, objId2_) == true then
@/lua/ge/main.lua
function onCouplerAttached(objId1, objId2, nodeId, obj2nodeId)
if objId1 ~= objId2 and settings.getValue("couplerCameraModifier", false) then
@/lua/vehicle/controller/couplings/fifthwheel.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId, attachForce)
if nodeId == fifthwheelNodeCid then
@/lua/vehicle/powertrain/hydraulicPump.lua
local function onCouplerAttached(device, nodeId, obj2id, obj2nodeId, attachForce)
--if we just attached to our own consumer (ie we act as supply)
@/lua/vehicle/controller/trailerFeet.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId)
if obj:getId() ~= obj2id then
@/lua/vehicle/controller/hydraulics/hydraulicTrailerFeet.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId)
if obj:getId() ~= obj2id then
@/lua/vehicle/main.lua
function onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
-- print('couplerAttached'..','..nodeId..','..obj2nodeId..','..obj2id..','..attachSpeed)
-- print('couplerAttached'..','..nodeId..','..obj2nodeId..','..obj2id..','..attachSpeed)
beamstate.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
controller.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
beamstate.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
controller.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
powertrain.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
controller.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
powertrain.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
energyStorage.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
powertrain.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
energyStorage.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
extensions.hook("onCouplerAttached", nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
@/lua/vehicle/powertrain/hydraulicAccumulator.lua
local function onCouplerAttached(device, nodeId, obj2id, obj2nodeId, attachForce)
--if the attached node is our supply node (ie the one where WE connect to OUR supply) and we act as consumer
@/lua/vehicle/powertrain.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
for i = 1, deviceCount, 1 do
if device.onCouplerAttached then
device:onCouplerAttached(nodeId, obj2id, obj2nodeId, attachEnergy)
end
@/lua/vehicle/controller.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
for i = 1, couplerAttachedEventCount, 1 do
if controller.onCouplerAttached ~= nil then
print(" sortedControllers[" .. i .. "].onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy) -- " .. tostring(controller.typeName))
end
@/lua/vehicle/beamstate.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
--check if we are dealing with couplers within the same vehicle
if objectId < obj2id then
obj:queueGameEngineLua(string.format("onCouplerAttached(%s,%s,%s,%s)", objectId, obj2id, nodeId, obj2nodeId))
end
@/lua/vehicle/energyStorage.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy)
for i = 1, storageCount, 1 do
if storage.onCouplerAttached then
storage:onCouplerAttached(nodeId, obj2id, obj2nodeId, attachEnergy)
end
@/lua/vehicle/controller/advancedCouplerControl.lua
local function onCouplerAttached(nodeId, obj2id, obj2nodeId, attachForce)
local couplerIndex = couplerGroup.couplerNodeIdLookup[nodeId]