GE Lua Documentation

Press F to search!

getTimeOfDay

Definition


-- @/lua/ge/extensions/core/environment.lua:161
local function getTimeOfDay()
  local timeObj = getObject("TimeOfDay")
  if timeObj then
    timeOfDay.time = timeObj.time
    timeOfDay.play = timeObj.play
    timeOfDay.dayScale = timeObj.dayScale
    timeOfDay.azimuthOverride = timeObj.azimuthOverride
    timeOfDay.nightScale = timeObj.nightScale
    timeOfDay.dayLength = timeObj.dayLength
    timeOfDay.startTime = timeObj.startTime
    return timeOfDay
  end
end

Callers

@/lua/ge/screenshot.lua
  if core_environment then
    res.tod = core_environment.getTimeOfDay()
  end
@/lua/ge/extensions/core/quickAccess.lua
      -- Get current time from environment service
      local timeOfDay = core_environment.getTimeOfDay()
      local currentTime = timeOfDay and timeOfDay.time or 0
        onSelect = function()
          local timeOfDay = core_environment.getTimeOfDay()
          if timeOfDay then
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
    if im.BeginCombo("##todSelector", "...") then
      if core_environment and core_environment.getTimeOfDay() then
        if im.Selectable1("Default##todSelector") then
        if im.Selectable1("Now##todSelector") then
          local now = core_environment.getTimeOfDay().time
          self.todInput[0] = now
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
local function timeSettings()
  local tod = core_environment.getTimeOfDay()
  core_environment.setTimeOfDay(tod)
@/lua/ge/extensions/flowgraph/nodes/environment/setScatterSky.lua
  --  This is needed to update the gradients
  local tod = core_environment.getTimeOfDay()
  core_environment.setTimeOfDay(tod)
@/lua/ge/extensions/flowgraph/nodes/environment/setTimeOfDay.lua
function C:_executionStarted()
    --self.storedTod = core_environment.getTimeOfDay()
end
@/lua/ge/extensions/tech/techCore.lua
M.handleGetTimeOfDay = function(request)
  local timeOfDay = core_environment.getTimeOfDay()
  timeOfDay.timeStr = getTimeOfDay(true)
  local timeOfDay = core_environment.getTimeOfDay()
  timeOfDay.timeStr = getTimeOfDay(true)
  request:sendResponse({type='TimeOfDay', data=timeOfDay})
M.handleTimeOfDayChange = function(request)
  local timeOfDay = core_environment.getTimeOfDay()
  local todIsNumber = type(request['time']) == 'number'
@/lua/ge/extensions/editor/objectTool.lua
    if object and object:getClassName() == "TimeOfDay" then
      local tod = core_environment.getTimeOfDay()
      if tod then
@/lua/ge/extensions/gameplay/missions/missionManager.lua

  mission.setupModules.environment._originalTimeOfDay = deepcopy(core_environment.getTimeOfDay() or {})
  local fogDensity, fogObj = core_environment.getFogDensity()
      mission.setupModules.environment._originalTimeOfDay.play = mission.setupModules.environment._originalTimeOfDay.play and true or false
      local tod = deepcopy(core_environment.getTimeOfDay())
      tod.time = mission.setupModules.environment.time
@/lua/ge/extensions/flowgraph/nodes/environment/getTimeOfDay.lua
function C:work()
  local tod = core_environment.getTimeOfDay()
  self.pinOut.time.value = tod.time
@/lua/ge/extensions/freeroam/bigMapMode.lua
local function setTime(time)
  local tod = core_environment.getTimeOfDay()
  if tod then

    local currentTod = core_environment.getTimeOfDay()
    if currentTod then
  previousFogDensity = core_environment.getFogDensity()
  previousTod = core_environment.getTimeOfDay() and core_environment.getTimeOfDay().time
  previousUiVisibility = ui_visibility.get()
  previousFogDensity = core_environment.getFogDensity()
  previousTod = core_environment.getTimeOfDay() and core_environment.getTimeOfDay().time
  previousUiVisibility = ui_visibility.get()
@/lua/ge/extensions/gameplay/parking.lua
  if filters.useProbability then
    local timeObj = core_environment.getTimeOfDay()
    if timeObj and timeObj.time then
@/ui/lib/int/beamng-data.js
    return setInterval(function () {
      bngApi.engineLua('core_environment.getTimeOfDay()', (timeObj) => {
        if (timeObj) {
@/ui/modules/photomode/photomode.js

  bngApi.engineLua('core_environment.getTimeOfDay()',
    (data) => {
  $scope.$watch('photo.environment.state.time', function(value) {
    bngApi.engineLua('getTimeOfDay(true)',
    (data) => {
  $scope.$watch('photo.environment.state.azimuthOverride', function(value) {
    bngApi.engineLua('core_environment.getTimeOfDay(true)',
    (data) => {
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdownSynced.lua

function C:getTimeOfDay()
  -- Shim to get time of day from environment extension
  if core_environment then
    return core_environment.getTimeOfDay()
  end
  -- Initialize test mode based on current environment time
  local currentTime = self:getTimeOfDay()
  if currentTime and currentTime.time then
@/lua/ge/extensions/core/environment.lua
local function cycleTimeOfDay()
  local v = getTimeOfDay()
  if not v then return end
  local res = {}
  local timeObj = getTimeOfDay()
  if timeObj then

  local tod = getTimeOfDay()
  if not tod or not tod.time then

  local tod = getTimeOfDay()
  if tod then
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua

  local tod = core_environment.getTimeOfDay()
  if tod then
@/lua/ge/ge_utils.lua
-- uses 24h time format
function getTimeOfDay(asString)
  local tod = getObjectByClass("TimeOfDay")
@/lua/ge/extensions/gameplay/rally/loop/stagedCountdownTest.lua

local function getTimeOfDay()
  -- Shim to get time of day from environment extension
  if core_environment then
    return core_environment.getTimeOfDay()
  end
  -- Initialize test mode based on current environment time
  local currentTime = getTimeOfDay()
  if currentTime and currentTime.time then
@/lua/ge/extensions/freeroam/freeroam.lua
     end
     local time = core_environment.getTimeOfDay()
     core_environment.setTimeOfDay({play = true, dayScale = dayScale, nightScale = nightScale, time = time.time})
@/lua/ge/extensions/flowgraph/modules/missionModule.lua
  if obj then
    local tod = core_environment.getTimeOfDay()
    if tod and tod.time >= 0.225 and tod.time <= 0.775 then
@/lua/ge/extensions/gameplay/rally/loop/rallyLoopManager.lua
  -- Initialize wall clock with current environment time of day
  local currentTime = self:getTimeOfDay()
  if currentTime and currentTime.time then

function C:getTimeOfDay()
  -- Shim to get time of day from environment extension
  if core_environment then
    local tod = core_environment.getTimeOfDay()
    if tod then
  -- Get time of day and format as HH:MM:SS / HH:MM:SS AM/PM
  local tod = self:getTimeOfDay()
  if not tod or not tod.time then
@/lua/ge/extensions/gameplay/traffic/vehicle.lua
function C:checkTimeOfDay() -- checks time of day
  local timeObj = core_environment.getTimeOfDay()
  local isDaytime = true
@/lua/ge/extensions/editor/mainToolbar.lua
        im.TableNextRow()
        local tod = core_environment.getTimeOfDay()
        if tod then
@/lua/ge/extensions/scenario/scenarios.lua
      if objName == 'tod' then
        local tod = core_environment.getTimeOfDay()
        if tod then
@/lua/ge/extensions/util/trackBuilder/splineTrack.lua
    exported.environment = {
      tod = core_environment.getTimeOfDay(),
    fog = core_environment.getFogDensity()}