Files
tokyo-wangan-racing/tools/fix_dupes.luau
T
jesse c8dabea53a Daikoku PA: lift mainline over the apron, rebuild both ramps
The PA ring road and the expressway mainline were both at ground level, so
the ring parapet stood INSIDE the carriageway (measured -10.0 studs of
vertical overlap: a wall in the middle of the road).

Reference photos of the real Daikoku Futo PA show the expressway flying
OVER the parking apron on pillars, with the PA at ground level and ramps
climbing up to meet it. Rebuilt to match:

- mainline lifted 38 studs through the junction, eased in/out (max 5.26%
  grade, within real expressway limits)
- PA ring + apron stay at ground level; legacy PARingPillar props removed
- both on/off ramps regraded over the full rise with smoothstep easing,
  segments overlapped 3 studs so wheels can't catch a seam, plus support
  pillars and edge kerbs where the deck is high

Verified in-engine against built parts (tools/diag_daikoku.luau), not just
source: clearance now +28.0 studs, both ramps continuous (max step 5.62,
no gaps). tools/plot_daikoku.py renders the plan/section for comparison.
2026-08-02 15:56:13 -04:00

93 lines
2.2 KiB
Luau

--[[
fix_dupes.luau -- remove leftover CarManager clones and report the truth.
diag_stale found TWO ModuleScripts at ServerScriptService.Server.CarManager,
both len=30631 with no _buildForDiag, while the file on disk is 39591 bytes
and defines it. My diagnostic scripts cloned the module and did not always
destroy the clone, so duplicates accumulated; require() may bind to either.
Deletes every CarManager except the one that is a genuine child of the
Server folder (keeping the first by index), then reports what remains so
the next push has a single unambiguous target.
]]
local ServerScriptService = game:GetService("ServerScriptService")
local out = {}
local function log(...)
local parts = {}
for i = 1, select("#", ...) do
parts[#parts + 1] = tostring((select(i, ...)))
end
table.insert(out, table.concat(parts, " "))
end
local server = ServerScriptService:FindFirstChild("Server", true)
if not server then
return "no Server folder"
end
local mods = {}
for _, d in ipairs(ServerScriptService:GetDescendants()) do
if d:IsA("ModuleScript") and d.Name == "CarManager" then
mods[#mods + 1] = d
end
end
log(string.format("found %d CarManager module(s)", #mods))
for i, m in ipairs(mods) do
local len = "?"
pcall(function()
len = tostring(#m.Source)
end)
log(
string.format(
" [%d] %s len=%s parent=%s",
i,
m:GetFullName(),
len,
m.Parent and m.Parent:GetFullName() or "nil"
)
)
end
-- Keep exactly one: prefer a direct child of the Server folder.
local keep = nil
for _, m in ipairs(mods) do
if m.Parent == server then
keep = m
break
end
end
keep = keep or mods[1]
local removed = 0
for _, m in ipairs(mods) do
if m ~= keep then
m:Destroy()
removed += 1
end
end
log("")
log(string.format("kept: %s", keep and keep:GetFullName() or "nil"))
log(string.format("removed: %d duplicate(s)", removed))
-- Confirm the survivor
local after = 0
for _, d in ipairs(ServerScriptService:GetDescendants()) do
if d:IsA("ModuleScript") and d.Name == "CarManager" then
after += 1
end
end
log(string.format("remaining CarManager count: %d", after))
if keep then
local len = "?"
pcall(function()
len = tostring(#keep.Source)
end)
log("survivor source length: " .. len .. " (disk file is 39591)")
end
return table.concat(out, "\n")