GE Lua Documentation

Press F to search!

simObjectExists

Definition


-- @/=[C]:-1
function simObjectExists(...)

Callers

@/lua/ge/extensions/editor/meshSpline/splineMgr.lua
    local folder = scenetree.findObjectById(spline.sceneTreeFolderId)
    if folder and simObjectExists(folder) then
      folder:delete() -- Remove the scene tree folder for the mesh spline.
@/lua/ge/extensions/editor/assemblySpline/populate.lua
      local mesh = pathPool[i]
      if mesh and simObjectExists(mesh) then
        mesh:delete()
        local mesh = pathPool[i]
        if mesh and simObjectExists(mesh) then
          mesh:delete()
        local mesh = pathPool[i]
        if mesh and simObjectExists(mesh) then
          mesh:delete()
@/lua/ge/extensions/gameplay/drag/display.lua
        for _,light in pairs(group) do
          if type(light) == "table" and light.obj and simObjectExists(light.obj) then
            light.obj:setHidden(true)
      for _,digit in ipairs(laneTypeData) do
        if digit and simObjectExists(digit) then
          digit:setHidden(true)
    for i,v in ipairs(timeDisplayValue) do
      if timeDigits[i] and simObjectExists(timeDigits[i]) then
        timeDigits[i]:preApply()
  for i,v in ipairs(speedDisplayValue) do
    if speedDigits and speedDigits[i] and simObjectExists(speedDigits[i]) then
      speedDigits[i]:preApply()
    if hasTree then
      if countDownLights.amberLight1.obj and simObjectExists(countDownLights.amberLight1.obj) then countDownLights.amberLight1.obj:setHidden(false) end
      if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(false) end
      if countDownLights.amberLight1.obj and simObjectExists(countDownLights.amberLight1.obj) then countDownLights.amberLight1.obj:setHidden(false) end
      if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(false) end
      if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(false) end
      if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(false) end
      if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(false) end
    end
    if hasTree then
      if countDownLights.amberLight1.obj and simObjectExists(countDownLights.amberLight1.obj) then countDownLights.amberLight1.obj:setHidden(true) end
      if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(true) end
      if countDownLights.amberLight1.obj and simObjectExists(countDownLights.amberLight1.obj) then countDownLights.amberLight1.obj:setHidden(true) end
      if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(true) end
      if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(true) end
      if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(true) end
      if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(true) end
      if countDownLights.greenLight.obj and simObjectExists(countDownLights.greenLight.obj) then countDownLights.greenLight.obj:setHidden(racer.isDesqualified) end
      if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(true) end
      if countDownLights.greenLight.obj and simObjectExists(countDownLights.greenLight.obj) then countDownLights.greenLight.obj:setHidden(racer.isDesqualified) end
      if countDownLights.redLight.obj and simObjectExists(countDownLights.redLight.obj) then countDownLights.redLight.obj:setHidden(not racer.isDesqualified) end
      if countDownLights.greenLight.obj and simObjectExists(countDownLights.greenLight.obj) then countDownLights.greenLight.obj:setHidden(racer.isDesqualified) end
      if countDownLights.redLight.obj and simObjectExists(countDownLights.redLight.obj) then countDownLights.redLight.obj:setHidden(not racer.isDesqualified) end
    end
      if countDownLights[stage[3]].isOn == stage[4] then
        if hasTree and countDownLights[stage[3]].obj and simObjectExists(countDownLights[stage[3]].obj) then
          countDownLights[stage[3]].obj:setHidden(stage[4])
      if stage[5] and countDownLights[stage[5]].isOn == stage[6] then
        if hasTree and countDownLights[stage[5]].obj and simObjectExists(countDownLights[stage[5]].obj) then
          countDownLights[stage[5]].obj:setHidden(stage[6])
    if countDownLights.greenLight.isOn == racer.isDesqualified then
      if hasTree and countDownLights.greenLight.obj and simObjectExists(countDownLights.greenLight.obj) then
        countDownLights.greenLight.obj:setHidden(racer.isDesqualified)
    local driverLight = dragData.strip.treeLights[driverLightBlinkState.lane].stageLights.driverLight
    if driverLight and driverLight.obj and simObjectExists(driverLight.obj) then
      local newTimer = driverLightBlinkState.timer + dtSim
  if lane then
    if dragData.strip.treeLights[lane].stageLights.winnerLight and dragData.strip.treeLights[lane].stageLights.winnerLight.obj and simObjectExists(dragData.strip.treeLights[lane].stageLights.winnerLight.obj) then
      dragData.strip.treeLights[lane].stageLights.winnerLight.isOn = true
    end
    if dragData.strip.treeLights[lane].stageLights.driverLight and dragData.strip.treeLights[lane].stageLights.driverLight.obj and simObjectExists(dragData.strip.treeLights[lane].stageLights.driverLight.obj) and not driverLightBlinkState.isBlinking then
      dragData.strip.treeLights[lane].stageLights.driverLight.isOn = true
  -- Update global blue light object if it exists
  if hasTree and blueLight.obj and simObjectExists(blueLight.obj) then
    blueLight.obj:setHidden(false)
  -- Update global blue light object if it exists
  if hasTree and blueLight.obj and simObjectExists(blueLight.obj) then
    blueLight.obj:setHidden(true)
    local hasTree = hasTreeLights()
    if hasTree and laneTree.stageLights.prestageLight.obj and simObjectExists(laneTree.stageLights.prestageLight.obj) then
      laneTree.stageLights.prestageLight.obj:setHidden(false)
    local hasTree = hasTreeLights()
    if hasTree and laneTree.stageLights.prestageLight.obj and simObjectExists(laneTree.stageLights.prestageLight.obj) then
      laneTree.stageLights.prestageLight.obj:setHidden(true)
  if not dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.isOn then
    if dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.obj and simObjectExists(dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.obj) then
      dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.obj:setHidden(false)
  if dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.isOn then
    if dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.obj and simObjectExists(dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.obj) then
      dragData.strip.treeLights[dragData.racers[vehId].lane].stageLights.stageLight.obj:setHidden(true)

  if countDownLights.amberLight1.obj and simObjectExists(countDownLights.amberLight1.obj) then countDownLights.amberLight1.obj:setHidden(true) end
  if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(true) end
  if countDownLights.amberLight1.obj and simObjectExists(countDownLights.amberLight1.obj) then countDownLights.amberLight1.obj:setHidden(true) end
  if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(true) end
  if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(true) end
  if countDownLights.amberLight2.obj and simObjectExists(countDownLights.amberLight2.obj) then countDownLights.amberLight2.obj:setHidden(true) end
  if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(true) end
  if countDownLights.greenLight.obj and simObjectExists(countDownLights.greenLight.obj) then countDownLights.greenLight.obj:setHidden(true) end
  if countDownLights.amberLight3.obj and simObjectExists(countDownLights.amberLight3.obj) then countDownLights.amberLight3.obj:setHidden(true) end
  if countDownLights.greenLight.obj and simObjectExists(countDownLights.greenLight.obj) then countDownLights.greenLight.obj:setHidden(true) end
  if countDownLights.redLight.obj and simObjectExists(countDownLights.redLight.obj) then countDownLights.redLight.obj:setHidden(false) end
  if countDownLights.greenLight.obj and simObjectExists(countDownLights.greenLight.obj) then countDownLights.greenLight.obj:setHidden(true) end
  if countDownLights.redLight.obj and simObjectExists(countDownLights.redLight.obj) then countDownLights.redLight.obj:setHidden(false) end
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
                light.obj:setHidden(false)
          for _, digit in ipairs(laneTypeData) do
            if digit and simObjectExists(digit) then
              digit:preApply()
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
                light.obj:setHidden(true)
          for _, digit in ipairs(laneTypeData) do
            if digit and simObjectExists(digit) then
              digit:setHidden(true)
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
                light.obj:setHidden(false)
          for _, digit in ipairs(laneTypeData) do
            if digit and simObjectExists(digit) then
              digit:setHidden(false)
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
                light.obj:setHidden(true)
          for _, digit in ipairs(laneTypeData) do
            if digit and simObjectExists(digit) then
              digit:setHidden(true)
@/lua/ge/extensions/core/groundMarkerArrows.lua
      arrow:registerObject(Sim.getUniqueName("arrow"))
      if not simObjectExists(arrow) then
        log('E', 'arrow', 'Error while creating an arrow object, aborting arrow pool creation.')
@/lua/ge/extensions/editor/assemblySpline/splineMgr.lua
    local folder = scenetree.findObjectById(spline.sceneTreeFolderId)
    if folder and simObjectExists(folder) then
      folder:delete() -- Remove the scene tree folder for the assembly spline.
@/lua/ge/extensions/editor/sidewalkSpline/populate.lua
      local mesh = pathPool[i]
      if mesh and simObjectExists(mesh) then
        mesh:delete()
        local mesh = pathPool[i]
        if mesh and simObjectExists(mesh) then
          mesh:delete()
        local mesh = pathPool[i]
        if mesh and simObjectExists(mesh) then
          mesh:delete()
@/lua/ge/extensions/core/audioRibbon.lua
    for _, sfxEmitterOnAxis in pairs(sfxEmitters[i]) do
      if simObjectExists(sfxEmitterOnAxis.emitter) then
        if sfxEmitterOnAxis.vol ~= 0 then
    for _, sfxEmitterByAxis in pairs(sfxEmitters[i]) do
      if sfxEmitterByAxis.emitter and simObjectExists(sfxEmitterByAxis.emitter) then
        sfxEmitterByAxis.emitter:delete()
@/lua/ge/extensions/editor/meshSpline/populate.lua
    local mesh = componentMeshes[i]
    if mesh and simObjectExists(mesh) then
      mesh:delete()
        local mesh = v[i]
        if mesh and simObjectExists(mesh) then
          mesh:delete()