objectExists
Definition
-- @/=[C]:-1
function objectExists(...)
Callers
@/lua/ge/extensions/freeroam/specialTriggers.lua
for name, data in pairs(v.objects) do
local obj = scenetree.objectExists(name)
if obj and v.stack > 0 then
@/lua/ge/extensions/core/trafficSignals.lua
for _, objId in pairs(objData) do
if scenetree.objectExists(objId) then
if alsoDelete then
function SignalInstance:linkSignalObject(objId) -- links world objects that will be synced to this signal instance (typically traffic lights)
if scenetree.objectExists(objId) then
scenetree.findObjectById(objId):setDynDataFieldbyName('signalInstance', 0, self.name)
function SignalInstance:unlinkSignalObject(objId) -- unlinks world objects from this signal instance
if scenetree.objectExists(objId) then
scenetree.findObjectById(objId):setDynDataFieldbyName('signalInstance', 0, '')
@/lua/ge/extensions/editor/trafficManager.lua
local function checkSimGroup() -- checks the traffic session SimGroup and updates the session data if changes were found
if not scenetree.objectExists(simGroupName) then return end
local function deleteSimGroup() -- deletes the existing traffic session SimGroup, and everything in it
if scenetree.objectExists(simGroupName) then
scenetree.findObject(simGroupName):delete()
local function createSimGroup() -- creates the traffic session SimGroup
if not scenetree.objectExists(simGroupName) then
local trafficSessionGroup = createObject("SimGroup")
for id, data in pairs(session.vehicles) do
if scenetree.objectExists(id) and not data.locked then
getObjectByID(data.id):delete()
if not commands.isFreeCamera() then
if scenetree.objectExists(session.playerId or 0) then
be:enterVehicle(0, getObjectByID(session.playerId))
if not session.vehicles[name] then -- TODO: simplify this
if not scenetree.objectExists(simGroupName) then
createSimGroup()
for id, data in pairs(session.vehicles) do
if scenetree.objectExists(id) and not data.locked then
getObjectByID(data.id):queueLuaCommand('recovery.loadHome()')
for _, veh in ipairs(getAllVehiclesByType()) do
if not scenetree.objectExists(simGroupName) then
createSimGroup()
if obj then
if not scenetree.objectExists(simGroupName) then
createSimGroup()
for i, nameId in ipairs(session[key]) do
if scenetree.objectExists(nameId) then
local obj = scenetree.findObject(nameId)
if scenetree.objectExists(simGroupName) then
editor.selectObjects({scenetree.findObject(simGroupName):getID()})
if not scenetree.objectExists(simGroupName) then
if session.active then
if windows.vehicles.active or windows.signs.active then
if not scenetree.objectExists(simGroupName) then
createSimGroup()
@/lua/ge/ge_utils.lua
scenetree.objectExists = function(objectId)
return Sim.objectExists(objectId)
end