GE Lua Documentation

Press F to search!

onReplayStateChanged

Definition


-- @/lua/ge/extensions/core/camera.lua:1732

M.onReplayStateChanged = function(newState)
  if newState.state and newState.state == 'inactive' and newState.state ~= M.previousReplayStateName then
    -- Due to the replay system destroying vehicles that are in the scene but not in the video it is about to play, the camera system
    -- responds to the onDestroyVehicle callback by removing entries from the vehicle cache. This is a destructive change that the camera system
    -- cannot recover from when the replay is over and "ejected".
    -- This is particularlly important when trying to return to the game state as it was BEFORE playing a replay video.
    -- The vehicles that were removed are returned to the scene somehow but the cache is not updated. Investigate why later.
    vehicleCamerasCache = nil
  end

  M.previousReplayStateName = newState.state
end

Callers

@/lua/ge/extensions/flowgraph/nodes/recording/recordReplay.lua

function C:onReplayStateChanged(state)
  if state.state == 'recording' then
@/lua/ge/extensions/freeroam/crashCamMode.lua

local function onReplayStateChanged(state)
  toggleActionCam(false)
@/lua/ge/extensions/flowgraph/modules/missionReplayModule.lua
local currentMissionReplayFiles = nil
function C:onReplayStateChanged(state)
  if lastFrameState ~= "playback" and state.state == "playback" then