GE Lua Documentation

Press F to search!

dumpToFile

dumpToFile lets you use dump to write a file.

Definition


-- @/lua/common/utils.lua:879

--MARK: IO helpers

-- inspects the arguments and writes the output to the file
function dumpToFile(filename, ...)
  local f = io.open(filename, "w")
  if f then
    f:write(inspect(...))
    f:close()
    return true
  end
  return false
end

Callers

@/lua/vehicle/beamstate.lua
  local damageData = getPartDamageData()
  dumpToFile("partDamage.json", damageData)
end