Hallo zusammen,
passend zu meinen Fahrzeugen will ich auch "schöne" Hochbahnsteige für Straßenbahnen anbieten.
Leider hab ich mit den Lanes und den Straßenanbindungen (Edges) so meine Probleme.
Fall 1: Durchgangshalt auf der Straße
Ist aktuell in etwa so gelöst: Straßen-Edges an beiden Enden, dazwischen noch eine Straßen-Edge.
Zwischen den äußeren Edges habe ich dann Lanes aufgespannt, allerdings nur für {"TRAM", "ELECTRIC_TRAM"}.
Folgendes Verhalten stört mich daran:
- Fahrzeuge die nicht an die Station fahren (Autos, Busse und LKWs) fahren durch die stehende Bahn hindurch.
Hier ein Screenshot und der Quellcode:
function data()
return {
boundingInfo = {
bbMax = {
93, 2, 2,
},
bbMin = {
-13, 0, 0,
},
},
collider = {
params = {
},
type = "BOX",
},
lods = {
{
animations = {
},
children = {
{
id = "station/tram/high level/Bahnsteig.msh",
transf = {
1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Bahnsteig.msh",
transf = {
1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 40, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Gelaender.msh",
transf = {
1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Gelaender.msh",
transf = {
1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 40, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Aufgang.msh",
transf = {
0.996, 0.087, 0, 0, 0, 0, 1, 0, 0.087, -0.996, 0, 0, 0, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Aufgang.msh",
transf = {
-0.996, 0.087, 0, 0, 0, 0, 1, 0, -0.087, -0.996, 0, 0, 80, 0, 0, 1,
},
type = "MESH",
},
},
events = {
},
matConfigs = {
{
0,
},
},
static = false,
visibleFrom = 0,
visibleTo = 10000,
},
},
metadata = {
transportNetworkProvider = {
laneLists = {
{
transportModes = { "TRAM", "ELECTRIC_TRAM" },
nodes = {
-- lane1
{ { 100.0, 1.4, .0 }, { -100, 0, .0 }, 3.0 },
{ { 0, 1.4, .0 }, { -100, 0, .0 }, 3.0 },
{ { 0, 1.4, .0 }, { -20, 0, .0 }, 3.0 },
{ { -20.0, 1.4, .0 }, { -20, 0, .0 }, 3.0 },
}
}, {
transportModes = { "PERSON" },
nodes = {
-- ped1
{ { -20.0, -2-1.1, .3 }, { 1, 0, .0 }, 1.25 },
{ { 0.0, -1.25, 1 }, { 1, 0, 0 }, 1.25 },
{ { 80.0, -1.25, 1 }, { 1, 0, .0 }, 2.0 },
{ { 0.0, -1.25, 1 }, { 1, 0, .0 }, 2.0 },
{ { 80.0, -1.25, 1 }, { 1, 0, 0 }, 1.25 },
{ { 100.0, -2-1.1, .3 }, { 1, 0, .0 }, 1.25 },
}
}
},
terminals = {
{ vehicleNode = 1, personNodes = { 5, 8 }, personEdges = { 3 }, 2.0 },
}
},
},
}
end
Alles anzeigen
function data()
return {
type = "STREET_STATION",
description = {
name = _("wizzPlatforms.Double"),
Description = _("wizzPlatforms.DoubleDescription")
},
availability = {
yearFrom = 1955
},
order = 26343 * 10000 + 01 * 100 + 2,
updateFn = function(params)
local result = { }
result.models = {
{
id = "/station/tram/high level/station 80.mdl",
transf = { 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 2.5+1.4, 20, 0, 1, }
}, {
id = "/station/tram/high level/station 80.mdl",
transf = { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, -2.5-1.4, -60, 0, 1, }
}
}
result.edgeLists = {
{
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -90, .0 }, { .0, 10.0, .0 } },
{ { .0, -80, .0 }, { .0, 10.0, .0 } },
},
snapNodes = { 0 }
}, {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, 40, .0 }, { .0, 10.0, .0 } },
{ { .0, 50, .0 }, { .0, 10.0, .0 } },
},
snapNodes = { 1 }
}, {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -80, .0 }, { .0, 5.0, .0 } },
{ { .0, -75, .0 }, { .0, 5.0, .0 } },
},
snapNodes = { }
}, {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -75, .0 }, { .0, 110.0, .0 } },
{ { .0, 35, .0 }, { .0, 110.0, .0 } },
},
snapNodes = { }
}, {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, 35, .0 }, { .0, 5.0, .0 } },
{ { .0, 40, .0 }, { .0, 5.0, .0 } },
},
snapNodes = { }
},
}
result.cost = 18000
result.maintenanceCost = 700
return result
end
}
end
Alles anzeigen
Fall 2: Endstation
Ist aktuell in etwa so gelöst: Straßen-Edge an einer Seite, danach eigene Lanes mit {"TRAM", "ELECTRIC_TRAM"}.
Die Lanes laufen bis zum Haltepunkt und von dort etwas versetzt wieder zurück.
Folgendes Verhalten stört mich daran:
- Im moment des haltens verschwindet das Fahrzeug
Wünschen würde ich mir, das die Fahrzeuge in die Spitzkehre einfahren, halten und danach umdrehen und herausfahren. (noch bessere wäre natürlich ein Wendezug-Flag am Fahrzeug wodurch dieses Rückwärts herausfährt, aber das ist je nur ein Traum - bisher)
Hier ein Screenshot und der Quellcode:
function data()
return {
boundingInfo = {
bbMax = {
72, 3, 1,
},
bbMin = {
-13, -5, 0,
},
},
collider = {
params = {
},
type = "BOX",
},
lods = {
{
animations = {
},
children = {
{
id = "station/tram/high level/Bahnsteig.msh",
transf = {
1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Gelaender.msh",
transf = {
1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Aufgang.msh",
transf = {
-0.996, 0.087, 0, 0, 0, 0, 1, 0, -0.087, -0.996, 0, 0, 40, 0, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Gleis Abzweig.msh",
transf = {
-1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 72, 5-1.1, 0, 1,
},
type = "MESH",
}, {
id = "station/tram/high level/Gleis 40m.msh",
transf = {
1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, -1.1, 0, 1,
},
type = "MESH",
},
},
events = {
},
matConfigs = {
{
0,
},
},
static = false,
visibleFrom = 0,
visibleTo = 10000,
},
},
metadata = {
transportNetworkProvider = {
laneLists = {
{
transportModes = { "TRAM", "ELECTRIC_TRAM" },
nodes = {
-- lane1
{ { 72.0, 1.4, .0 }, { -22, 0, .0 }, 3.0},
{ { 40, 1.4, 0 }, { -32, 0, 0 }, 3.0 },
{ { 40.0, 1.4, 0 }, { -40, 0, 0 }, 3.0},
{ { 0, 1.4, 0 }, { -40, 0, .0 }, 3.0 },
{ { 0, 1.4, 0 }, { -1, 0, .0 }, 3.0 },
{ { 1, 1.5, 0 }, { 1, 0, .0 }, 3.0 },
{ { 1, 1.5, 0 }, { 39, 0, .0 }, 3.0 },
{ { 40.0, 1.5, 0 }, { 39, 0, 0 }, 3.0},
{ { 40, 1.5, 0 }, { 32, 0, 0 }, 3.0 },
{ { 72.0, 1.4+5, .0 }, { 32, 0, .0 }, 3.0},
{ { 72.0, 1.4+5, .0 }, { -32, 0, .0 }, 3.0},
{ { 40, 1.4, 0 }, { -32, 0, 0 }, 3.0 },
{ { 40, 1.5, 0 }, { 32, 0, 0 }, 3.0 },
{ { 72.0, 1.4, .0 }, { 32, 0, .0 }, 3.0},
}
}, {
transportModes = { "PERSON" },
nodes = {
-- ped1
{ { 40.0, -1.25, 1 }, { 1, 0, .0 }, 2.0 },
{ { 0.0, -1.25, 1 }, { 1, 0, .0 }, 2.0 },
{ { 40.0, -1.25, 1 }, { 1, 0, 0 }, 1.25 },
{ { 60.0, -2-1.1, .3 }, { 1, 0, .0 }, 1.25 },
{ { 60.0, -2-1.1, .3 }, { 1, 0, .0 }, 1.25 },
{ { 72.0, -2-1.1, .3 }, { 1, 0, .0 }, 1.25 },
}
}
},
terminals = {
{ vehicleNode = 3, personNodes = { 14 }, personEdges = { 7 }, 2.0 },
}
},
},
}
end
Alles anzeigen
Die .con ist leider etwas unübersichtlicher, da bin ich gerade dran alles über
Parameter zu lösen.
function data()
return {
type = "STREET_STATION",
description = {
name = _(wizzPlatforms.SingleEnd),
Description = _(wizzPlatforms.SingleEndDescription)
},
availability = {
yearFrom = 1955
},
order = 26343 * 10000 + 01 * 100 + 1,
params = {
{
key = "type",
name = _(wizzPlatforms.params.stationType),
values = { _(wizzPlatforms.params.normal), _(wizzPlatforms.params.endStation) },
}, {
key = "length",
name = _(wizzPlatforms.params.length),
values = { _(wizzPlatforms.params.single), _(wizzPlatforms.params.double) },
}, {
key = "plattform",
name = _(wizzPlatforms.params.plattform),
values = { _(wizzPlatforms.params.left), _(wizzPlatforms.params.right), _(wizzPlatforms.params.both) },
}
},
updateFn = function(params)
local result = { }
local model = { }
if (params.length == 0) then
model.length = "40"
else
model.length = "80"
end
if (params.type == 0) then
model.ende = ""
else
model.ende = " end"
end
result.models = { }
local transf
if(params.type == 0 and params.length == 1) then
transf = { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, -2.5-1.4, -60, 0, 1, }
elseif (params.type == 0) then
transf = { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, -2.5-1.4, -20, 0, 1, }
else
transf = { 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, -2.5-1.4, 20, 0, 1, }
end
if(params.plattform == 0 or params.plattform == 2) then
result.models[#result.models+1] = {
id = "/station/tram/high level/station ${length}${ende}.mdl" % model,
transf = { 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 2.5+1.4, 20, 0, 1, }
}
end
if((params.plattform == 1 or params.plattform == 2)) then
result.models[#result.models+1] = {
id = "/station/tram/high level/station ${length}${ende}.mdl" % model,
transf = transf
}
end
-- Edsges festlegen
result.edgeLists = { }
result.groundFaces = { }
local faces
if (params.type == 1 and params.length == 0) then
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -52, .0 }, { .0, -10.0, .0 } },
{ { .0, -62, .0 }, { .0, -10.0, .0 } },
},
snapNodes = { 1 }
}
faces = { { {9, -52, 0}, {6, -20, 0}, {6, 20, 0}, {-6, 20, 0}, {-6, -20, 0}, {-9, -52, 0} }, { {5, -52, 0.3}, {9, -52, 0.3}, {7, -30, 0.3,}, {5, -30, 0.3} } }
end
if (params.type == 1 and params.length == 1) then
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -40, .0 }, { .0, -10.0, .0 } },
{ { .0, -50, .0 }, { .0, -10.0, .0 } },
},
snapNodes = { 0 }
}
faces = { { {9, -40, 0}, {6, -20, 0}, {6, 60, 0}, {-6, 60, 0}, {-6, -20, 0}, {-9, -40, 0} }, { {5, 52, 0.3}, {9, 52, 0.3}, {7, 30, 0.3,}, {5, 30, 0.3} } }
end
if (params.type == 0 and params.length == 0) then
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, 40, .0 }, { .0, 10.0, .0 } },
{ { .0, 50, .0 }, { .0, 10.0, .0 } },
},
snapNodes = { 1 }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -50, .0 }, { .0, 10.0, .0 } },
{ { .0, -40, .0 }, { .0, 10.0, .0 } },
},
snapNodes = { 0 }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -40, .0 }, { .0, 5.0, .0 } },
{ { .0, -35, .0 }, { .0, 5.0, .0 } },
},
snapNodes = { }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -35, .0 }, { .0, 70.0, .0 } },
{ { .0, 35, .0 }, { .0, 70.0, .0 } },
},
snapNodes = { }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, 35, .0 }, { .0, 5.0, .0 } },
{ { .0, 40, .0 }, { .0, 5.0, .0 } },
},
snapNodes = { }
}
end
if (params.type == 0 and params.length == 1) then
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, 40, .0 }, { .0, 10.0, .0 } },
{ { .0, 50, .0 }, { .0, 10.0, .0 } },
},
snapNodes = { 1 }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -50, .0 }, { .0, 10.0, .0 } },
{ { .0, -40, .0 }, { .0, 10.0, .0 } },
},
snapNodes = { 0 }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -80, .0 }, { .0, 5.0, .0 } },
{ { .0, -75, .0 }, { .0, 5.0, .0 } },
},
snapNodes = { }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, -75, .0 }, { .0, 110.0, .0 } },
{ { .0, 35, .0 }, { .0, 110.0, .0 } },
},
snapNodes = { }
}
result.edgeLists[#result.edgeLists+1] = {
type = "STREET",
params = {
type = "new_medium.lua",
tramTrackType = "ELECTRIC",
},
edges = {
{ { .0, 35, .0 }, { .0, 5.0, .0 } },
{ { .0, 40, .0 }, { .0, 5.0, .0 } },
},
snapNodes = { }
}
end
if (faces ~= nil) then
result.terrainAlignmentLists = {
{
type = "EQUAL",
faces = faces,
slopeLow = 0.275,
slopeHigh = 0.6
}
}
for k,face in pairs(faces) do
result.groundFaces[#result.groundFaces + 1] = { face = face, modes = { { type = "FILL", key = "town_concrete" } } }
result.groundFaces[#result.groundFaces + 1] = { face = face, modes = { { type = "STROKE_OUTER", key = "town_concrete_border" } } }
end
end
result.cost = 12000
result.maintenanceCost = 500
return result
end
}
end
Alles anzeigen
Edit:
Basierend auf dem Feedback, hier mal meine Wunschliste. Ggf. leite ich die mal an UG weiter.
- Die Bahn fährt auf den angelegten Lanes langsamer als eine Schnecke (20 km/h) - Das lässt sich ggf. über verkürzen der eigenen Lanes umgehen, schöner wäre aber, wenn ich bei meinen Lanes einen Speed setze
- Die Stadt-KI baut keine Häuser an die "eigentlich normalen" Straßen an.
Vielen dank schon einmal für sämtliche Hilfe/Tipps.
Frohes neues euch!