onUpdate
Definition
-- @/lua/ge/extensions/gameplay/police.lua:574
local function onUpdate(dt, dtSim)
if not M.enabled or not be:getEnabled() then return end
if gameplay_traffic.getState() ~= 'on' or not next(policeVehs) then
suspectActive = false
suspectTimer = math.huge
suspectTimerDelay = 60
return
else
if suspectTimer == math.huge and not suspectActive then
setSuspectTimer()
end
end
for id, veh in pairs(gameplay_traffic.getTrafficData()) do
local pursuit = veh.pursuit
local bestPoliceId, bestDist, bestInterDist = getNearestPoliceVehicle(id, true, true)
local addSightValue
local sightCoef = pursuit.mode + 2
if not bestPoliceId then
addSightValue = -dtSim * 0.25 -- no police visible, reduce sight value
else
local targetDist = min(bestDist, bestInterDist) -- police look ahead distance or police vehicle distance, whichever is better
addSightValue = (120 / targetDist) * dtSim * vars.strictness * sightCoef -- increments faster when nearer
end
pursuit.sightValue = clamp(pursuit.sightValue + addSightValue, 0, 1)
pursuit.policeVisible = pursuit.sightValue >= 0.5
local addScore = 0
if pursuit.addScore > 0 then
addScore = pursuit.addScore -- add score from pursuit infraction
else
if pursuit.mode >= 1 then
addScore = vars.strictness * min(10, veh.speed) * dtSim * 2 -- gradual increase during pursuit
end
end
pursuit.score = max(0, pursuit.score + addScore)
pursuit.addScore = 0
-- pursuit mode processing
if pursuit.mode >= 0 then
for i, score in ipairs(vars.scoreLevels) do
if pursuit.mode < i and pursuit.score >= score then
if pursuit.mode == 0 then -- activates only nearest police vehicle at start of pursuit
if not veh.queuedFuncs.pursuitStart then
local delay = clamp(15 / max(1e-12, veh.speed), 0, 1)
veh.queuedFuncs.pursuitStart = {timer = delay, func = setPursuitMode, args = {i, id, bestPoliceId}} -- small delay for lights & sirens
end
else
setPursuitMode(i, id)
end
break
end
end
end
-- active pursuit
if pursuit.mode ~= 0 then
--local legalSide = map.getRoadRules().rightHandDrive and -1 or 1
local arrestRadius = pursuit.policeVisible and vars.arrestRadius or 5 -- very small radius if police visibility is blocked, prevents false arresting
local evadeRadius = pursuit.policeVisible and 200 or vars.evadeRadius -- very large radius if police visibility is unblocked, prevents false evading
-- arrest
if pursuit.mode >= 1 then
if pursuit.timers.arrest >= vars.arrestTime then
arrestVehicle(id, gameplay_traffic.showMessages)
end
-- release
elseif pursuit.mode == -1 then
if (pursuit.timers.arrest <= -5 or not veh.role.flags.freeze) then
releaseVehicle(id, gameplay_traffic.showMessages)
end
if vars.autoRelease then
pursuit.timers.arrest = clamp(pursuit.timers.arrest - dtSim, -5, 0)
else
pursuit.timers.arrest = 0
end
end
if pursuit.mode >= 1 then
-- visible and within arrest distance
if bestPoliceId and bestDist < square(arrestRadius) then
if veh.speed <= 2.5 and policeVehs[bestPoliceId].speed <= 2.5 and bestDist < square(arrestRadius) then
pursuit.timers.arrest = min(vars.arrestTime, pursuit.timers.arrest + dtSim)
else
pursuit.timers.arrest = 0
end
pursuit.timers.evade = 0
else
if pursuit.mode == 3 then
-- roadblock logic
if vars.roadblockFrequency > 0 and pursuit.timers.roadblock == 0 then
local vehIds = {}
local count = 0
local spawnData
if not pursuit.roadblockPos or (pursuit.roadblockPos and veh.pos:squaredDistance(pursuit.roadblockPos) > 400) then
local minDist = 40 + 60 / max(0.001, gameplay_traffic.getTrafficVars().spawnValue)
for otherId, otherVeh in pairs(policeVehs) do -- first, check for police vehicles that are out of sight
if getObjectByID(otherId):getActive() and otherVeh.role.validTargets[id] and otherVeh.role.validTargets[id].dist > 10000
and otherVeh.focusDist > minDist and veh.focus.dirVec:dot(otherVeh.pos - veh.focus.pos) < 0 then
table.insert(vehIds, otherId)
end
count = count + 1
end
end
if vehIds[min(2, count)] then -- at least 2 vehicles, or 1 if it is the only one
spawnData = gameplay_traffic_trafficUtils.findSpawnPointOnRoute(veh.pos, veh.dirVec, 100, 300, 200, {pathRandomization = 0}) -- spawn point ahead of the target vehicle
if spawnData and spawnData.n1 then
local mapNodes = map.getMap().nodes
local rbWidth = math.min(mapNodes[spawnData.n1].radius, mapNodes[spawnData.n2].radius) * 2 + 1 -- road width, plus a small margin
local newVehIds, totalLength = checkRoadblock(vehIds, rbWidth) -- returns vehicles that can fit in the roadblock
local maxPropLength = 0
local newPropIds
if policePropIds[1] then
for i = #policePropIds, 1, -1 do -- validation
if not getObjectByID(policePropIds[i]) then
removeProp(policePropIds[i])
end
end
newPropIds = checkRoadblock(policePropIds, rbWidth, false)
for _, pid in ipairs(newPropIds) do
maxPropLength = max(maxPropLength, getObjectByID(pid).initialNodePosBB:getExtents().y)
end
end
pursuit.roadblockPos = vec3(spawnData.pos)
pursuit.roadblockNear = false
extensions.hook('onPursuitAction', id, 'roadblock', pursuit)
for _, vid in ipairs(newVehIds) do
local vehData = policeVehs[vid]
if vehData.state == 'fadeIn' or vehData.state == 'fadeOut' then -- ensures that vehicles have full mesh alpha
getObjectByID(vid):setMeshAlpha(1, '')
vehData.alpha = 1
vehData.state = 'active'
end
vehData:modifyRespawnValues(500) -- prevents the vehicles from respawning too quickly
vehData.role:setAction('roadblock')
end
local angle = 0 -- guessed angles
if rbWidth - totalLength > 2 then
angle = random(-20, 20)
elseif rbWidth - totalLength < 1 then
angle = random(30, 50) * sign2(random() - 0.5)
else
angle = random(-5, 5)
end
placeRoadblock(newVehIds, spawnData.pos, quatFromDir(spawnData.dir, spawnData.normal), {angle = angle, centerAngle = 0, width = rbWidth})
if newPropIds then
placeRoadblock(policePropIds, spawnData.pos - spawnData.dir * (maxPropLength * 0.5 + 2), quatFromDir(spawnData.dir, spawnData.normal), {angle = -90, width = rbWidth})
end
end
end
if spawnData then -- valid roadblock
pursuit.timers.roadblock = max(10, 60 - vars.roadblockFrequency * 60) -- time interval to test for the next roadblock
if count == 1 then
pursuit.timers.roadblock = pursuit.timers.roadblock + 20 -- if only one vehicle, add 20 seconds to the roadblock timer
end
else
pursuit.timers.roadblock = 1 -- bounce time until next roadblock check
end
end
end
if pursuit.timers.evade >= vars.evadeTime then
evadeVehicle(id, gameplay_traffic.showMessages)
end
if bestDist > square(evadeRadius) then
pursuit.timers.evade = min(vars.evadeTime, pursuit.timers.evade + dtSim)
elseif bestDist <= square(evadeRadius * 0.5) then
pursuit.timers.evade = 0
end
pursuit.timers.arrest = 0
end
end
if pursuit.mode == 3 and pursuit.timers.evadeValue < 0.5 then
pursuit.timers.roadblock = max(0, pursuit.timers.roadblock - dtSim)
else
pursuit.timers.roadblock = 1
end
if not pursuit.roadblockNear and pursuit.roadblockPos and veh.pos:squaredDistance(pursuit.roadblockPos) <= 400 then -- increment roadblock counter
pursuit.roadblocks = pursuit.roadblocks + 1
pursuit.roadblockNear = true
end
if pursuit.mode >= 1 then
pursuit.timers.main = pursuit.timers.main + dtSim
end
end
pursuit.timers.arrestValue = pursuit.mode ~= -1 and clamp(pursuit.timers.arrest / max(1e-12, vars.arrestTime), 0, 1) or 1
pursuit.timers.evadeValue = clamp(pursuit.timers.evade / max(1e-12, vars.evadeTime), 0, 1)
end
-- TODO: change this into a background activity
if gameplay_traffic.getTrafficVars().enableRandomEvents and vars.suspectFrequency > 0 then
if not suspectActive then
suspectTimer = max(0, suspectTimer - dtSim)
end
else
suspectActive = false
suspectTimer = math.huge
end
end
Callers
@/lua/ge/extensions/core/repository.lua
local function onUpdate(dt)
if progressQueueDirty then
@/lua/ge/extensions/core/remoteController.lua
local function onUpdate()
-- TODO: move to 1 fps
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamTableVis.lua
local function onUpdate(dt)
if not vEditor.vehicle then return end
@/lua/ge/extensions/core/schemeCommandServer.lua
local function onUpdate()
if not udpSocket then return end
@/lua/ge/extensions/gameplay/traffic/roles/police.lua
function C:onUpdate(dt, dtSim)
local targetVeh = self.targetId and gameplay_traffic.getTrafficData()[self.targetId]
@/lua/ge/extensions/gameplay/drift/stuntZones/nearPole.lua
function C:onUpdate(dtReal, dtSim)
if self.marker then
@/lua/ge/extensions/core/flowgraphManager.lua
local function onUpdate()
for _, mgr in ipairs(managers) do
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamVariablesChecker.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/gameplay/drift/bounds.lua
local function onUpdate()
isBeingDebugged = gameplay_drift_general.getExtensionDebug("gameplay_drift_bounds")
@/lua/ge/extensions/ui/extApp.lua
local function onUpdate()
if not server then return end
@/lua/ge/extensions/gameplay/crawl/general.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if M.activeTrail then
@/lua/ge/extensions/career/modules/fuel.lua
local uiFuelDataDeltaCounter = 0
local function onUpdate(dtReal, dtSim)
if showUI then
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veNodeTriSelfCollisionDetector.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/career/modules/insurance/insurance.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not gameplay_missions_missionManager.getForegroundMissionId() and not gameplay_walk.isWalking() and activeInsuranceId > 0 then -- we don't track when in a mission
@/lua/ge/extensions/tech/lidarTest.lua
-- Trigger execution to access the LiDAR test class in every update cycle.
local function onUpdate(dtReal, dtSim, dtRaw)
@/lua/ge/extensions/editor/mainUpdate.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if editor.active then
if editor.editMode and editor.editMode.onUpdate then
editor.editMode.onUpdate(dtReal, dtSim, dtRaw)
end
@/lua/ge/extensions/gameplay/drift/stuntZones/donut.lua
function C:onUpdate()
self:sendDecals()
@/lua/ge/extensions/gameplay/traffic/vehicle.lua
function C:onUpdate(dt, dtSim)
if not map.objects[self.id] then return end
self.role:onUpdate(dt, dtSim)
else
@/lua/ge/extensions/c2/panelPlugins/vehicleManager.lua
local function onUpdate(dt)
if not activeServer or not next(subscribers) then return end
@/lua/ge/extensions/gameplay/traffic/roles/suspect.lua
function C:onUpdate(dt, dtSim)
end
@/lua/ge/extensions/gameplay/missions/missionManager.lua
local debugApprove = false
local function onUpdate(dtReal, dtSim, dtRaw)
if showDebugWindow then
if mission._isOngoing then
mission:onUpdate(dtReal, dtSim, dtRaw)
end
@/lua/ge/extensions/career/modules/vehiclePerformance.lua
local function onUpdate(dtReal)
updateCameraZoom(dtReal)
@/lua/ge/extensions/tech/rawLidar.lua
-- This function is called in every frame, and contains the latest Raw LiDAR sensor readings.
local function onUpdate(dt, depth1, depth2, depth3, depth4, annot1, annot2, annot3, annot4)
userDLL.bng_rawLidar_onUpdate( -- Send the data to the user's .dll, in the per-frame update callback.
@/lua/ge/extensions/editor/camPathEditor.lua
local function onUpdate(dtReal, dtSim, dtRaw)
-- Update function - currently unused but kept for future functionality
@/lua/ge/extensions/core/input/vibrationDebug.lua
local function onUpdate()
imgui.Begin("Vibration Debug")
@/lua/ge/extensions/util/screenshotCreator.lua
local lastFrameImageResolution = {}
local function onUpdate(dtReal, dtSim, dtRaw)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/gameplay/rally/geometry.lua
local pacenotes = nil
local function onUpdate(dt, dtSim)
if core_groundMarkers.currentlyHasTarget() then
@/lua/ge/extensions/tech/rawLidarEmpty.lua
-- This function is called in every frame, and contains the latest Raw LiDAR sensor readings.
local function onUpdate(dt, depth1, depth2, depth3, depth4, annot1, annot2, annot3, annot4)
-- Your implementation goes here.
@/lua/ge/extensions/gameplay/traffic/roles/standard.lua
function C:onUpdate(dt, dtSim)
if self.state == 'disabled' then return end
@/lua/ge/extensions/ui/messagesDebugger.lua
-- Draw the debug window
local function onUpdate(dtReal, dtSim, dtRaw)
if not windowOpen[0] then return end
@/lua/ge/extensions/editor/gen/decal.lua
local function onUpdate(rayCast)
-- lo('?? D.unUpd:')
@/lua/ge/extensions/career/modules/logbook.lua
local function onUpdate()
playedLogbookSoundThisFrame = false
@/lua/ge/extensions/gameplay/rally/recceApp.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not enabled then return end
@/lua/ge/extensions/editor/gen/world.lua
local function onUpdate()
if _dbdrag then return end
if U._PRD == 0 and out.R then
out.R.onUpdate()
end
if U._PRD == 0 then
N.onUpdate()
done = M.onUpdate()
N.onUpdate()
done = M.onUpdate()
end
if Ter and not out.interr then
out.interr = Ter.onUpdate()
if out.interr then
if editor.isWindowVisible('LAT') and D then
local inroad = D.onUpdate()
if inroad then
elseif U._MODE == 'ter' and Ter and not out.interr then
out.interr = Ter.onUpdate()
if out.interr then return end
@/lua/ge/extensions/render/openxr.lua
local logStatePending = false
local function onUpdate(dtReal, dtSim, dtRaw)
if logStatePending then
@/lua/ge/extensions/career/career.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not careerActive then return end
@/lua/ge/extensions/gameplay/drag/times.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not dragData or not dragData.racers or dragData.isCompleted then return end
@/lua/ge/extensions/core/vehicleTriggers.lua
local hoveredTriggerId = {}
local function onUpdate(dtReal, dtSim, dtRaw)
if debugUIEnabled then
@/lua/ge/extensions/editor/audioEventsList.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not editor or not editor.beginWindow then return end
@/lua/ge/extensions/tech/utils.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not tech_license.isValid(path) then return end
@/lua/ge/extensions/career/modules/testDrive.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not vehicleId then return end
@/lua/ge/extensions/gameplay/drift/destination.lua
local function onUpdate()
isBeingDebugged = gameplay_drift_general.getExtensionDebug("gameplay_drift_destination")
@/lua/ge/extensions/core/vehicle/inplaceEdit.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not vBundle then
@/lua/ge/extensions/flowgraph/baseModule.lua
function C:clear() end
function C:onUpdate(dtReal, dtSim, dtRaw) end
function C:executionStopped() end
@/lua/ge/extensions/editor/missionStartPositionEditor.lua
local function onUpdate()
-- Get all missions in the current level
@/lua/ge/extensions/core/environment.lua
local function onUpdate()
local levelInfo = getObject("LevelInfo")
@/lua/ge/extensions/ui/apps/pointsBar.lua
local function onUpdate()
if not im then return end
@/lua/ge/extensions/gameplay/drift/freeroam/driftSpots.lua
local function onUpdate(dtReal, dtSim, dtRaw)
isBeingDebugged = gameplay_drift_general.getExtensionDebug("gameplay_drift_freeroam_driftSpots")
@/lua/ge/extensions/career/modules/marketplace.lua
local timeSinceUpdate = 0
local function onUpdate(dtReal, dtSim, dtRaw)
if tableIsEmpty(listedVehicles) or offerMenuOpen then
@/lua/ge/extensions/gameplay/parking.lua
local vehPos = vec3()
local function onUpdate(dt, dtSim)
if not active or not sites or not be:getEnabled() or freeroam_bigMapMode.bigMapActive() then return end
@/lua/ge/extensions/gameplay/drag/dragTypes/bracketRace.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if hasActivityStarted then
@/lua/ge/extensions/gameplay/taxi.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not be:getPlayerVehicle(0) then return end
@/lua/ge/extensions/gameplay/statistic.lua
local function onUpdate(dtReal, dtSim, dtRaw)
@/lua/ge/extensions/remoteControl/remoteControl.lua
local timer = 0
local function onUpdate(dtReal, dtSim, dtRaw)
timer = timer + dtReal
@/lua/ge/extensions/gameplay/walk.lua
local vehPos = vec3()
local function onUpdate(dtReal, dtSim)
local showMessage = false
@/lua/ge/extensions/gameplay/drift/drift.lua
local function onUpdate(dtReal, _dtSim, dtRaw)
dtSim = _dtSim
@/lua/ge/extensions/gameplay/crashTest/crashTestBoundaries.lua
local function onUpdate()
checkOutOfBounds(be:getPlayerVehicleID(0))
@/ui/ui-vue/src/services/UINavScalarEventsHandler.js
if (typeof onUpdate === "function") {
onUpdate({ axis: newAxis, direction: newDirection, oldDirection })
}
@/lua/ge/extensions/ui/vehiclePaint.lua
local function onUpdate()
if not showUI[0] then return end
@/lua/ge/extensions/ui/apps/genericMissionData.lua
local function onUpdate()
if not im then return end
@/lua/ge/extensions/core/gamestate.lua
local waitingForChangeUI = 0
local function onUpdate(dtReal, dtSim, dtRaw)
if #listeners == 0 or waitingForUIChangeToLoading then
@/lua/ge/extensions/ui/bindingsLegend.lua
local function onUpdate(dtReal, dtSim, dtRaw)
fadeUpdate(dtReal)
@/lua/ge/extensions/gameplay/rally/rallyManager.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
profilerPushEvent("rallyManager:onUpdate")
if self.vehicleTracker then
self.vehicleTracker:onUpdate(dtReal, dtSim, dtRaw)
end
if self.drivelineRoute then
self.drivelineRoute:onUpdate(dtReal, dtSim, dtRaw)
end
if self.audioManager then
self.audioManager:onUpdate(dtReal, dtSim, dtRaw)
end
@/lua/ge/extensions/flowgraph/nodes/activity/activityFlow.lua
end
function C:onUpdate(...)
if not self.mgr.activity then
@/lua/ge/extensions/editor/roadEditor.lua
local function onUpdate()
local rayCastHit
@/lua/ge/extensions/tech/ultrasonicTest.lua
-- Trigger execution to access the ultrasonic test class in every update cycle.
local function onUpdate(dtReal, dtSim, dtRaw)
@/lua/ge/extensions/gameplay/crashTest/crashTestCountdown.lua
local function onUpdate(dtReal, dtSim)
if timer > 0 then
@/lua/ge/extensions/gameplay/drift/scoreboard.lua
local function onUpdate()
if firstUpdateFrame then
@/lua/ge/extensions/gameplay/traffic/baseRole.lua
function C:onUpdate(dt, dtSim)
end
@/inspector/External/three.js/three.js
if ( texture.onUpdate ) texture.onUpdate( texture );
if ( texture.onUpdate ) texture.onUpdate( texture );
console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' );
return this;
@/gameplay/missionTypes/aiRace/customNodes/activateRaceNode.lua
if not self.pinIn.idle.value then
self.race:onUpdate(self.mgr.dtSim)
end
@/lua/ge/extensions/flowgraph/modules/driftModule.lua
function C:onUpdate()
for _, callbackData in pairs(self.callbacks) do
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/fileRace.lua
end
self.race:onUpdate(self.mgr.dtSim)
end
@/lua/ge/extensions/editor/gen/region.lua
local function onUpdate(inj)
D = inj.D
@/lua/ge/extensions/gameplay/drift/quickMessages.lua
local function onUpdate(dt)
if firstOnUpdate then
@/lua/ge/extensions/editor/veMain.lua
-- intentionally calling onUpdate 2 times to initialize editor (because of loading popup deferred initialization)
editor_main.onUpdate()
editor_main.onUpdate()
editor_main.onUpdate()
editor_main.onUpdate()
-- force call main update mainly for imgui layout state save
editor_main.onUpdate()
end
@/lua/ge/extensions/career/modules/spawnPoints.lua
local lastUpdateTimer = updateTime
local function onUpdate(dtReal, dtSim, dtRaw)
-- Check if an undiscovered spawn point is close
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veVehicleSpawner.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/c2/webSocketHandler.lua
local function onUpdate(dt)
if not server then return end
@/lua/ge/extensions/editor/vizHelper.lua
local function onUpdate()
Engine.Render.DynamicDecalMgr.addDecals(savedDecals)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua
local function onUpdate(dt)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/core/chat.lua
local function onUpdate()
--log('D', 'chat', 'onUpdate')
@/lua/ge/extensions/editor/meshEditor.lua
local function onUpdate()
hoveredMeshID = nil
@/lua/ge/extensions/core/multiseatCamera.lua
local function onUpdate()
local i = 0
@/lua/ge/extensions/core/versionUpdate.lua
local countdownWorkaround = 2
local function onUpdate()
countdownWorkaround = countdownWorkaround - 1
@/lua/ge/extensions/gameplay/util/damageAssessment.lua
local function onUpdate()
if debug then
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
-- shows either the main window, the drive window or nothing when a screenshot is taken.
local function onUpdate()
@/lua/ge/extensions/core/metrics.lua
end
local function onUpdate(dtReal, dtSim, dtRaw)
if M.currentMode == 0 then return end
@/lua/ge/extensions/flowgraph/manager.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
self.frameCount = self.frameCount + 1
for _, mod in ipairs(self.moduleOrder) do
self.modules[mod]:onUpdate(dtReal, dtSim, dtRaw)
end
@/lua/ge/extensions/core/dynamicProps.lua
local locationInfo
function DynamicProps:onUpdate()
local function onUpdate()
cameraPos = core_camera.getPosition()
for i = 1, #dynamicPropsObjs, 1 do
dynamicPropsObjs[i]:onUpdate()
end
@/lua/ge/extensions/editor/gen/network.lua
local function onUpdate()
-- pathsUp()
@/lua/ge/extensions/core/hotlapping.lua
local function onUpdate(dt, dtSim)
if editMode and pathData then
if raceData then
raceData:onUpdate(dtSim)
@/lua/ge/extensions/editor/decalEditor.lua
local function onUpdate()
local res = cameraMouseRayCast()
@/lua/ge/extensions/freeroam/crashCamMode.lua
local function onUpdate(dtReal, dtSim)
if not crashCamEnabled and not forcedEnabled then return end
@/lua/ge/extensions/gameplay/drag/dragTypes/dragPracticeRace.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if shouldClearAfterFinish then
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamBeautifier.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/freeroam/freeroam.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if worldReadyState == 0 then
@/lua/ge/extensions/gameplay/rally/loop/rallyLoopManager.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
profilerPushEvent("rallyLoopManager:onUpdate")
if self.roadSectionPenaltyKeeper then
self.roadSectionPenaltyKeeper:onUpdate()
end
@/lua/ge/extensions/util/stepHandler.lua
local dtTable = {}
local function onUpdate(dtReal, dtSim, dtRaw)
if showDebugWindow then
@/lua/ge/extensions/career/modules/delivery/vehicleTasks.lua
local toDeleteActiveTrailerIndexes = {}
local function onUpdate(dtReal, dtSim, dtRaw)
taskThatChangedThisFrame = nil
@/lua/ge/extensions/util/testExtensionProxies.lua
function ExtensionProxyTester:onUpdate(dtReal, dtSim, dtRaw)
print('ExtensionProxyTester:onUpdate called: ' .. tostring(self.id) .. ', ' .. tostring(dtReal))
--extProxy.hookProxies.onUpdate(123)
end
@/lua/ge/extensions/gameplay/drift/general.lua
local function onUpdate()
imguiDebug()
@/lua/ge/extensions/gameplay/drift/sounds.lua
local function onUpdate(dtReal, _dtSim, dtRaw)
dtSim = _dtSim
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veGeneralData.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/campaign/exploration.lua
-- executed every frame, also when not rendering 3d in the menu
local function onUpdate()
local campaign = campaign_campaigns and campaign_campaigns.getCampaign()
@/lua/ge/extensions/career/modules/delivery/parcelManager.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not dGeneral then return end
@/lua/ge/extensions/core/ropeVisualTest.lua
local function onUpdate(dt)
-- Update performance statistics
@/lua/ge/extensions/util/trackBuilder/splineTrack.lua
-- called every frame. when high quality is enabled, manages the timer on low quality track segments so they can be upgraded one after another.
local function onUpdate()
if not subTracks[subTrackIndex] or not highQuality or not markersShown then return end
@/lua/ge/extensions/freeroam/specialTriggers.lua
local function onUpdate(dt, dtSim)
if not next(triggers) then return end
@/lua/ge/extensions/career/modules/playerDriving.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if M.preStart and freeroam_specialTriggers and playerData.traffic then -- this cycles all lights triggers, to eliminate lag spikes (move this code later)
@/lua/ge/extensions/gameplay/drift/stuntZones/driftThrough.lua
function C:onUpdate()
self:sendDecals()
@/lua/ge/extensions/core/audioRibbon.lua
-- Frame update
local function onUpdate(dtReal, dtSim, dtRaw)
if not ribbons or #ribbons < 1 then
@/lua/ge/extensions/editor/rallyEditor.lua
devTools:draw()
devTools:onUpdate() -- Call onUpdate to handle 3D debug drawing
im.End()
-- local function onUpdate(dtReal, dtSim, dtRaw)
-- end
@/gameplay/missions/gridmap_v2/aiRace/001-grindergrandprix/script.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
-- Loop through all spinners and update their timers
@/lua/ge/extensions/util/vehicleRopeDebug.lua
-- Main update function
local function onUpdate(dt)
-- Update performance statistics
@/lua/ge/extensions/ui/console.lua
local previouslyShown
local function onUpdate(dtReal, dtSim, dtRaw)
if windowOpen[0] ~= true then
@/lua/ge/extensions/gameplay/drift/stuntZones/hitPole.lua
function C:onUpdate(dtReal, dtSim)
if self.marker then
@/lua/ge/extensions/gameplay/rally/loop/roadSectionPenaltyKeeper.lua
function C:onUpdate()
local currentTime = self.manager.clock
@/lua/ge/extensions/gameplay/crawl/utils.lua
if core_lapTimes then
core_lapTimes.onUpdate(0, dtSim, 0)
end
@/lua/ge/extensions/career/modules/rentals.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if isRenting() then
@/lua/ge/extensions/gameplay/rally.lua
local lastTime = 0
local function onUpdate(dtReal, dtSim, dtRaw)
profilerPushEvent("gameplay_rally - onUpdate")
-- gcprobe()
RecceApp.onUpdate(dtReal, dtSim, dtRaw)
-- gcprobe()
if rallyManager and not RecceApp.isRecording() then
rallyManager:onUpdate(dtReal, dtSim, dtRaw)
end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veRawData.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/gameplay/rally/audioManager.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
profilerPushEvent("AudioManager - onUpdate")
@/lua/ge/extensions/gameplay/drift/stallingSystem.lua
local function onUpdate()
imguiDebug()
@/lua/ge/extensions/editor/gen/terrain.lua
local function onUpdate()
-- if true then return end
@/lua/ge/extensions/career/modules/inventory.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if saveCareer then
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua
local function onUpdate(dt)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/core/vehicle/mirror.lua
local function onUpdate(dtReal, dtSim, dtRaw)
@/lua/ge/extensions/gameplay/drift/freeroam/cruising.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if gameplay_drift_general.getGeneralDebug() then profiler:start() end
@/lua/ge/extensions/tech/platoonFunctions.lua
local function onUpdate(dtReal, dtSim, dtRaw)
local distance
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePowerTrain.lua
local function onUpdate(dt)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/gameplay/missions/missionTypes/baseMission.lua
-- called each frame
function C:onUpdate(dtReal, dtSim, dtRaw) end
-- called when the activity stops. attempt might be nil
@/lua/ge/extensions/render/viewDemo.lua
local function onUpdate(dtReal, dtSim, dtRaw)
timer = timer + dtSim
@/lua/ge/extensions/career/modules/inspectVehicle.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not testDriveVehInfo then return end
@/lua/ge/extensions/gameplay/drag/debug.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if debugMenu then
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veLightsDebug.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAeroDebug.lua
local function onUpdate(dt)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/flowgraph/modules/vehicleModule.lua
function C:onUpdate()
for _, id in ipairs(self.sortedIds) do
@/lua/ge/extensions/gameplay/traffic.lua
if veh then
veh:onUpdate(dt, dtSim)
local function onUpdate(dtReal, dtSim)
if state == 'loading' then
@/lua/ge/extensions/core/quickAccess.lua
local function onUpdate()
-- logic for the menu assembling timeout
@/lua/ge/extensions/statistics/statistics.lua
local function onUpdate()
local scenario = scenario_scenarios and scenario_scenarios.getScenario()
@/lua/ge/extensions/gameplay/forceField.lua
local lastUpdateTimer = updateTime
local function onUpdate(dtReal, dtSim, dtRaw)
lastUpdateTimer = lastUpdateTimer + dtSim
@/lua/ge/extensions/core/vehicle/partmgmt.lua
local function onUpdate(dt)
if partsSelectorChangedTime then
@/lua/ge/extensions/gameplay/race/race.lua
function C:onUpdate(dt)
if not self.started then return end
@/lua/ge/extensions/util/wsTest.lua
local function onUpdate()
if not server then return end
@/lua/ge/extensions/gameplay/garageMode.lua
local function onUpdate(dtReal)
if not active then return end
@/gameplay/missions/gridmap_v2/collection/002-blenderbowl/script.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
-- Loop through all spinners and update their timers
@/lua/ge/extensions/freeroam/bigMapMode.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not bigMap then return end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAdjustableTechCarTuner.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/gameplay/drift/display.lua
local function onUpdate(dtReal, dtSim, dtRaw)
imguiDebug()
@/lua/ge/extensions/gameplay/util/crashDetection.lua
local vehIdList = {}
local function onUpdate(dtReal, _dtSim)
@/lua/ge/extensions/gameplay/crashTest/scenarioManager.lua
local function onUpdate(dtReal, dtSim)
if not crashTestData.scenarioFinished then
@/lua/ge/extensions/career/modules/delivery/generator.lua
local function onUpdate(dtReal, dtSim, dtRaw)
hasGeneratedThisFrame = false
@/lua/ge/extensions/core/vehicle/manager.lua
local function onUpdate()
spawn.clearCache()
@/lua/ge/extensions/gameplay/rally/driveline/drivelineRoute.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
profilerPushEvent("DrivelineRoute - onUpdate")
@/lua/ge/extensions/career/modules/loanerVehicles.lua
local playerPos = vec3()
local function onUpdate(dtReal, dtSim, dtRaw)
for inventoryId, vehId in pairs(career_modules_inventory.getMapInventoryIdToVehId()) do
@/lua/ge/extensions/career/modules/vehicleShopping.lua
local currentUiState
local function onUpdate()
if tableIsEmpty(vehicleWatchlist) or (currentUiState and currentUiState ~= "play") then return end
@/lua/ge/extensions/editor/trafficManager.lua
local function onUpdate(dt, dtSim)
if not session then return end
@/lua/ge/extensions/gameplay/backgroundActivities/g2g.lua
local lastUpdateTimer = updateTime
local function onUpdate(dtReal, dtSim, dtRaw)
end
@/lua/ge/extensions/ui/apps/minimap/additionalInfo.lua
local function onUpdate()
checkRoute()
@/lua/ge/extensions/util/nodeStream.lua
local function onUpdate(dt)
if not server then
@/lua/ge/extensions/ui/gameplayAppContainers.lua
-- Update function for dtSim timer accumulation and queue processing
local function onUpdate(dtReal, dtSim, dtRaw)
-- Process current flash message timer using dtSim (pauses with game simulation)
@/lua/ge/extensions/editor/api/dynamicDecals.lua
app.textureSet = decalProjection:getTextureSet()
app:onUpdate()
profilerPushEvent('dynamicDecals/app:onUpdate_()')
app:onUpdate()
profilerPopEvent('dynamicDecals/app:onUpdate_()')
-- force to refresh the new vehicle shape
if(app) then app.onUpdate() end
M.updateVehicleMaterials()
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePropTransformer.lua
local function onUpdate(dt)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/core/couplerCameraModifier.lua
local function onUpdate()
local vehicleId = be:getPlayerVehicleID(0)
@/lua/ge/extensions/flowgraph/modules/timerModule.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
self.globalTime.real = self.globalTime.real + dtReal
@/lua/ge/extensions/core/trafficSignals.lua
local function onUpdate(dt, dtSim)
if not loaded then return end
@/lua/ge/extensions/gameplay/rally/vehicleTracker.lua
-- function C:onUpdate(dt, raceData)
function C:onUpdate(dtReal, dtSim, dtRaw)
-- function C:onUpdate(dt, raceData)
function C:onUpdate(dtReal, dtSim, dtRaw)
profilerPushEvent("VehicleTracker - onUpdate")
@/lua/ge/extensions/editor/buildingEditor.lua
local function onUpdate()
W.onUpdate()
local function onUpdate()
W.onUpdate()
if not ishit then
-- D.onUpdate()
end
if U._PRD==0 and not ishit then
D.onUpdate()
R.onUpdate({D = D, W = W})
D.onUpdate()
R.onUpdate({D = D, W = W})
end
@/gameplay/missions/italy/arrive/012-Field/script.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
if not self.readyFlag then
@/lua/ge/extensions/tech/sensors.lua
local function onUpdate(dtReal, dtSim, dtRaw)
-- Send the data to the user's lua update callback.
d.fileRef.onUpdate(
dtSim,
@/lua/ge/extensions/editor/main.lua
local function onUpdate()
-- if there is a toggle editor request
@/lua/ge/extensions/gameplay/drift/stuntZones.lua
local function onUpdate(dtReal, dtSim, dtRaw)
pos:set(gameplay_drift_drift.getVehPos() or vec3(0,0,0))
if stuntZone.onUpdate then stuntZone:onUpdate(dtReal, dtSim) end
@/lua/ge/extensions/tech/adasUltrasonic.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not loaded then
@/lua/ge/extensions/gameplay/missions/missionTypes/flowMission.lua
-- update each frame
function C:onUpdate(dtReal, dtSim, dtRaw)
--self.mgr:broadcastCall('onUpdate', dtReal, dtSim, dtRaw)
if self.script and self.script.onUpdate then
self.script:onUpdate(dtReal, dtSim, dtRaw)
end
@/lua/ge/extensions/career/modules/tether.lua
local remove = false
local function onUpdate()
for _, t in ipairs(tethers) do
@/lua/ge/extensions/career/modules/vehicleDeletionService.lua
local camDir = vec3()
local function onUpdate()
for vehId, data in pairs(flaggedVehicles) do
@/lua/ge/extensions/career/modules/partInventory.lua
local addNewVehiclePartsInventoryId
local function onUpdate()
-- Add a new vehicles' parts to the inventory
@/lua/ge/extensions/util/groundModelDebug.lua
local axisToDraw = false -- x axis, vs y axis
local function onUpdate(dt)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veTCSDebug.lua
local function onUpdate(dt)
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veCrashTester.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/core/jobsystem.lua
local dtTable = {dtReal = 0, dtSim = 0, dtRaw = 0}
local function onUpdate(dtReal, dtSim, dtRaw)
dtTable.dtReal = dtReal
@/lua/ge/extensions/gameplay/rally/tools/devTools.lua
function C:onUpdate()
-- Only draw debug visualizations when the Pacenotes Tools section is expanded
-- self.drivelineRoute:onUpdate()
-- self.drivelineRoute:drawDebugDrivelineRoute()
@/lua/ge/extensions/gameplay/drag/display.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not gameplay_drag_general then return end
@/lua/ge/extensions/gameplay/drag/dragTypes/headsUpDrag.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if hasActivityStarted then
@/lua/ge/extensions/util/maptiles.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if not renderView then
@/lua/ge/extensions/ui/cameraDistanceApp.lua
local function onUpdate(dtReal, dtSim, dtRaw)
-- TODO: convert into stream
@/lua/ge/extensions/gameplay/rallyLoop.lua
local function onUpdate(dtReal, dtSim, dtRaw)
profilerPushEvent("gameplay_rallyLoop - onUpdate")
if rallyLoopManager then
rallyLoopManager:onUpdate(dtReal, dtSim, dtRaw)
@/lua/ge/extensions/flowgraph/nodes/events/onUpdate.lua
function C:onUpdate(dtReal, dtSim, dtRaw)
self.pinOut.flow.value = true
@/lua/ge/extensions/editor/raceEditor/testing.lua
elseif self.state == 'race' then
self.race:onUpdate(dt)
self:drawRace()
@/lua/ge/extensions/core/lapTimes.lua
-- Main update function (called from extension system)
local function onUpdate(dtReal, dtSim, dtRaw)
-- Only send streams when flagged - data is already prepared by updateXFromRace functions
@/lua/common/extensions/ui/improfiler.lua
function M.onUpdate(dtReal, dtSim, dtRaw)
if im.Begin("LuaJIT Profiler", windowOpen) then
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamSpellchecker.lua
local function onUpdate()
if windowOpen[0] ~= true then return end
@/lua/ge/extensions/ui/messagesTasksAppContainers.lua
local function onUpdate()
if not debug or not im then
@/lua/ge/extensions/gameplay/drift/scoring.lua
local function onUpdate(dtReal, _dtSim)
dtSim = _dtSim