chore(prototype): passing lanes BUS/TRUCK only; probe logs road template
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f7254a7709
commit
0424e66c6f
4 files changed
+24
-10
No files matched your search
@@ -26,6 +26,13 @@ local function turnaround(edge : EdgeId) : integer
|
||||
return tn.turnaroundEdges[edge.index + 1]
|
||||
end
|
||||
|
||||
-- short street template name of a segment, so passing-lane use on the prototype road can be told apart
|
||||
local function roadOf(seg : integer) : string
|
||||
local be = api.engine.getComponent(seg, api.type.ComponentType.BASE_EDGE) as Engine.Component.BaseEdge
|
||||
if be == nil then return "?" end
|
||||
return (tostring(be.roadTemplate):match("([^/]+)%.street_template$")) or tostring(be.roadTemplate)
|
||||
end
|
||||
|
||||
local function dump(dt : number)
|
||||
local player = api.engine.util.getPlayer()
|
||||
local vehicles = api.engine.getEntitiesWithComponent(api.type.ComponentType.TRANSPORT_VEHICLE, { requireOwnedByPlayer = player })
|
||||
@@ -37,8 +44,8 @@ local function dump(dt : number)
|
||||
if lv ~= nil and not lv.isTram and mp ~= nil then
|
||||
local edge, dir = edgeAt(mp)
|
||||
p(string.format(
|
||||
"veh=%d seg=%d lane=%s dir=%s turnaround=%s edgeIndex=%d/%d pos=%.1f speed=%.2f state=%s tvState=%s line=%s standing=%.1f",
|
||||
v, edge and edge.entity or -1, tostring(edge and edge.index), tostring(dir), tostring(edge and turnaround(edge)),
|
||||
"veh=%d road=%s seg=%d lane=%s dir=%s turnaround=%s edgeIndex=%d/%d pos=%.1f speed=%.2f state=%s tvState=%s line=%s standing=%.1f",
|
||||
v, edge and roadOf(edge.entity) or "-", edge and edge.entity or -1, tostring(edge and edge.index), tostring(dir), tostring(edge and turnaround(edge)),
|
||||
mp.dyn.pathPos.edgeIndex, #(mp.path.edges as {any}), mp.dyn.pathPos.pos, mp.dyn.speed, tostring(mp.state),
|
||||
tostring(tv and tv.state), tostring(tv and tv.line), mp.dyn.timeStanding))
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user