queueLuaCommand
Definition
-- @/=[C]:-1
function queueLuaCommand(...)
Callers
@/lua/ge/extensions/campaign/exploration.lua
if vehicle then
vehicle:queueLuaCommand('controller.setFreeze(1)')
end
if vehicle then
vehicle:queueLuaCommand('controller.setFreeze(1)')
end
veh:setTransform(transform)
veh:queueLuaCommand('obj:queueGameEngineLua("if getObjectByID('..playerId..') then getObjectByID('..playerId..'):autoplace(false) end")')
simTimeAuthority.set(1)
simTimeAuthority.set(1)
veh:queueLuaCommand('recovery.clear()')
local state = M.state
if vehicle then
vehicle:queueLuaCommand('controller.setFreeze(0)')
end
if vehicle then
vehicle:queueLuaCommand('controller.setFreeze(0)')
end
if vehicle then
vehicle:queueLuaCommand('controller.setFreeze(0)')
end
@/lua/ge/extensions/core/input/actions.lua
if vehObj then
vehObj:queueLuaCommand(cmd)
if debugUIEnabled then
local cmdStr = _replaceCmd(evt.onDown, actionValue, vehicleId)
Lua:queueLuaCommand(cmdStr)
return 1
local cmdStr = _replaceCmd(evt.onUp, actionValue, vehicleId)
Lua:queueLuaCommand(cmdStr)
return 1
local cmdStr = _replaceCmd(evt.onChange, actionValue, vehicleId)
Lua:queueLuaCommand(cmdStr)
return 1
@/gameplay/missionTypes/aiRace/customNodes/autoStartPositionsNode.lua
sp:moveResetVehicleTo(vehId, false, true)
getObjectByID(vehId):queueLuaCommand("recovery.saveHome()") -- for easier resetting of vehicles
log("D", "", "Moved vehicle "..vehId.." to start position "..sp.name)
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceAiParameters.lua
aggression = clamp(aggression + (self:getRandomNumber(scale) * 0.05), 0.25, 2)
veh:queueLuaCommand('ai.setAggression('..aggression..')')
state.baseAggression = aggression -- saves the aggression value to use later
veh:queueLuaCommand('ai.setParameters('..serialize(aiParams)..')')
veh:queueLuaCommand('ai.setRacing(true)') -- new mode, improves racing AI
veh:queueLuaCommand('ai.setParameters('..serialize(aiParams)..')')
veh:queueLuaCommand('ai.setRacing(true)') -- new mode, improves racing AI
local mode = self.pinIn.avoidCollisions.value and 'on' or 'off'
veh:queueLuaCommand('ai.setAvoidCars("'..mode..'")')
end
local mode = self.pinIn.rubberband.value and 'rubberBand' or 'off'
veh:queueLuaCommand('ai.setAggressionMode("'..mode..'")')
end
local mode = self.pinIn.offroad.value and 'offRoad' or 'default'
veh:queueLuaCommand('ai.setParameters({driveStyle = "'..mode..'"})')
end
@/lua/ge/extensions/gameplay/missions/missionManager.lua
if setup.toggleDifferentials then
veh:queueLuaCommand([[
for _, v in ipairs(powertrain.getDevicesByType("differential")) do powertrain.toggleDeviceMode(v.name) end
if setup.lockFrontDiffs then
veh:queueLuaCommand([[
controller.getControllerSafe("frontLockControl").setDriveMode('locked')
if setup.lockRearDiffs then
veh:queueLuaCommand([[
controller.getControllerSafe("rearLockControl").setDriveMode('locked')
if setup.setTransfercase then
veh:queueLuaCommand([[
controller.getControllerSafe("transfercaseControl").setDriveMode('4hi')
if setup.setRangebox then
veh:queueLuaCommand([[
controller.getControllerSafe("rangeboxControl").setDriveMode('low')
for _, veh in ipairs(getAllVehicles()) do
veh:queueLuaCommand("obj:setWind(0, 0, 0)")
end
@/gameplay/missions/west_coast_usa/chase/001-Goliath/script.lua
spawn.placeTrailer(suspectId, nodeOffset1, trailerId, nodeOffset2, nodeTag)
--suspect:queueLuaCommand("beamstate.attachCouplers()")
end
@/lua/ge/extensions/gameplay/missions/missionTypes/flowMission.lua
if veh:isReady() then
veh:queueLuaCommand("obj:setWind("..string.format('%2f, %2f, %2f', wind.x, wind.y, wind.z)..")")
end
@/lua/ge/extensions/gameplay/traffic/baseRole.lua
if args.useWarnSignal then
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_warn_signal(1)')
end
self.veh:setAiMode('stop')
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_warn_signal(1)')
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_lightbar_signal(0)')
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_warn_signal(1)')
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_lightbar_signal(0)')
end
if self.veh.isAi then
obj:queueLuaCommand('ai.setTargetObjectID('..self.targetId..')')
end
self.driver.aggression = clamp(baseAggression + modifier, 0.2, 1)
getObjectByID(self.veh.id):queueLuaCommand('ai.setAggression('..self.driver.aggression..')') -- slightly randomized aggression (mean 0.3)
end
local obj = getObjectByID(self.veh.id)
obj:queueLuaCommand('ai.setParameters('..serialize(params)..')') ]]--
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/beamstate/beamstate.lua
end
veh:queueLuaCommand("beamstate."..self.selected.."()")
end
@/lua/ge/extensions/core/input/bindings.lua
for _,veh in ipairs(getAllVehicles()) do
veh:queueLuaCommand("hydros.onFFBConfigChanged("..serialize(getFFBConfig(veh))..")")
end
@/lua/ge/extensions/gameplay/forceField.lua
local veh = be:getObject(i)
veh:queueLuaCommand("obj:setPlanets({})")
end
if veh:getId() ~= vehicle:getID() then
veh:queueLuaCommand(command)
end
@/lua/ge/extensions/flowgraph/modules/missionModule.lua
if tod and tod.time >= 0.225 and tod.time <= 0.775 then
obj:queueLuaCommand("electrics.setLightsState(2)")
end
@/lua/ge/extensions/scenario/busdriver.lua
if playerVehicle then
playerVehicle:queueLuaCommand('controller.setFreeze(1)')
end
if playerVehicle then
playerVehicle:queueLuaCommand('controller.setFreeze(0)')
end
--wpList = scenario_scenarios.getScenario().lapConfig
--getObjectByID(vehicleId):queueLuaCommand("controller.getController('busNextStopDsp').onDepartedStop( "..dumps({unpack(wpList, 1,#wpList)}).." )")
if playerVehicle then
playerVehicle:queueLuaCommand('controller.setFreeze(1)')
else
if playerVehicle then
playerVehicle:queueLuaCommand('controller.setFreeze(0)')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/playRecording.lua
self.recording.recording.loopType = "firstOnlyTeleport"
veh:queueLuaCommand('ai.startFollowing(' .. serialize(self.recording.recording) .. ')')
self.running = true
if veh then
veh:queueLuaCommand('ai.stopFollowing()')
end
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
local veh = core_vehicles.spawnNewVehicle(vehData.model.key, {pos = spawnPos, rot = spawnRot})
veh:queueLuaCommand("input.event('parkingbrake', 0, 1)")
end
@/lua/ge/extensions/core/quickAccess.lua
onSelect = function()
getPlayerVehicle(0):queueLuaCommand("beamstate.save()")
return {"hide"}
onSelect = function()
getPlayerVehicle(0):queueLuaCommand("beamstate.load()")
extensions.hook('trackVehReset')
extensions.hook('trackVehReset')
playerVeh:queueLuaCommand("recovery.loadHome()")
return {'hide'}
onSelect = function()
playerVeh:queueLuaCommand("recovery.saveHome()")
return {'hide'}
affectedVehicleCount = affectedVehicleCount + 1
veh:queueLuaCommand('ai.driveUsingPath('..str..')')
::continue::
local veh = be:getObject(i)
veh:queueLuaCommand('ai.driveUsingPath('..str..')')
veh:queueLuaCommand('ai.setRacing(true)')
veh:queueLuaCommand('ai.driveUsingPath('..str..')')
veh:queueLuaCommand('ai.setRacing(true)')
affectedVehicleCount = affectedVehicleCount + 1
if vehicle and getVehicleItems then
vehicle:queueLuaCommand('extensions.core_quickAccess.requestItems("' .. tostring(currentLevel) .. '")')
-- we give the vehicle 4 gfx frames to add items
end
veh:queueLuaCommand('extensions.core_quickAccess.selectItem(' .. serialize(item.id) .. ', ' .. serialize(buttonDown) .. ', ' .. serialize(actionIndex) .. ')')
return
@/lua/ge/extensions/core/busRouteManager.lua
if veh then
veh:queueLuaCommand("controller.onGameplayEvent('"..cmd.."',"..serialize(arg)..")")
else
@/lua/ge/extensions/gameplay/traffic/roles/standard.lua
local obj = getObjectByID(self.veh.id)
obj:queueLuaCommand('ai.driveInLane("off")')
obj:queueLuaCommand('ai.setAggressionMode("off")')
obj:queueLuaCommand('ai.driveInLane("off")')
obj:queueLuaCommand('ai.setAggressionMode("off")')
self:setAggression(args.aggression or max(0.5, random()))
local obj = getObjectByID(self.veh.id)
obj:queueLuaCommand('ai.driveInLane("off")')
obj:queueLuaCommand('ai.setAggressionMode("off")')
obj:queueLuaCommand('ai.driveInLane("off")')
obj:queueLuaCommand('ai.setAggressionMode("off")')
self:setAggression(args.aggression or max(0.5, random()))
@/lua/ge/extensions/core/vehicle/partmgmt.lua
end
vehObj:queueLuaCommand(string.format('bdebug.setPartsSelected(%s)', serialize(partNames)))
end
@/lua/ge/extensions/tech/utils.lua
if veh then
veh:queueLuaCommand("extensions.unload('tech_vehicleSystemsCoupling')")
end
M.vehicleSystemsCouplingLoad = function ()
veh:queueLuaCommand("extensions.load('tech/vehicleSystemsCoupling'); tech_vehicleSystemsCoupling.startCoupling()")
end
@/gameplay/missions/italy/arrive/012-Field/script.lua
if n1 and n2 and (string.startswith(n1, self.str) or string.startswith(n2, self.str)) then
veh:queueLuaCommand("ai.setAggression(0.4)") -- sets AI aggression to a low value, to assist with difficult turn
self.riskTimer = 3
if self.riskTimer <= 0 then
veh:queueLuaCommand("ai.setAggression(0.7)") -- resets AI aggression
end
@/lua/ge/extensions/gameplay/crashTest/scenarioManager.lua
local veh = getObjectByID(vehId)
veh:queueLuaCommand('ai.startFollowing(' .. serialize(scriptAiFile.recording) .. ')')
end
local veh = getObjectByID(currentStepParameters.jbeamTargets[1])
veh:queueLuaCommand('electrics.values.throttleOverride = ' .. currentStepParameters.throttleValue/100)
end
if veh then
veh:queueLuaCommand('ai.stopFollowing()')
end
if veh then
veh:queueLuaCommand('electrics.values.throttleOverride = nil')
end
if currentStepParameters.aiType == "ScriptAi" then
veh:queueLuaCommand('ai.stopFollowing()') -- stop ai from AIing anytime it is involved in a crash
end
@/lua/ge/extensions/gameplay/taxi.lua
local function activateSignal(veh, rightForRightHand)
veh:queueLuaCommand('electrics.stop_turn_signal()')
local isRightHand = map.getRoadRules().rightHandDrive
local useRight = (isRightHand and rightForRightHand) or (not isRightHand and not rightForRightHand)
veh:queueLuaCommand('electrics.toggle_' .. (useRight and 'left' or 'right') .. '_signal()')
end
job.sleep(blinkersDuration)
veh:queueLuaCommand('electrics.stop_turn_signal()')
end, 1)
if state == "pullingOver" and taxiSpeed < maxPullOverSpeed then
veh:queueLuaCommand('electrics.set_warn_signal(1)')
if currentStep == steps.taxiPullingOver then
plVeh:queueLuaCommand('ai.driveUsingPath('..routeStr..')')
notifyBlinkerSysOfPullOver(veh:getID())
veh:queueLuaCommand('ai.setPullOver(true)')
end
local function setTrafficMode(veh)
veh:queueLuaCommand('ai.setPullOver(false)')
veh:queueLuaCommand('ai.setState({mode = "traffic"})')
veh:queueLuaCommand('ai.setPullOver(false)')
veh:queueLuaCommand('ai.setState({mode = "traffic"})')
end
@/lua/ge/extensions/career/modules/delivery/vehicleOfferManager.lua
offer.vehicle.vehId = vehId
veh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f)", mileage, career_modules_vehicleShopping.getVisualValueFromMileage(mileage)))
-- turn vehicle off
@/lua/ge/extensions/freeroam/specialTriggers.lua
if active and trigger.enterVehCommand then
getObjectByID(data.vehId):queueLuaCommand(trigger.enterVehCommand)
elseif not active and trigger.exitVehCommand then
elseif not active and trigger.exitVehCommand then
getObjectByID(data.vehId):queueLuaCommand(trigger.exitVehCommand)
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/aiParams.lua
if self.pinIn.risk.value ~= nil then
veh:queueLuaCommand('ai.setAggression('..clamp(self.pinIn.risk.value,0.1,2.0)..')')
end
if self.pinIn.routeSpeed.value ~= nil then
veh:queueLuaCommand('ai.setSpeed('..self.pinIn.routeSpeed.value..')')
end
if self.pinIn.routeMode.value ~= nil then
veh:queueLuaCommand('ai.setSpeedMode("'..self.pinIn.routeMode.value..'")')
end
if self.pinIn.drivabilityCO.value ~= nil then
veh:queueLuaCommand('ai.setCutOffDrivability('..self.pinIn.drivabilityCO.value..')')
end
if self.pinIn.inLane.value ~= nil then
veh:queueLuaCommand('ai.driveInLane("'..(self.pinIn.inLane.value and 'on' or 'off')..'")')
end
if self.pinIn.avoidCars.value ~= nil then
veh:queueLuaCommand('ai.setAvoidCars("'..(self.pinIn.avoidCars.value and 'on' or 'off')..'")')
end
if self.pinIn.forceRisk.value ~= nil then
veh:queueLuaCommand('ai.setAggressionMode("'..(self.pinIn.forceRisk.value and 'off' or 'rubberBand')..'")')
end
if self.pinIn.activateNitrous.value then
veh:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 1 end')
veh:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
veh:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 1 end')
veh:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
if nc then
else
veh:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
veh:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
veh:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
veh:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
if nc then
@/lua/ge/extensions/util/booster.lua
if veh then
veh:queueLuaCommand("extensions.core_booster.boost(vec3(0,0,1),0.01)")
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/directlyTo.lua
veh:queueLuaCommand('ai:scriptStop('..tostring(self.data.handBrakeWhenFinished)..','..tostring(self.data.straightenWheelsWhenFinished)..')')
end
local aiPath = {path = path}
veh:queueLuaCommand('ai.startFollowing(' .. serialize(aiPath) .. ', nil, 0, "neverReset")')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/flee.lua
local targetId = self.pinIn.targetId.value or be:getPlayerVehicleID(0)
veh:queueLuaCommand('ai.setMode("flee")')
veh:queueLuaCommand('ai.setTargetObjectID('..targetId..')')
veh:queueLuaCommand('ai.setMode("flee")')
veh:queueLuaCommand('ai.setTargetObjectID('..targetId..')')
end
@/lua/ge/extensions/career/modules/inspectVehicle.lua
core_vehicleBridge.executeAction(newVeh, 'setFreeze', true)
newVeh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f)", vehicleInfo.Mileage, career_modules_vehicleShopping.getVisualValueFromMileage(vehicleInfo.Mileage)))
return newVeh
@/lua/ge/extensions/core/vehicle/manager.lua
vehicle:queueLuaCommand('input.event("clutch", 0, 0)')
end
@/lua/ge/extensions/gameplay/traffic/roles/police.lua
if self.veh.isAi then
obj:queueLuaCommand('ai.setSpeedMode("off")')
obj:queueLuaCommand('ai.driveInLane("on")')
obj:queueLuaCommand('ai.setSpeedMode("off")')
obj:queueLuaCommand('ai.driveInLane("on")')
self.veh:setAiMode('chase')
obj:queueLuaCommand('electrics.set_lightbar_signal(2)')
self.sirenTimer = -1
self.veh:setAiMode('stop')
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_lightbar_signal(1)')
self:setAggression()
self.veh:setAiMode('chase')
getObjectByID(self.veh.id):queueLuaCommand('ai.driveInLane("off")')
self.driveInLane = false
self.veh:setAiMode('flee')
getObjectByID(self.veh.id):queueLuaCommand('ai.driveInLane("on")')
self.driveInLane = true
self.veh:setAiMode('stop')
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_lightbar_signal(2)')
end
-- TODO: this is a hack; we should enable the vehicle AI to naturally overtake traffic in lane mode
getObjectByID(self.veh.id):queueLuaCommand('ai.driveInLane("off")')
self.driveInLane = false
if targetVeh.pursuit.timers.main >= 8 or targetVeh.speed >= minSpeed + 5 then -- target is still driving, or target gained speed
getObjectByID(self.veh.id):queueLuaCommand('electrics.set_lightbar_signal(2)') -- fully turn on lights and sirens
self.sirenTimer = -1
@/lua/ge/extensions/flowgraph/nodes/environment/directionalGravity.lua
if veh then
veh:queueLuaCommand("obj:setPlanets({})")
end
command = command .. (mass) .. '})'
veh:queueLuaCommand(command)
self.planet.origin = origin
@/lua/ge/extensions/editor/drivePathEditor/playback.lua
for _, v in pairs(playing) do
v.vehicle.veh:queueLuaCommand('ai.setState({mode = "stop"})')
end
noOfLaps and tostring(noOfLaps) or "nil")
vehicle.veh:queueLuaCommand(command)
else -- CASE: NAV GRAPH MODE.
noOfLaps and tostring(noOfLaps) or "nil")
vehicle.veh:queueLuaCommand(luaCmd)
end
@/lua/ge/extensions/core/hotlapping.lua
veh:queueLuaCommand('ai.driveUsingPath({wpTargetList = '..serialize(route)..', noOfLaps = 1000, avoidCars = "on"})')
veh:queueLuaCommand('ai.setParameters({turnForceCoef = 4, awarenessForceCoef = 0.15})') -- slightly improves racing
veh:queueLuaCommand('ai.driveUsingPath({wpTargetList = '..serialize(route)..', noOfLaps = 1000, avoidCars = "on"})')
veh:queueLuaCommand('ai.setParameters({turnForceCoef = 4, awarenessForceCoef = 0.15})') -- slightly improves racing
if not veh.isHotlapping then
veh:queueLuaCommand('recovery.saveHome()')
veh:queueLuaCommand('ai.setAggression(0.9)') -- sets aggression once (the user could adjust it as desired later)
veh:queueLuaCommand('recovery.saveHome()')
veh:queueLuaCommand('ai.setAggression(0.9)') -- sets aggression once (the user could adjust it as desired later)
veh:setDynDataFieldbyName("isHotlapping", 0, "true")
if veh.isHotlapping then
veh:queueLuaCommand('ai.setMode("stop")')
if respawn then
veh:queueLuaCommand('recovery.loadHome()')
end
@/lua/ge/extensions/scenario/driftGoal.lua
if not fobjData and vehicle then
vehicle:queueLuaCommand('mapmgr.enableTracking("'..instance.vehicleName..'")')-- reset vehicle (tricky step to prevent executing setMode and initialition in the same time TODO
end
@/lua/ge/extensions/gameplay/skidpadTest.lua
-- Make the AI drive the route
vehicle:queueLuaCommand('ai.driveUsingPath(' .. serialize(config) .. ')')
return true
@/lua/ge/extensions/flowgraph/nodes/vehicle/boost.lua
if not self.loaded then
veh:queueLuaCommand('extensions.load("core_booster")')
self.loaded = true
end
veh:queueLuaCommand('core_booster.boost({'..(self.pinIn.power.value or 0) .. ',0,0},' .. (self.mgr.dtSim)..')')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/customVlua_string.lua
end
veh:queueLuaCommand(customLUAString)
@/lua/ge/extensions/flowgraph/nodes/vehicle/applyVelocity.lua
dirVec:setScaled(self.pinIn.coefficient.value or 1)
veh:queueLuaCommand("thrusters.applyVelocity("..serialize(dirVec)..")")
end
@/lua/ge/extensions/core/remoteController.lua
-- we reuse the outgauge extension for updating the user interface of the app
vehicle:queueLuaCommand('if outgauge then outgauge.sendPackage("' .. ip .. '", ' .. appPort .. ', ' .. orientation.w .. ') end')
end
@/lua/ge/extensions/editor/scriptAIEditor.lua
for vid, p in pairs(polyLinesToExecute) do -- Execute all the vehicle trajectories using the scriptAI backend.
scenetree.findObject(vid):queueLuaCommand('ai.startFollowing(' .. serialize(p) .. ')')
end
if vid ~= nil then
scenetree.findObject(vid):queueLuaCommand('ai.stopFollowing()')
end
if vwd.recordMode[i][0] == 2 then
scenetree.findObject(veh.vid):queueLuaCommand('ai.startRecording(true)') -- Record a speed-based script.
else
else
scenetree.findObject(veh.vid):queueLuaCommand('ai.startRecording()') -- Record a time-based script.
end
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(21, 21), nil, nil, nil, 'stopRecordingScript') then
scenetree.findObject(veh.vid):queueLuaCommand('obj:queueGameEngineLua("extensions.hook(\\"onVehicleSubmitRecording\\","..tostring(objectId)..","..serialize(ai.stopRecording())..")")')
stopExecute()
@/lua/vehicle/extensions/tech/techCore.lua
local targetName = request['target']
obj:queueGameEngineLua('scenetree.findObjectById(' .. obj:getID() .. '):queueLuaCommand("ai.setTargetObjectID(" .. scenetree.findObject(\'' .. targetName .. '\'):getID() .. ")")')
request:sendACK('AiTargetSet')
@/lua/ge/extensions/career/modules/painting.lua
if partName then
vehicleObject:queueLuaCommand(string.format("partCondition.setPartPaints(%s, %s, 0)", partName, serialize(chosenPaints)))
else
else
vehicleObject:queueLuaCommand(string.format("partCondition.setAllPartPaints(%s, 0)", serialize(chosenPaints)))
end
@/lua/ge/extensions/editor/trafficDebug.lua
local obj = getObjectByID(currVeh.id)
obj:queueLuaCommand("recovery.recoverInPlace()")
currVeh:onRefresh()
@/lua/ge/extensions/tech/techCore.lua
veh = scenetree.findObject(vid)
veh:queueLuaCommand(command)
command = 'extensions.load("' .. ext .. '")'
veh:queueLuaCommand(command)
end
]]
veh:queueLuaCommand(string.format(command, lpack.encode(tech_techCapture.export())))
end
command = string.format('tech_techCore.startConnection(\'%s\', %s)', tcomParams.ip, tostring(skipServer))
veh:queueLuaCommand(command)
return true
vehicleInfoPending[id] = true
veh:queueLuaCommand('extensions.load("tech/techCore")')
veh:queueLuaCommand('tech_techCore.requestVehicleInfo()')
veh:queueLuaCommand('extensions.load("tech/techCore")')
veh:queueLuaCommand('tech_techCore.requestVehicleInfo()')
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/getAIMode.lua
veh:queueLuaCommand(self:getCmd())
if self.returnedMode ~= nil then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/simpleFollowDecalroad.lua
veh:queueLuaCommand('ai.startFollowing(' .. serialize(self.path) .. ',nil,'..(self.pinIn.loopCount.value or -1)..',"'..self.data.loopMode..'")')
--dump('ai.startFollowing(' .. serialize(self.path) .. ',)')
veh:queueLuaCommand('ai.stopFollowing()')
self.running = false
@/lua/ge/extensions/core/trailerRespawn.lua
if core_vehicles.couplerTagsOptions[couplerTag] == "autoCouple" then
veh:queueLuaCommand(string.format('beamstate.activateAutoCoupling("%s")', couplerTag))
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/alignForCoupling.lua
v2:setTransform(res)
v2:queueLuaCommand('obj:requestReset(RESET_PHYSICS)')
v2:resetBrokenFlexMesh()
v2:resetBrokenFlexMesh()
v1:queueLuaCommand('beamstate.activateAutoCoupling()')
self.waitForCouple = true
@/lua/ge/extensions/gameplay/drag/utils.lua
if veh then
veh:queueLuaCommand('ai.setTarget("drag_stop")')
veh:queueLuaCommand('ai:scriptStop('..tostring(true)..','..tostring(true)..')')
veh:queueLuaCommand('ai.setTarget("drag_stop")')
veh:queueLuaCommand('ai:scriptStop('..tostring(true)..','..tostring(true)..')')
end
if not racer.isPlayable then
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
end
racer.vehObj:queueLuaCommand('ai.setState({mode = "manual"})')
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('ai.setState({mode = "manual"})')
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("set")')
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("set")')
racer.vehObj:queueLuaCommand('ai.setSpeed(0)')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("set")')
racer.vehObj:queueLuaCommand('ai.setSpeed(0)')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. aiMode .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeed(0)')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. aiMode .. '")')
racer.vehObj:queueLuaCommand('controller.setFreeze(0)')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. aiMode .. '")')
racer.vehObj:queueLuaCommand('controller.setFreeze(0)')
racer.vehObj:queueLuaCommand([[
racer.vehObj:queueLuaCommand('controller.setFreeze(0)')
racer.vehObj:queueLuaCommand([[
local nc = controller.getController("nitrousOxideInjection")
]])
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. aiSpeed .. ')')
racer.vehObj:queueLuaCommand('ai.setTarget("' .. aiTarget .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. aiSpeed .. ')')
racer.vehObj:queueLuaCommand('ai.setTarget("' .. aiTarget .. '")')
extensions.hook("stageStarted")
if distance > -5 and distance < -0.178 then
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. stageWaypoint.mode .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. stageWaypoint.speed .. ')')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. stageWaypoint.mode .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. stageWaypoint.speed .. ')')
elseif racer.beamState[racer.frontWheelId].stage then
if phase.timerOffset >= phase.startedOffset then
racer.vehObj:queueLuaCommand('ai.setState({mode = "manual"})')
racer.vehObj:queueLuaCommand('ai.setAggression(1)')
racer.vehObj:queueLuaCommand('ai.setState({mode = "manual"})')
racer.vehObj:queueLuaCommand('ai.setAggression(1)')
racer.vehObj:queueLuaCommand('ai.setParameters({understeerThrottleControl = "off", oversteerThrottleControl = "off", throttleTcs = "off"})')
racer.vehObj:queueLuaCommand('ai.setAggression(1)')
racer.vehObj:queueLuaCommand('ai.setParameters({understeerThrottleControl = "off", oversteerThrottleControl = "off", throttleTcs = "off"})')
racer.vehObj:queueLuaCommand([[
racer.vehObj:queueLuaCommand('ai.setParameters({understeerThrottleControl = "off", oversteerThrottleControl = "off", throttleTcs = "off"})')
racer.vehObj:queueLuaCommand([[
local ts = controller.getController("twoStep")
]])
racer.vehObj:queueLuaCommand([[
local tb = controller.getController("transbrake")
]])
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = 0.8')
extensions.hook("startDragCountdown", racer.vehId, dialsData[racer.vehId])
local aiTarget = endLine.name
racer.vehObj:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 1 end')
racer.vehObj:queueLuaCommand([[
racer.vehObj:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 1 end')
racer.vehObj:queueLuaCommand([[
local tb = controller.getController("transbrake")
]])
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. aiSpeed .. ')')
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. aiSpeed .. ')')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. aiMode .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. aiSpeed .. ')')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. aiMode .. '")')
racer.vehObj:queueLuaCommand('ai.setTarget("' .. aiTarget .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. aiMode .. '")')
racer.vehObj:queueLuaCommand('ai.setTarget("' .. aiTarget .. '")')
if phase.timerOffset >= phase.startedOffset then
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('ai.setState({mode = "manual"})')
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('ai.setState({mode = "manual"})')
racer.vehObj:queueLuaCommand('ai.setAggression(0.3)')
racer.vehObj:queueLuaCommand('ai.setState({mode = "manual"})')
racer.vehObj:queueLuaCommand('ai.setAggression(0.3)')
racer.vehObj:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
racer.vehObj:queueLuaCommand('ai.setAggression(0.3)')
racer.vehObj:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
racer.vehObj:queueLuaCommand([[
local nc = controller.getController("nitrousOxideInjection")
]])
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. spawnWaypoint.mode .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. (minVelToStop / 2) .. ')')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("' .. spawnWaypoint.mode .. '")')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. (minVelToStop / 2) .. ')')
racer.vehObj:queueLuaCommand('ai.setTarget("drag_stop")')
racer.vehObj:queueLuaCommand('ai.setSpeed(' .. (minVelToStop / 2) .. ')')
racer.vehObj:queueLuaCommand('ai.setTarget("drag_stop")')
if phase.timerOffset >= phase.startedOffset then
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
racer.vehObj:queueLuaCommand('electrics.values.throttleOverride = nil')
racer.vehObj:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
racer.vehObj:queueLuaCommand([[
local nc = controller.getController("nitrousOxideInjection")
racer.vehObj:queueLuaCommand('ai.setSpeedMode("set")')
racer.vehObj:queueLuaCommand('ai.setSpeed(0)')
racer.vehObj:queueLuaCommand('ai.setSpeedMode("set")')
racer.vehObj:queueLuaCommand('ai.setSpeed(0)')
@/lua/ge/ge_utils.lua
if not minVehId then
vehr:queueLuaCommand(callbackfct .. '(-1, -1)')
else
else
vehr:queueLuaCommand(callbackfct .. '(' .. minVehId .. ',' .. minDist .. ')')
end
local cmd = string.format('obj:queueGameEngineLua(string.format(%q, serialize({%s, unpack(%s)})))', geluaCommand, vluaCommand, serialize({...}))
veh:queueLuaCommand(cmd)
end
@/lua/ge/extensions/editor/drivePathEditor.lua
for _, veh in activeVehiclesIterator() do
veh:queueLuaCommand('ai.setState({mode = "stop"})')
end
@/lua/ge/extensions/flowgraph/nodes/debug/aiDebug.lua
if veh then
veh:queueLuaCommand('ai.setVehicleDebugMode({debugMode = "' .. mode .. '"})')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/freeze.lua
if veh then
--veh:queueLuaCommand('controller.setFreeze('..(self.pinIn.freeze.value and '1' or '0')..')')
core_vehicleBridge.executeAction(veh,'setFreeze', self.pinIn.freeze.value)
@/lua/ge/extensions/gameplay/parking.lua
getObjectByID(vehId):queueLuaCommand("electrics.setIgnitionLevel(0)")
if parkingSpot.customFields.tags.street then -- enables tracking, so that AI can try to avoid this vehicle
if not map.objects[vehId] then getObjectByID(vehId):queueLuaCommand("mapmgr.enableTracking()") end
else -- disables tracking, to optimize performance
else -- disables tracking, to optimize performance
getObjectByID(vehId):queueLuaCommand("mapmgr.disableTracking()")
end
@/lua/ge/map.lua
-- local aiData = {subjectName = args.subjectName, triggerName = args.triggerName, event = args.event, mode = args.mode}
-- args.subject:queueLuaCommand('ai.onWaypoint(' .. serialize(aiData) .. ')')
--print(l)
args.subject:queueLuaCommand(l)
@/lua/ge/extensions/editor/engineAudioDebug.lua
editor_engineAudioDebug.engine = {}
veh:queueLuaCommand([[
local data, names = sounds.getEngineSoundData();
if changed then
veh:queueLuaCommand([[
local engines = powertrain.getDevicesByCategory("engine");
@/lua/ge/extensions/freeroam/dragRace.lua
if playerPrestageReady == false then
opponentVehicle:queueLuaCommand('controller.setFreeze(1)')
log("D","setupPrestage", "setSpeed = 0" )
log("D","setupPrestage", "setSpeed = 0" )
opponentVehicle:queueLuaCommand('ai.setSpeed('.. 0 ..')')
else
-- player is ready, lets move the ai vehicle forward so it can start the staging process
opponentVehicle:queueLuaCommand('controller.setFreeze(0)')
log("D","setupPrestage", "setSpeed = 5" )
log("D","setupPrestage", "setSpeed = 5" )
opponentVehicle:queueLuaCommand('ai.setSpeed('.. 5 ..')')
end
end
opponentVehicle:queueLuaCommand('ai.setAggression('.. 0 ..')')
opponentVehicle:queLuaComuemand('controller.onGameplayEvent("freeroam_dragRace", "AI_prestage")') --moded controller support
lights.stageLights.stageLightL.obj:setHidden(false)
opponentVehicle:queueLuaCommand('controller.setFreeze(0)')
opponentVehicle:queueLuaCommand('ai.setAggression(0)')
opponentVehicle:queueLuaCommand('controller.setFreeze(0)')
opponentVehicle:queueLuaCommand('ai.setAggression(0)')
opponentVehicle:queueLuaCommand('ai.setSpeed(5)')
opponentVehicle:queueLuaCommand('ai.setAggression(0)')
opponentVehicle:queueLuaCommand('ai.setSpeed(5)')
opponentVehicle:queueLuaCommand('ai.setAvoidCars("on")')
opponentVehicle:queueLuaCommand('ai.setSpeed(5)')
opponentVehicle:queueLuaCommand('ai.setAvoidCars("on")')
opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_stage")') --moded controller support
opponentVehicle:queueLuaCommand('ai.setAvoidCars("on")')
opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_stage")') --moded controller support
log("D","setupStart", "AIAIAIAIAIAI")
opponentVehicle:queueLuaCommand('controller.setFreeze(1)')
opponentVehicle:queueLuaCommand('ai.setAggression(2)')
opponentVehicle:queueLuaCommand('controller.setFreeze(1)')
opponentVehicle:queueLuaCommand('ai.setAggression(2)')
opponentVehicle:queueLuaCommand('ai.setSpeed(nil)')
opponentVehicle:queueLuaCommand('ai.setAggression(2)')
opponentVehicle:queueLuaCommand('ai.setSpeed(nil)')
opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_setupStart")') --moded controller support
opponentVehicle:queueLuaCommand('ai.setSpeed(nil)')
opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_setupStart")') --moded controller support
log("D","setupStart", "setSpeed = NIL" )
log("D","startOpponent", "AIAIAIAIAIAI")
opponentVehicle:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 1 end')
opponentVehicle:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
opponentVehicle:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 1 end')
opponentVehicle:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
if nc then
end]])
opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_start")') --moded controller support
end
log("D","stopOpponent", "AIAIAIAIAIAI")
opponentVehicle:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
opponentVehicle:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
opponentVehicle:queueLuaCommand('if electrics.values.jatoInput then electrics.values.jatoInput = 0 end')
opponentVehicle:queueLuaCommand([[local nc = controller.getController("nitrousOxideInjection")
if nc then
end]])
opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_stop")') --moded controller support
opponentVehicle:queueLuaCommand('ai.setAvoidCars("on")')
opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_stop")') --moded controller support
opponentVehicle:queueLuaCommand('ai.setAvoidCars("on")')
end
resetDisplays()
opponentVehicle:queueLuaCommand('controller.setFreeze(0)')
startOpponent()
time = 0
opponentVehicle:queueLuaCommand('controller.setFreeze(0)')
startOpponent()
log("D","pre","JUMPED *****************************************************************")
opponentVehicle:queueLuaCommand('ai.setSpeed(0)')
opponentVehicle:queueLuaCommand('controller.setFreeze(1)')
opponentVehicle:queueLuaCommand('ai.setSpeed(0)')
opponentVehicle:queueLuaCommand('controller.setFreeze(1)')
stopOpponent()
setupStart()
opponentVehicle:queueLuaCommand('controller.setFreeze(0)')
startOpponent()
--dump(opponentVehicle.name)
opponentVehicle:queueLuaCommand('controller.setFreeze(0)')
--opponentVehicle:setField('canSave', '', 'false')
--opponentVehicle:setField('canSave', '', 'false')
-- opponentVehicle:queueLuaCommand('ai.setVehicleDebugMode({debugMode="trajectory"})')
end
table.remove(vehicles, i)
opponentVehicle:queueLuaCommand('ai.setSpeed(30)')
opponentVehicle:queueLuaCommand('ai.setSpeedMode("limit")')
opponentVehicle:queueLuaCommand('ai.setSpeed(30)')
opponentVehicle:queueLuaCommand('ai.setSpeedMode("limit")')
opponentVehicle:queueLuaCommand('ai.setAggression(0.5)')
opponentVehicle:queueLuaCommand('ai.setSpeedMode("limit")')
opponentVehicle:queueLuaCommand('ai.setAggression(0.5)')
stopOpponent()
init()
opponentVehicle:queueLuaCommand('ai.setSpeed(5)')
opponentVehicle:queueLuaCommand('ai.setSpeedMode("set")')
opponentVehicle:queueLuaCommand('ai.setSpeed(5)')
opponentVehicle:queueLuaCommand('ai.setSpeedMode("set")')
opponentVehicle:queueLuaCommand('ai.setAggression(0)')
opponentVehicle:queueLuaCommand('ai.setSpeedMode("set")')
opponentVehicle:queueLuaCommand('ai.setAggression(0)')
end
@/lua/ge/extensions/career/modules/vehicleShopping.lua
newVeh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f) obj:queueGameEngineLua('career_modules_vehicleShopping.onVehicleSpawnFinished(%d)')", vehicleInfo.Mileage, getVisualValueFromMileage(vehicleInfo.Mileage), newVeh:getID()))
return newVeh
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veGeneralData.lua
if im.Begin(wndName, windowOpen) then
vEditor.vehicle:queueLuaCommand([[
local data = {}
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/follow.lua
local targetId = self.pinIn.targetId.value or be:getPlayerVehicleID(0)
veh:queueLuaCommand('ai.setMode("follow")')
veh:queueLuaCommand('ai.setTargetObjectID('..targetId..')')
veh:queueLuaCommand('ai.setMode("follow")')
veh:queueLuaCommand('ai.setTargetObjectID('..targetId..')')
end
@/lua/ge/extensions/scenario/scenarios.lua
if bo then
bo:queueLuaCommand('controller.setFreeze('..tostring(state) ..')')
end
local carName = helper.getVehicleByName(vName)
carName:queueLuaCommand('controller.setFreeze(1)')
end
for vek, ve in pairs(vehicleConf.extensions) do
to.obj:queueLuaCommand('extensions.scenario_' .. vek .. '.onVehicleScenarioData(' .. serialize(ve) .. ')')
end
local carName = helper.getVehicleByName(vName)
carName:queueLuaCommand('controller.setFreeze(1)')
end
if vehicle then
vehicle:queueLuaCommand('electrics.set_lightbar_signal(0)')
end
@/lua/ge/extensions/editor/gen/decal.lua
-- lo('>> toTarget:'..tostring(car.target)..':'..tostring(ang))
-- veh:queueLuaCommand('ai.driveToTarget("'..car.target.x..'_'..car.target.y..'_'..car.pos.x..'_'..car.pos.y..'_'..car.vel.y..'_'..car.vel.y..'",0.1,0,0.2,"1")')
-- veh:queueLuaCommand('ai.driveCar('..ang..','..throttle..','..br..',0,1)')
end
-- local cvel = veh:getVelocity()
-- veh:queueLuaCommand('ai.driveToTarget("'..car.target.x..'_'..car.target.y..'_'..cpos.x..'_'..cpos.y..'_'..cvel.y..'_'..cvel.y..'",0.2,0,5,"1")')
-- input.event("throttle", 2, "FILTER_AI", nil, nil, nil, "ai")
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAeroDebug.lua
if wheelNameFL and wheelNameFR and wheelNameRL and wheelNameRR then
vEditor.vehicle:queueLuaCommand('aeroDebug.setWheelNames("' .. wheelNameFL .. '","' .. wheelNameFR .. '","' .. wheelNameRL .. '","' .. wheelNameRR .. '")')
end
if not vEditor.aeroData or (vEditor.aeroData and not (vEditor.aeroData.wheelNameStrings and vEditor.aeroData.totalAeroForce)) then
vEditor.vehicle:queueLuaCommand('extensions.aeroDebug.enable()')
end
vEditor.vehicle:queueLuaCommand('obj:queueGameEngineLua("vEditor.aeroData =" .. serialize(extensions.aeroDebug.getAeroData()))')
--if im.SliderFloat("wind", wind, -100, 100) then
-- vEditor.vehicle:queueLuaCommand('obj:setWind("' .. wind .. '", "' .. wind.y .. '", "' .. wind.z .. '" )')
--end
if oldVeh then
oldVeh:queueLuaCommand('extensions.aeroDebug.disable()')
end
if vEditor and vEditor.vehicle then
vEditor.vehicle:queueLuaCommand('extensions.aeroDebug.disable()')
end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veTCSDebug.lua
if im.Begin(wndName, windowOpen) then
vEditor.vehicle:queueLuaCommand([[
local escControllers = controller.getControllersByType("esc")
@/lua/ge/extensions/gameplay/traffic.lua
if stopAi and traffic[id].isAi then
obj:queueLuaCommand('ai.setMode("stop")')
end
@/lua/ge/extensions/flowgraph/nodes/environment/setWind.lua
for _, veh in ipairs(getAllVehicles()) do
veh:queueLuaCommand('obj:setWind(0, 0, 0)')
end
if not self.pinIn.vehId.value or self.pinIn.vehId.value == veh:getId() then
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
@/lua/console/resave-pcs.lua
io.write("\tresaving config " .. config .. "\n")
be:queueLuaCommand("partmgmt.loadLocal('" .. config .. "')")
be:queueLuaCommand("partmgmt.saveLocal('" .. config .. "')")
be:queueLuaCommand("partmgmt.loadLocal('" .. config .. "')")
be:queueLuaCommand("partmgmt.saveLocal('" .. config .. "')")
BeamEngine:update(2, 2)
@/lua/ge/extensions/scenario/speedGoal.lua
if not fobjData and vehicle then
vehicle:queueLuaCommand('mapmgr.enableTracking("'..instance.vehicleName..'")')-- reset vehicle (tricky step to prevent executing setMode and initialition in the same time TODO
goto continue
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/arrive.lua
if self.data.autoDisableOnArrive then
veh:queueLuaCommand('ai.setState({mode = "disabled"})')
end
if not self.sentCommand then
veh:queueLuaCommand('ai.setState({mode = "manual"})')
veh:queueLuaCommand('ai.setTarget("'..self.pinIn.waypointName.value..'")')
veh:queueLuaCommand('ai.setState({mode = "manual"})')
veh:queueLuaCommand('ai.setTarget("'..self.pinIn.waypointName.value..'")')
self.sentCommand = true
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/random.lua
veh:queueLuaCommand('ai.setState({mode = "random"})')
end
@/lua/ge/extensions/gameplay/discover/newPlayerExperience.lua
label = 'ui.inputActions.gameplay.recover_vehicle.title',
onClick = "getPlayerVehicle(0):queueLuaCommand('recovery.startRecovering() recovery.stopRecovering()')",
},
label = 'ui.common.ignition',
onClick = "getPlayerVehicle(0):queueLuaCommand('electrics.toggleIgnitionLevelOnDown() electrics.toggleIgnitionLevelOnUp()')",
},
dones[vehId] = true
veh:queueLuaCommand(setup)
log("I","discover","Setting up vehicle "..vehId.." with command: "..setup)
@/lua/ge/extensions/gameplay/race/race.lua
getObjectByID(id):queueLuaCommand('controller.setFreeze(false)')
getObjectByID(id):queueLuaCommand('ai.driveUsingPath('..str..')') -- this should ignore one-way roads
getObjectByID(id):queueLuaCommand('controller.setFreeze(false)')
getObjectByID(id):queueLuaCommand('ai.driveUsingPath('..str..')') -- this should ignore one-way roads
end
getObjectByID(id):queueLuaCommand('ai.setMode("stop")')
end
--veh:resetBrokenFlexMesh()
--veh:queueLuaCommand('recovery.recoverInPlace()')
end
if veh and self.states[id].isAiVeh then -- lower aggression past the finish line
veh:queueLuaCommand('ai.setAggression(0.5)')
end
if val >= 0 then
vehicle:queueLuaCommand('ai.setAggression('..val..')')
else
local aggr = self.states[id].baseAggression or 0.9
vehicle:queueLuaCommand('ai.setAggression('..aggr..')')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/stop.lua
veh:queueLuaCommand('ai.setState({mode = "stop"})')
end
@/lua/ge/main.lua
if core_environment then
v:queueLuaCommand("obj:setGravity("..core_environment.getGravity()..")")
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/traffic.lua
veh:queueLuaCommand('ai.setMode("traffic")')
end
@/lua/ge/extensions/scenario/quickRace.lua
if playerVehicle then
playerVehicle:queueLuaCommand("electrics.set_fog_lights(1) ; electrics.setLightsState(2)")
end
if playerVehicle then
playerVehicle:queueLuaCommand('controller.setFreeze(0)')
else
@/gameplay/missionTypes/chase/customNodes/suspectAiNode.lua
if race.aiPath and race.aiPath[1] then
veh:queueLuaCommand('ai.driveUsingPath({wpTargetList = '..serialize(race.aiPath)..'})')
end
json.recording.loopType = "firstOnlyTeleport"
veh:queueLuaCommand('ai.startFollowing(' .. serialize(json.recording) .. ')')
self.aiMode = 'script'
if map.getMap().nodes[self.pinIn.targetWaypoint.value] then
veh:queueLuaCommand('ai.setState({mode = "manual"})')
veh:queueLuaCommand('ai.setTarget("'..self.pinIn.targetWaypoint.value..'")')
veh:queueLuaCommand('ai.setState({mode = "manual"})')
veh:queueLuaCommand('ai.setTarget("'..self.pinIn.targetWaypoint.value..'")')
self.aiMode = 'waypoint'
else -- just uses flee mode as default
veh:queueLuaCommand('ai.setMode("flee")')
self.aiMode = 'flee'
if self.aiMode ~= 'flee' and self.pinIn.setFlee.value then
veh:queueLuaCommand('ai.setMode("flee")')
self.aiMode = 'flee'
if self.aiMode ~= 'stop' and self.pinIn.setStop.value then
veh:queueLuaCommand('ai.setMode("stop")')
self.aiMode = 'stop'
@/gameplay/missionTypes/evade/customNodes/multiVehicleLuaNode.lua
for _, id in ipairs(vehIds) do
getObjectByID(id):queueLuaCommand(self.pinIn.func.value or '')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/beamstate/couple.lua
if self.data.mode == 'toggle' then
veh:queueLuaCommand("beamstate.toggleCouplers()")
elseif self.data.mode == 'activate' then
elseif self.data.mode == 'activate' then
veh:queueLuaCommand("beamstate.activateAutoCoupling()")
elseif self.data.mode == 'disable' then
--veh:stopLatching()
veh:queueLuaCommand("beamstate.disableAutoCoupling()")
elseif self.data.mode == 'detach' then
elseif self.data.mode == 'detach' then
veh:queueLuaCommand("beamstate.detachCouplers()")
end
@/lua/ge/extensions/flowgraph/nodes/environment/planet.lua
if self.veh then
self.veh:queueLuaCommand("obj:setPlanets({})")
self.veh = nil
veh:queueLuaCommand(command)
@/lua/ge/extensions/flowgraph/nodes/vehicle/beamstate/breakgroup.lua
if self.pinIn.group.value == '*' then
veh:queueLuaCommand("beamstate.breakAllBreakgroups()")
else
for _,g in pairs(groups) do
veh:queueLuaCommand("beamstate.breakBreakGroup('" .. g .. "')")
end
@/lua/ge/extensions/core/sounds.lua
if not newVehicle then return end
newVehicle:queueLuaCommand("sounds.updateCabinFilter()")
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/vehicleAction.lua
if self.pinIn.down.value and self.action.onDown then
veh:queueLuaCommand(self:formatCommand(self.action.onDown))
end
if self.pinIn.change.value and self.action.onChange then
veh:queueLuaCommand(self:formatCommand(self.action.onChange))
end
if self.pinIn.up.value and self.action.onUp then
veh:queueLuaCommand(self:formatCommand(self.action.onUp))
end
@/lua/ge/extensions/util/screenshotCreator.lua
newVehicle:queueLuaCommand("input.event('parkingbrake', 1, 1)")
newVehicle:queueLuaCommand("input.event('throttle', 0, 2)")
newVehicle:queueLuaCommand("input.event('parkingbrake', 1, 1)")
newVehicle:queueLuaCommand("input.event('throttle', 0, 2)")
newVehicle:queueLuaCommand("controller.mainController.setEngineIgnition(false)")
newVehicle:queueLuaCommand("input.event('throttle', 0, 2)")
newVehicle:queueLuaCommand("controller.mainController.setEngineIgnition(false)")
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/followWaypoints.lua
veh:queueLuaCommand('ai.driveUsingPath({wpTargetList = ' .. serialize(aiPath) .. ', wpSpeeds = ' .. serialize(wpSpeeds) .. ', noOfLaps = ' .. self.lapCount .. ', aggression = 1})')
@/lua/ge/extensions/career/modules/vehiclePerformance.lua
getObjectByID(vehId):queueLuaCommand('damageTracker.registerDamageUpdateCallback(function(damageData, damageDataDelta) obj:queueGameEngineLua("career_modules_vehiclePerformance.onVehicleDamaged(" .. serialize(damageData) .. ", " .. serialize(damageDataDelta) .. ")") end)')
-- Make the AI drive the route
vehicle:queueLuaCommand('ai.driveUsingPath(' .. serialize(config) .. ')')
core_camera.setByName(0, 'orbit')
@/lua/ge/extensions/tech/impactgen/crashOutput.lua
if dmg > 10 then
veh:queueLuaCommand('input.event("throttle", 0, 1)')
veh:queueLuaCommand('input.event("brake", 0, 1)')
veh:queueLuaCommand('input.event("throttle", 0, 1)')
veh:queueLuaCommand('input.event("brake", 0, 1)')
veh:queueLuaCommand('input.event("parkingbrake", 1, 1)')
veh:queueLuaCommand('input.event("brake", 0, 1)')
veh:queueLuaCommand('input.event("parkingbrake", 1, 1)')
if other ~= nil then
other:queueLuaCommand('input.event("throttle", 0, 1)')
other:queueLuaCommand('input.event("parkingbrake", 1, 1)')
other:queueLuaCommand('input.event("throttle", 0, 1)')
other:queueLuaCommand('input.event("parkingbrake", 1, 1)')
end
other:queueLuaCommand('input.event("throttle", ' .. tostring(throttle) .. ', 1)')
other:queueLuaCommand('input.event("throttle", ' .. tostring(throttle) .. ', 1)')
if throttle > 0 then
ego:queueLuaCommand('input.event("throttle", ' .. tostring(throttle) .. ', 1)')
else
else
ego:queueLuaCommand('input.event("brake", ' .. tostring(-throttle) .. ', 1)')
end
if obj ~= nil and obj:getId() == vID then
obj:queueLuaCommand('extensions.load("tech/impactgen/damageEvaluation")')
spawnPending = nil
@/lua/ge/extensions/editor/suspensionAudioDebug.lua
if editor.beginWindow(wndName, wndName) then
veh:queueLuaCommand('obj:queueGameEngineLua("editor_suspensionAudioDebug.beamSounds =" .. serialize(sounds.getBeamSounds()))')
@/lua/ge/extensions/core/input/vibrationDebug.lua
if imgui.InputFloat("Wheel Slip Force Multiplier", wheelSlipForceMult, 0.1, 1.0, "%.2f") then
veh:queueLuaCommand("hydros.setWheelSlipForceMultiplier("..wheelSlipForceMult[0]..")")
end
if imgui.InputFloat("Jerk Force Multiplier", jerkForceMult, 0.1, 1.0, "%.2f") then
veh:queueLuaCommand("hydros.setJerkForceMultiplier("..jerkForceMult[0]..")")
end
if imgui.InputFloat("Wheel Slip Min", wheelSlipMin, 0.1, 1.0, "%.2f") then
veh:queueLuaCommand("hydros.setWheelSlipMin("..wheelSlipMin[0]..")")
end
if imgui.InputFloat("Jerk Min", jerkMin, 0.1, 1.0, "%.2f") then
veh:queueLuaCommand("hydros.setJerkMin("..jerkMin[0]..")")
end
@/lua/ge/extensions/career/modules/inventory.lua
inventoryIdAfterUpdatingPartConditions = inventoryId
vehicle:queueLuaCommand(string.format("if not partCondition.getConditions() then partCondition.initConditions() end obj:queueGameEngineLua('career_modules_inventory.updatePartConditions(%d, %d)')", vehId, inventoryId))
@/lua/ge/extensions/ui/uiNavi.lua
-- if veh then
-- veh:queueLuaCommand("mapmgr.enableTracking()")
-- end
-- if veh then
--veh:queueLuaCommand("mapmgr.enableTracking()")
-- end
@/lua/ge/extensions/gameplay/traffic/vehicle.lua
local obj = getObjectByID(self.id)
obj:queueLuaCommand('electrics.set_lightbar_signal(0)')
obj:queueLuaCommand('electrics.set_warn_signal(0)')
obj:queueLuaCommand('electrics.set_lightbar_signal(0)')
obj:queueLuaCommand('electrics.set_warn_signal(0)')
obj:queueLuaCommand('electrics.horn(false)')
obj:queueLuaCommand('electrics.set_warn_signal(0)')
obj:queueLuaCommand('electrics.horn(false)')
end
function C:honkHorn(duration) -- set horn with duration
getObjectByID(self.id):queueLuaCommand('electrics.horn(true)')
self.queuedFuncs.horn = {timer = duration or 1, vLua = 'electrics.horn(false)'}
-- assumes that vehicle has a lightbar...
getObjectByID(self.id):queueLuaCommand('electrics.set_lightbar_signal(2)')
local cmd = disableAfterUse and 'electrics.set_lightbar_signal(0)' or 'electrics.set_lightbar_signal(1)'
local obj = getObjectByID(self.id)
obj:queueLuaCommand(string.format('ai.setMode("%s")', mode))
if mode == 'traffic' then
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', self.vars.baseAggression))
obj:queueLuaCommand('ai.setSpeedMode("legal")')
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', self.vars.baseAggression))
obj:queueLuaCommand('ai.setSpeedMode("legal")')
obj:queueLuaCommand('ai.driveInLane("on")')
obj:queueLuaCommand('ai.setSpeedMode("legal")')
obj:queueLuaCommand('ai.driveInLane("on")')
elseif mode == 'random' or mode == 'flee' or mode == 'chase' then
if mode == 'flee' or mode == 'chase' then
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', max(0.8, self.vars.baseAggression)))
obj:queueLuaCommand('ai.setAggressionMode("off")')
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', max(0.8, self.vars.baseAggression)))
obj:queueLuaCommand('ai.setAggressionMode("off")')
else
else
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', self.vars.baseAggression))
end
end
obj:queueLuaCommand('ai.setSpeedMode("off")')
obj:queueLuaCommand('ai.driveInLane("off")')
obj:queueLuaCommand('ai.setSpeedMode("off")')
obj:queueLuaCommand('ai.driveInLane("off")')
end
obj:queueLuaCommand('ai.reset()')
end
local aggression = params.aggression or params.baseAggression
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', aggression))
end
if params.speedLimit >= 0 then
obj:queueLuaCommand('ai.setSpeedMode("limit")')
obj:queueLuaCommand(string.format('ai.setSpeed(%.3f)', params.speedLimit))
obj:queueLuaCommand('ai.setSpeedMode("limit")')
obj:queueLuaCommand(string.format('ai.setSpeed(%.3f)', params.speedLimit))
else -- force legal speed
else -- force legal speed
obj:queueLuaCommand('ai.setSpeedMode("legal")')
end
if params.aiAware then
obj:queueLuaCommand(string.format('ai.setAvoidCars("%s")', params.aiAware))
end
--obj:queueLuaCommand('ai.reset()') -- this is called to reset the AI plan
end
table.clear(self.queuedFuncs)
getObjectByID(self.id):queueLuaCommand('electrics.setLightsState(0)') -- always turn off headlights
self.headlights = false
if self.role.flags.freeze then
getObjectByID(self.id):queueLuaCommand('controller.setFreeze(0)')
self.role.flags.freeze = false
if self.vars.aiDebug == 'traffic' then
obj:queueLuaCommand('ai.setVehicleDebugMode({debugMode = "off"})')
else
else
obj:queueLuaCommand(string.format('ai.setVehicleDebugMode({debugMode = "%s"})', self.vars.aiDebug))
end
self.queuedFuncs.headlights = nil
getObjectByID(self.id):queueLuaCommand('electrics.setLightsState(0)')
self.headlights = false
if self.respawnSpeed then
-- obj:queueLuaCommand('thrusters.applyVelocity(obj:getDirectionVector() * '..(self.respawnSpeed * self.alpha)..')') -- makes vehicle start at speed
-- NOTE: test this to see if it can be enabled
else
getObjectByID(self.id):queueLuaCommand(v.vLua)
end
@/lua/ge/extensions/core/funstuff.lua
local function breakAllBreakgroups()
getPlayerVehicle(0):queueLuaCommand("beamstate.breakAllBreakgroups()")
return {"hide"}
local function breakHinges()
getPlayerVehicle(0):queueLuaCommand("beamstate.breakHinges()")
return {"hide"}
local function deflateTires()
getPlayerVehicle(0):queueLuaCommand("beamstate.deflateTires()")
return {"hide"}
local function deflateRandomTire()
getPlayerVehicle(0):queueLuaCommand("beamstate.deflateRandomTire()")
return {"hide"}
local function igniteVehicle()
getPlayerVehicle(0):queueLuaCommand("fire.igniteVehicle()")
return {"hide"}
local function extinguishVehicle()
getPlayerVehicle(0):queueLuaCommand("fire.extinguishVehicle()")
return {"hide"}
if vehicle then
vehicle:queueLuaCommand("fire.explodeVehicle()")
vehicle:queueLuaCommand("beamstate.breakAllBreakgroups()")
vehicle:queueLuaCommand("fire.explodeVehicle()")
vehicle:queueLuaCommand("beamstate.breakAllBreakgroups()")
end
@/lua/ge/extensions/flowgraph/nodes/mission/knockAwayCheck.lua
if not mapData then
getObjectByID(id):queueLuaCommand('mapmgr.enableTracking()')
end
@/lua/ge/extensions/core/windowsConsole.lua
if veh then
veh:queueLuaCommand(cmd)
end
@/lua/ge/extensions/core/vehicleBridge.lua
M.logCommand(veh, cmd)
veh:queueLuaCommand(cmd)
end
M.logCommand(veh, cmd)
veh:queueLuaCommand(cmd)
end
M.logCommand(veh, cmd)
veh:queueLuaCommand(cmd)
M.vehicleData[vehicleId].registeredCallbacks[electricsKey] = nil
M.logCommand(veh, cmd)
veh:queueLuaCommand(cmd)
end
@/lua/ge/extensions/util/saveDynamicData.lua
newVehicle:queueLuaCommand("extensions.load('dynamicVehicleData')")
be:setPhysicsSpeedFactor(physicsSpeedFactor)
--log('E', 'XXXXXXXXXXXXXXXXXXXX', "dynamicVehicleData.performTests(" .. serialize(vehName) .. "," .. serialize(config) .. ")")
newVehicle:queueLuaCommand("dynamicVehicleData.performTests(" .. serialize(vehName) .. "," .. serialize(config) .. ")")
@/lua/ge/extensions/editor/scriptAIManager.lua
bo:queueLuaCommand('ai.startFollowing(' .. serialize(recordings[vehId]) .. ')')
vehState[vehId] = 'playing'
local function stopPlaying(bo, vehId)
bo:queueLuaCommand('ai.stopFollowing()')
vehState[vehId] = 'idle'
local function startRecording(bo, vehId)
bo:queueLuaCommand('ai.startRecording()')
vehState[vehId] = 'recording'
local function stopRecording(bo, vehId)
bo:queueLuaCommand('obj:queueGameEngineLua("extensions.hook(\\"onVehicleSubmitRecording\\","..tostring(objectId)..","..serialize(ai.stopRecording())..")")')
vehState[vehId] = 'idle'
local vehId = bo:getId()
bo:queueLuaCommand('ai.scriptStop()')
vehState[vehId] = 'idle'
if im.MenuItem1('Reset Recording##'..vehId) then
bo:queueLuaCommand('ai.scriptStop()')
recordings[vehId] = nil
if im.MenuItem1('Reset Vehicle##'..vehId) then
bo:queueLuaCommand('obj:requestReset(RESET_PHYSICS)')
end
@/lua/ge/extensions/scenario/scenariohelper.lua
--sends the specified command to a vehicle of choice
local function queueLuaCommand(vehicle, command)
vehicle:queueLuaCommand(command)
local function queueLuaCommand(vehicle, command)
vehicle:queueLuaCommand(command)
end
if vehicle then
queueLuaCommand(vehicle, command)
else
local function breakBreakGroup(vehicleName, group)
queueLuaCommand(getVehicleByName(vehicleName), 'beamstate.breakBreakGroup("'..group..'")')
end
local function triggerDeformGroup(vehicleName, group)
queueLuaCommand(getVehicleByName(vehicleName), 'beamstate.triggerDeformGroup("'..group..'")')
end
@/lua/vehicle/bdebugImpl.lua
obj:queueGameEngineLua("getObjectByID(" .. obj:getID() .. "):queueLuaCommand('bdebug.recieveViewportSize('.. ui_imgui.GetMainViewport().Size.x .. ',' .. ui_imgui.GetMainViewport().Size.y .. ')' )")
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veCrashTester.lua
local veh = core_vehicles.spawnNewVehicle(randomVehData.model.key, {pos = spawnPos, rot = startDir})
veh:queueLuaCommand("input.event('parkingbrake', 0, 1)")
veh:applyClusterVelocityScaleAdd(veh:getRefNodeId(), 1, startVelocity.x, startVelocity.y, startVelocity.z)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veVehicleSpawner.lua
local veh = core_vehicles.spawnNewVehicle(vehData.model.key, {pos = spawnPos, rot = startDir})
veh:queueLuaCommand("input.event('parkingbrake', 0, 1)")
local veh = core_vehicles.spawnNewVehicle(vehData.model.key, {pos = spawnPos, rot = spawnRot})
veh:queueLuaCommand("input.event('parkingbrake', 0, 1)")
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua
-- Get nodes drawn in Vehicle Lua bdebug.lua
getPlayerVehicle(0):queueLuaCommand("bdebug.requestDrawnNodesGE('editor_vehicleEditor_liveEditor_veJBeamPicker.requestDrawnNodesCallback')")
if not nodesAvaliable then return end
-- Get beams drawn in Vehicle Lua bdebug.lua
getPlayerVehicle(0):queueLuaCommand("bdebug.requestDrawnBeamsGE('editor_vehicleEditor_liveEditor_veJBeamPicker.requestDrawnBeamsCallback')")
if not beamsAvaliable then return end
@/lua/ge/extensions/flowgraph/nodes/mission/ARunForLife.lua
if self.pinIn.cannon.value then
cannonProp:queueLuaCommand("custom_input.fire(1)")
self:getPropByName("cannon").decal.draw = false
@/lua/ge/extensions/flowgraph/modules/vehicleModule.lua
local setup = function()
veh:queueLuaCommand('mapmgr.enableTracking()')
veh:queueLuaCommand('mapmgr.requestMap()')
veh:queueLuaCommand('mapmgr.enableTracking()')
veh:queueLuaCommand('mapmgr.requestMap()')
end
-- instantly get the couple offsets
--veh:queueLuaCommand('beamstate.getCouplerOffset("core_flowgraphManager.getManagerByID('..self.mgr.id..').modules.vehicle:addCouplerOffset(%s,%s)")')
for tag, _ in pairs(couplerTags) do
-- instantly get the damage tracker
--veh:queueLuaCommand('damageTracker.registerDamageUpdateCallback(function(a,b) obj:queueGameEngineLua("core_flowgraphManager.getManagerByID('..self.mgr.id..'):broadcastCall(\'onVehiclePartDamageTracker\',"..obj:getId()..","..dumps(a)..","..dumps(b)..")") end)')
end
if veh then
-- veh:queueLuaCommand("controller.onGameplayEvent('bus_onTriggerTick',{id = "..id.."})")
end
if veh then
veh:queueLuaCommand("controller.onGameplayEvent('bus_onRouteChange'," .. serialize(data) .. ")")
end
if veh then
veh:queueLuaCommand("controller.onGameplayEvent('bus_onSetStopRequest'," .. serialize(data) .. ")")
end
@/lua/ge/extensions/core/vehicleTriggers.lua
if vehObj then
vehObj:queueLuaCommand(cmd)
if debugUIEnabled then
@/lua/ge/extensions/core/vehicles.lua
veh2:setTransform(mat)
--veh2:queueLuaCommand('obj:requestReset(RESET_PHYSICS)')
veh2:resetBrokenFlexMesh()
veh2:setTransform(mat)
--veh2:queueLuaCommand('obj:requestReset(RESET_PHYSICS)')
veh2:resetBrokenFlexMesh()
if M.couplerTagsOptions[vehCouplerTag] == "autoCouple" then
veh:queueLuaCommand(string.format('beamstate.activateAutoCoupling("%s")', vehCouplerTag))
end
@/gameplay/missionTypes/aiRace/customNodes/multiVehicleLuaNode.lua
for _, id in ipairs(vehIds) do
getObjectByID(id):queueLuaCommand(self.pinIn.func.value or '')
end
@/lua/ge/extensions/util/calibrateESC.lua
log("I", logTag, "Loading extension")
newVehicle:queueLuaCommand("extensions.load('escMeasurement')")
job.sleep(1)
--log('E', 'XXXXXXXXXXXXXXXXXXXX', "dynamicVehicleData.performTests(" .. serialize(vehName) .. "," .. serialize(config) .. ")")
newVehicle:queueLuaCommand("escMeasurement.performTests(" .. serialize(vehName) .. "," .. serialize(config) .. ")")
@/lua/ge/extensions/gameplay/traffic/roles/suspect.lua
self.veh:setAiMode('flee')
getObjectByID(self.veh.id):queueLuaCommand('controller.setFreeze(0)')
getObjectByID(self.veh.id):queueLuaCommand('ai.setAggressionMode("off")')
getObjectByID(self.veh.id):queueLuaCommand('controller.setFreeze(0)')
getObjectByID(self.veh.id):queueLuaCommand('ai.setAggressionMode("off")')
getObjectByID(self.veh.id):queueLuaCommand('ai.driveInLane("off")')
getObjectByID(self.veh.id):queueLuaCommand('ai.setAggressionMode("off")')
getObjectByID(self.veh.id):queueLuaCommand('ai.driveInLane("off")')
getObjectByID(self.veh.id):queueLuaCommand('ai.setSpeedMode("off")')
getObjectByID(self.veh.id):queueLuaCommand('ai.driveInLane("off")')
getObjectByID(self.veh.id):queueLuaCommand('ai.setSpeedMode("off")')
self:setAggression(0.8)
arrest = function ()
getObjectByID(self.veh.id):queueLuaCommand('controller.setFreeze(1)')
self.flags.freeze = 1
clear = function ()
getObjectByID(self.veh.id):queueLuaCommand('controller.setFreeze(0)')
self.flags.freeze = nil
@/lua/ge/extensions/gameplay/police.lua
if reset then
getObjectByID(v):queueLuaCommand("recovery.loadHome()")
end
if not veh then
obj:queueLuaCommand('controller.setFreeze(0)')
return
@/lua/ge/extensions/gameplay/discover/discover_037.lua
local windVec = vec3(25+random()*10,0,0)
v:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
local windVec = vec3(25+random()*10,0,0)
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
balls[i] = veh
local windVec = vec3(25+random()*10,0,0)
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
local windVec = vec3(25+random()*10,0,0)
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
table.insert(seq, util_stepHandler.makeStepReturnTrueFunction(function()
v:queueLuaCommand("fire.igniteVehicle()")
return true
table.insert(seq, util_stepHandler.makeStepReturnTrueFunction(function()
v:queueLuaCommand("fire.igniteVehicle()")
return true
if vehicle then
vehicle:queueLuaCommand("fire.explodeVehicle()")
vehicle:queueLuaCommand("beamstate.breakAllBreakgroups()")
vehicle:queueLuaCommand("fire.explodeVehicle()")
vehicle:queueLuaCommand("beamstate.breakAllBreakgroups()")
end
@/lua/ge/extensions/core/cameraModes/unicycle.lua
-- unicycle guiding
data.veh:queueLuaCommand("controller.getControllerSafe('playerController').setCameraControlData("..serialize({cameraRotation = rotHorizontal})..")")
return true
@/lua/ge/extensions/editor/aiTests.lua
obj:queueLuaCommand("ai.driveUsingPath({wpTargetList = "..serialize(path)..", avoidCars = 'off'})")
obj:queueLuaCommand("ai.setAggression("..aiParams.aggression..")")
obj:queueLuaCommand("ai.driveUsingPath({wpTargetList = "..serialize(path)..", avoidCars = 'off'})")
obj:queueLuaCommand("ai.setAggression("..aiParams.aggression..")")
obj:queueLuaCommand(string.format("ai.setParameters(%s)", serialize(aiParams)))
obj:queueLuaCommand("ai.setAggression("..aiParams.aggression..")")
obj:queueLuaCommand(string.format("ai.setParameters(%s)", serialize(aiParams)))
if options.aiDebug[0] then
obj:queueLuaCommand("ai.setVehicleDebugMode({debugMode = 'trajectory'})")
else
else
obj:queueLuaCommand("ai.setVehicleDebugMode({debugMode = 'off'})")
end
for k, v in pairs(vehicles) do
getObjectByID(k):queueLuaCommand("ai.setMode('stop')")
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/followPath.lua
if veh then
veh:queueLuaCommand('ai:scriptStop('..tostring(self.data.handBrakeWhenFinished)..','..tostring(self.data.straightenWheelsWhenFinished)..')')
end
--dumpz(path, 3)
veh:queueLuaCommand('ai.startFollowing(' .. serialize({path=path}) .. ',nil,'..loopCount..',"'..loopType..'")')
--dump('ai.startFollowing(' .. serialize(self.path) .. ',)')
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/customVlua.lua
end
veh:queueLuaCommand(self.pinIn.func.value)
self.pinOut.vehId.value = self.pinIn.vehId.value
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/customVehicleGetter.lua
if not self.done then
veh:queueLuaCommand(self:getCmd())
self.done = true
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePowerTrain.lua
if im.Begin(wndName, windowOpen) and vEditor and vEditor.vehicle then
vEditor.vehicle:queueLuaCommand([[
obj:queueGameEngineLua("vEditor.powertrainDevices =" .. powertrain.serializeDevicesInfo())]])
vEditor.powertrainDevices = nil
vEditor.vehicle:queueLuaCommand('obj:queueGameEngineLua("vEditor.resetDeviceString = true")')
end
@/lua/ge/extensions/core/checkpoints.lua
local callbackCommand = string.format('obj:queueGameEngineLua("if getObjectByID('..vehId..') then getObjectByID('..vehId..'):autoplace(false); core_checkpoints.completeReset(%u,%s) end")', vehId, "'"..vehicleName.."'")
vehicle:queueLuaCommand(callbackCommand)
local command = string.format("recovery.clear()")
local command = string.format("recovery.clear()")
vehicle:queueLuaCommand(command)
end
@/gameplay/missionTypes/evade/customNodes/autoStartPositionsNode.lua
sp:moveResetVehicleTo(vehId, false, true)
getObjectByID(vehId):queueLuaCommand("recovery.saveHome()")
break
@/lua/common/jbeam/loader.lua
if vehicleBundle.vdata.animation then
vehicleObj:queueLuaCommand('extensions.load("test_animationViz")')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/disable.lua
if self.data.useScriptStop then
veh:queueLuaCommand('ai:scriptStop('..tostring(self.data.handBrakeWhenFinished)..','..tostring(self.data.straightenWheelsWhenFinished)..')')
else
else
veh:queueLuaCommand('ai.setState({mode = "disabled"})')
end
@/lua/ge/extensions/editor/trafficManager.lua
if sessionData.aiType == "basic" then
veh:queueLuaCommand('ai.setMode("'..sessionData.aiMode..'")')
elseif sessionData.aiType == "target" then
elseif sessionData.aiType == "target" then
veh:queueLuaCommand('ai.setMode("manual")')
elseif sessionData.aiType == "script" then
script = script.recording or script
veh:queueLuaCommand('ai.startFollowing('..serialize(script)..')')
end
if targetVeh then
veh:queueLuaCommand('ai.setTargetObjectID('..targetVeh:getID()..')')
end
end
veh:queueLuaCommand('ai.setTarget("'..n1..'")')
end
if aiData.aggression ~= nil then
veh:queueLuaCommand('ai.setAggression('..aiData.aggression..')')
end
if aiData.driveInLane ~= nil then
veh:queueLuaCommand('ai.driveInLane("'..(aiData.driveInLane and 'on' or 'off')..'")')
end
if aiData.speed ~= nil then
veh:queueLuaCommand('ai.setSpeed('..aiData.speed..')')
end
if aiData.useSpeedLimit ~= nil then
veh:queueLuaCommand('ai.setSpeedMode("'..(aiData.useSpeedLimit and 'legal' or 'limit')..'")')
end
if aiData.avoidCars ~= nil then
veh:queueLuaCommand('ai.setAvoidCars("'..(aiData.avoidCars and 'on' or 'off')..'")')
end
veh:queueLuaCommand('ai.setMode("stop")')
gameplay_traffic.removeTraffic(sessionData.id)
veh:queueLuaCommand("mapmgr.enableTracking()") -- always enable tracking for vehicles in the traffic manager
spawn.safeTeleport(currVeh, sessionData.home.pos, sessionData.home.rot, nil, nil, false, true)
currVeh:queueLuaCommand('recovery.saveHome()')
sessionData._loaded = nil
else
currVeh:queueLuaCommand('recovery.loadHome()')
end
if editor.uiIconImageButton(editor.icons.home, imSizes.medium) then
currVeh:queueLuaCommand('recovery.saveHome()')
sessionData.home = {pos = currVeh:getPosition(), rot = quatFromDir(currVeh:getDirectionVector(), currVeh:getDirectionVectorUp())}
if scenetree.objectExists(id) and not data.locked then
getObjectByID(data.id):queueLuaCommand('recovery.loadHome()')
createVehicleData(data.id)
@/lua/ge/extensions/ui/console.lua
log("I", "exec", "GELua(Queue) < "..dumps(cmd))
Lua:queueLuaCommand(cmd)
end
log("I", "exec", "veh "..tostring(vid).." < "..dumps(cmd))
v:queueLuaCommand(cmd)
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/chase.lua
local targetId = self.pinIn.targetId.value or be:getPlayerVehicleID(0)
veh:queueLuaCommand('ai.setMode("chase")')
veh:queueLuaCommand('ai.setTargetObjectID('..targetId..')')
veh:queueLuaCommand('ai.setMode("chase")')
veh:queueLuaCommand('ai.setTargetObjectID('..targetId..')')
end
@/lua/ge/spawn.lua
veh2:setTransform(mat)
veh2:queueLuaCommand('obj:requestReset(RESET_PHYSICS)')
veh2:resetBrokenFlexMesh()
if core_vehicles.couplerTagsOptions[couplerTag] == "autoCouple" then
veh:queueLuaCommand(string.format('beamstate.activateAutoCoupling("%s")', couplerTag))
end
@/lua/ge/extensions/flowgraph/nodes/environment/simplePlanet.lua
if self.vehicle then
self.vehicle:queueLuaCommand("obj:setPlanets({})")
self.vehicle = nil
command = command .. (mass)..'})'
self.vehicle:queueLuaCommand(command)
end
@/lua/ge/extensions/gameplay/garageMode.lua
core_vehicleBridge.executeAction(playerVeh, 'setFreeze', false)
playerVeh:queueLuaCommand('ai.driveUsingPath({wpTargetList = {"garageExit"}})')
job.sleep(2)
@/lua/ge/extensions/tech/pythonExport.lua
]]
vehicle:queueLuaCommand(cmd)
end
@/lua/ge/extensions/flowgraph/modules/aiRecordingModule.lua
-- schedule the recording to be stopped and be sent from the vehicle to this module
veh:queueLuaCommand('obj:queueGameEngineLua("extensions.hook(\\"onVehicleSubmitRecordingForMission\\","..tostring(objectId)..","..serialize(ai.stopRecording())..")")')
end
print("stopping the ai replay")
veh:queueLuaCommand('ai:scriptStop(false, false)')
end
vehicleStates[veh:getId()] = 'recording'
veh:queueLuaCommand('ai.startRecording()')
end
vehicleStates[veh:getId()] = 'recording'
veh:queueLuaCommand('ai.startFollowing('..serialize(self.mgr.activity.startingOptions.aiPath)..', nil, nil, "noReset", true)')
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/goToEndLine.lua
if self.data.autoDisableOnArrive then
veh:queueLuaCommand('ai.setState({mode = "disabled"})')
end
if not self.sentCommand then
veh:queueLuaCommand('ai.setState({mode = "manual"})')
self.sentCommand = true