GE Lua Documentation

Press F to search!

savePath

Definition


-- @/lua/ge/extensions/core/paths.lua:96

local function savePath(cameraPath, filename)
  local pathCopy = deepcopy(cameraPath)
  for index, marker in ipairs(pathCopy.markers) do
    marker.pos = {x = marker.pos.x, y = marker.pos.y, z = marker.pos.z}
    marker.rot = {x = marker.rot.x, y = marker.rot.y, z = marker.rot.z, w = marker.rot.w}
    marker.fov = marker.fov or 60
    marker.trackPosition = marker.trackPosition or false
    if marker.positionSmooth == defaultSplineSmoothing then
      marker.positionSmooth = nil
    end
    if marker.bullettime == 1 then
      marker.bullettime = nil
    end
  end

  -- Filter out things that dont have to be saved
  pathCopy.filename = nil
  pathCopy.dirty = nil
  pathCopy.id = nil

  pathCopy.version = "6"
  pathCopy.manualFov = pathCopy.manualFov or false
  pathCopy.looped = pathCopy.looped or false

  jsonWriteFile(filename, pathCopy, true)
  cameraPath.filename = filename
  cameraPath.dirty = false
end

Callers

@/lua/ge/extensions/editor/util/editorElementHelper.lua
          local cedit = editor_camPathEditor
          core_paths.savePath(editor_camPathEditor.currentPath, container.missionFolder .. fl)
        end
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
          local cedit = editor_camPathEditor
          core_paths.savePath(editor_camPathEditor.currentPath, mission.missionFolder .. fl)
        end
@/lua/ge/extensions/editor/camPathEditor.lua
        if M.currentPath.filename then
          core_paths.savePath(M.currentPath, M.currentPath.filename)
        else
          extensions.editor_fileDialog.saveFile(function(data)
            core_paths.savePath(M.currentPath, data.filepath)
          end, { { 'Camera Path Files', '.camPath.json' } }, false, currentLevelPath)
@/lua/ge/extensions/editor/crawlEditor/missionPortTool.lua
  local boundarySuccess = gameplay_crawl_saveSystem.saveBoundary(boundary, boundaryFile)
  local pathSuccess = gameplay_crawl_saveSystem.savePath(path, pathFile)
@/lua/ge/extensions/editor/crawlEditor.lua
    elseif objectType == "path" then
      gameplay_crawl_saveSystem.savePath(object, newFilePath)
    elseif objectType == "boundary" then
      path._missionName = nil
      gameplay_crawl_saveSystem.savePath(path, path._filePath)
    end
    if newObject then
      success = gameplay_crawl_saveSystem.savePath(newObject, filePath)
    end
            if path._dirty then
              if gameplay_crawl_saveSystem.savePath(path, path._filePath) then
                savedCount = savedCount + 1
            if path._dirty then
              if gameplay_crawl_saveSystem.savePath(path, path._filePath) then
                savedCount = savedCount + 1
          if selectedPath then
            if gameplay_crawl_saveSystem.savePath(selectedPath, selectedPath._filePath) then
              selectedPath._dirty = false