-- @/lua/ge/extensions/core/paths.lua:220
local function getPath_Deprecated(pathName)
-- find any path (chooses first)
if not pathName then
local objNames = scenetree.findClassObjects('SimPath')
if not objNames or #objNames == 0 then
-- if not SimPath on level return
--log('E', 'core_paths.getPath', 'unable to find any path')
return
end
pathName = objNames[1]
end
local pathObj = scenetree.findObject(pathName)
if not pathObj then
log('E', 'core_paths.getPath', 'unable to find path: ' .. tostring(pathName))
return
end
local res = { markers = {}}
res.looped = false
if pathObj.looped then
res.looped = pathObj.looped == '1'
end
-- extract all its markers
--pathObj:sortMarkers()
res.nodeCount = pathObj:size()
for i = 0, res.nodeCount do
local markerId = pathObj:idAt(i)
if markerId >= 0 then
local marker = scenetree.findObjectById(markerId)
if marker then
local d = {
pos = vec3(marker:getPosition()),
rot = quat(marker:getRotation()),
time = marker.timeToNext or marker.seconds,
positionSmooth = marker.positionSmooth
}
res.markers[marker.seqNum + 1] = d
end
end
end
-- fix up the rotations
for i = 2, res.nodeCount - 1 do
if res.markers[i].rot:dot(res.markers[i - 1].rot) < 0 then
res.markers[i].rot = -res.markers[i].rot
end
end
return res
end
Callers
@/lua/ge/extensions/editor/api/valueInspector.lua
if absPath ~= "" then
absPath = (string.find(absPath, "/") ~= nil and absPath or (mat:getPath() .. absPath))
end
@/lua/ge/extensions/gameplay/route/route.lua
for i = 1, #wpList-1 do
local path = map.getPath(wpList[i], wpList[i + 1], self.cutOffDrivability, self.dirMult, self.penaltyAboveCutoff, self.penaltyBelowCutoff)
local pathLen = #self.path
local ps = ap.ps
local id = string.format("delivery-parking-%s-%s", fac.id, ps:getPath())
local loc = {type = "facilityParkingspot", facId = fac.id, psPath = ps:getPath()}
local id = string.format("delivery-parking-%s-%s", fac.id, ps:getPath())
local loc = {type = "facilityParkingspot", facId = fac.id, psPath = ps:getPath()}
local cargoCount = #dParcelManager.getAllCargoForLocationUnexpiredUndelivered(loc)
local icon = "poi_pickup_round"
if interactiveParkingSpots[ps:getPath()] then
icon = "poi_dropoff_round"
local focus = interactiveParkingSpots[ps:getPath()] ~= nil
local elem = {
id = id,
data = {type = "logisticsParking", facId = fac.id, psPath = ps:getPath(), canInspectCargo = ap.isInspectSpot, hasPlayerCargo = interactiveParkingSpots[ps:getPath()] and true or false },
markerInfo = {
id = id,
data = {type = "logisticsParking", facId = fac.id, psPath = ps:getPath(), canInspectCargo = ap.isInspectSpot, hasPlayerCargo = interactiveParkingSpots[ps:getPath()] and true or false },
markerInfo = {
-- only include parking marker if there is an action
parkingMarker = cargoCount and {path = ps:getPath(), pos = ps.pos, rot = ps.rot, scl = ps.scl, icon = icon, focus = focus} or nil,
}
else
if interactiveParkingSpots[ps:getPath()] then
local tasks = {}
if next(interactiveParkingSpots[ps:getPath()].dropOffs) then
table.insert(tasks, string.format("Deliver %d cargo items here.", #interactiveParkingSpots[ps:getPath()].dropOffs))
if next(interactiveParkingSpots[ps:getPath()].dropOffs) then
table.insert(tasks, string.format("Deliver %d cargo items here.", #interactiveParkingSpots[ps:getPath()].dropOffs))
end
end
if next(interactiveParkingSpots[ps:getPath()].pickUps) then
table.insert(tasks, string.format("Pick up %d cargo items here.", #interactiveParkingSpots[ps:getPath()].pickUps))
if next(interactiveParkingSpots[ps:getPath()].pickUps) then
table.insert(tasks, string.format("Pick up %d cargo items here.", #interactiveParkingSpots[ps:getPath()].pickUps))
end
end
if next(interactiveParkingSpots[ps:getPath()].vehicles) then
table.insert(tasks, string.format("Deliver %d vehicles here.", #interactiveParkingSpots[ps:getPath()].vehicles))
if next(interactiveParkingSpots[ps:getPath()].vehicles) then
table.insert(tasks, string.format("Deliver %d vehicles here.", #interactiveParkingSpots[ps:getPath()].vehicles))
end
end
if interactiveParkingSpots[ps:getPath()] or ap.isInspectSpot or dCargoScreen.isCargoScreenOpen() then
--dump(string.format("%s -> %s", fac.name, name))
local id = string.format("delivery-parking-%s-%s", fac.id, ps:getPath())
local loc = {type = "facilityParkingspot", facId = fac.id, psPath = ps:getPath()}
local id = string.format("delivery-parking-%s-%s", fac.id, ps:getPath())
local loc = {type = "facilityParkingspot", facId = fac.id, psPath = ps:getPath()}
local icon = "poi_pickup_round"
if interactiveParkingSpots[ps:getPath()] then
icon = "poi_dropoff_round"
id = id,
data = {type = "logisticsParking", facId = fac.id, psPath = ps:getPath(), hasPlayerCargo = interactiveParkingSpots[ps:getPath()] and true or false },
markerInfo = {
id = id,
data = {type = "logisticsParking", facId = fac.id, psPath = ps:getPath(), hasPlayerCargo = interactiveParkingSpots[ps:getPath()] and true or false },
markerInfo = {
local distanceKey = string.format("%d-%s-%s", con.vehId, fac.facId, fac.dropOffSpots[1]:getPath())
if vehToLocationDistanceCache[distanceKey] == nil then
vehToLocationDistanceCache[distanceKey] = false
local a, b = dGenerator.getLocationCoordinates({type="vehicle", vehId=con.vehId}), dGenerator.getLocationCoordinates({type="facilityParkingspot", facId=fac.facId, psPath=fac.dropOffSpots[1]:getPath()})
if a and b then
local fac = dGenerator.getFacilityById(locationId)
local toPos = dGenerator.getLocationCoordinates({type="facilityParkingspot", facId = fac.id, psPath=(asProvider and fac.pickUpSpots[1] or fac.dropOffSpots[1]):getPath()})
if fromPos and toPos then
@/lua/ge/extensions/editor/inspector.lua
if texturePath ~= ""then
texturePath = (string.find(texturePath, "/") ~= nil and texturePath or (groundCoverMaterial:getPath() .. texturePath))
texture = editor.getTempTextureObj(texturePath)
@/lua/ge/main.lua
local nid = newVehicle and newVehicle:getId() or -1
-- local oldinfo = oldVehicle and ("id "..dumps(oid).." ("..oldVehicle:getPath()..")") or dumps(oldVehicle)
-- local newinfo = newVehicle and ("id "..dumps(nid).." ("..newVehicle:getPath()..")") or dumps(newVehicle)
-- local oldinfo = oldVehicle and ("id "..dumps(oid).." ("..oldVehicle:getPath()..")") or dumps(oldVehicle)
-- local newinfo = newVehicle and ("id "..dumps(nid).." ("..newVehicle:getPath()..")") or dumps(newVehicle)
--log('I', 'main', "Player #"..dumps(player).." vehicle switched from: "..oldinfo.." to: "..newinfo)
@/lua/ge/extensions/scenario/raceDebug.lua
--print("path from '" .. lastwp .. "' to '".. wp .. "':")
local path = map.getPath(lastwp, wp)
local lastWpp = nil
function Graphpath:getPath(start, goal, dirMult)
local graph = self.graph
local path = self:getPath(wpAhead, twpAhead, dirMult)
@/lua/ge/extensions/editor/roadArchitect.lua
if absPath ~= "" then -- Check if path is absolute or relative.
absPath = (string.find(absPath, "/") ~= nil and absPath or (mat:getPath() .. absPath))
end
@/inspector/Models/RecordingState.js
if (WI.ImageUtilities.supportsCanvasPathDebugging())
data.setPath = [context.getPath()];
if not name_a or not name_b then return 1 end
local path = map.getPath(name_a, name_b)
local d = 0
if ap.logisticTypesReceivedLookup[template.logisticType] then
table.insert(destination.destinations, {type = "facilityParkingspot", facId = f.id, psPath = s:getPath()})
end
fac.closestMaterialProviders = {}
local facLocation = {type = "facilityParkingspot", facId = fac.id, psPath = fac.dropOffSpots[1]:getPath()}
for materialType, storage in pairs(fac.materialStorages) do
if otherFac.logisticTypesProvidedLookup[materialType] then
local otherLocation = {type = "facilityParkingspot", facId = otherFac.id, psPath = otherFac.pick UpSpots[1]:getPath()}
local otherApName = otherFac.materialStorages[materialType] and otherFac.materialStorages[materialType].pickUpSpotName
if otherApName then
otherLocation.psPath = otherFac.accessPointsByName[otherApName].ps:getPath()
end
if fac.pickUpSpots[1] then
local facLocation = {type = "facilityParkingspot", facId = fac.id, psPath = fac.pickUpS pots[1]:getPath()}
for materialType, storage in pairs(fac.materialStorages) do
if ap.logisticTypesReceivedLookup[materialType] then
table.insert(destination.destinations, {type = "facilityParkingspot", facId = f.id, psPath = ap.ps:getPath()})
end
function C:getPath()
return self.sites.dir .. self.sites.filename .. '#'..self.name
@/lua/ge/extensions/gameplay/race/segment.lua
table.clear(self.capsulePoints)
local path = map.getPath(self:getFrom().navgraphName, self:getTo().navgraphName)
if path and #path > 2 then
@/lua/ge/extensions/gameplay/route/raceRoute.lua
for i = 1, #wpList-1 do
local path = map.getPath(wpList[i], wpList[i + 1], self.cutOffDrivability, self.dirMult, self.penaltyAboveCutoff, self.penaltyBelowCutoff)
local pathLen = #self.path
@/lua/ge/extensions/editor/materialEditor.lua
if not string.find(p, "/", 1, true) then
return p, (mat:getPath() .. p)
else
if absPath ~= "" and not isTaggedTexture and not isLevelRelativeTexture then
absPath = (string.find(absPath, "/") ~= nil and absPath or (currentMaterial:getPath() .. absPath))
if absPath ~= imgPath then
@/lua/vehicle/controller/tech/roadsSensor.lua
local pFKey, pRKey, pH = getPointAhead(frontAxleMidpointProjGround, fwd, lookAheadDistance)
local path = mapmgr.mapData:getPath(pRKey, pFKey, nil)
coeffsCL = { uA = 0, uB = 0, uC = 0, uD = 0, vA = 0, vB = 0, vC = 0, vD = 0 }
if legalRoute == nil then legalRoute = true end
local route = map.getPath(tempNodes.posA, tempNodes.posB, nil, legalRoute and 1000 or 1)
self.pinOut.navgraphRoute.value = route
local imgPath = mat:getField("diffuseMap", 0)
local absPath = imgPath ~= emptyStr and (string.find(imgPath, "/") and imgPath or (mat:getPath() .. imgPath)) or emptyStr
local texture = getTexObj(absPath)
@/lua/ge/extensions/editor/roadSpline.lua
if absPath ~= "" then
absPath = (string.find(absPath, "/") ~= nil and absPath or (mat:getPath() .. absPath))
end
@/lua/ge/extensions/core/cameraModes/path.lua
else
path = core_paths.getPath(self.pathName)
end
@/lua/ge/extensions/util/export.lua
for i = 1, 100 do
fn = playerVehicle:getPath() .. 'export_' .. string.format('%03d', i)
if M.gltfBinaryFormat then
@/lua/ge/extensions/ui/uiNavi.lua
local route = map.getPath(findClosestRoad(newPos), destination)
if oldPos:distance(newPos) > 0.1 then
local route = map.getPath(startPoint, endPoint)
guihooks.trigger('RoutePlanned', route)