Files
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

84 lines
2.5 KiB
Luau

-- Rebuild the map with a BUSTED require() cache.
--
-- PITFALL (cost a build cycle on 2026-08-02): require() caches per Studio
-- session and keyed by INSTANCE. Pushing new .Source into the existing
-- ModuleScript does NOT invalidate that cache, so `require(MapBuilder)`
-- happily returns the OLD compiled module and the map rebuilds from stale
-- code -- the diagnostic then reports failures that the source has already
-- fixed (legacy PARingPillar present, no ramp segments).
--
-- Fix: swap in CLONES. A clone is a different instance, so it misses the
-- cache and is compiled fresh. Circuit must be swapped too, because
-- MapBuilder resolves it BY PATH -- putting the clone at the same path is
-- what makes the fresh MapBuilder pick up the fresh Circuit.
local SSS = game:GetService("ServerScriptService")
local RS = game:GetService("ReplicatedStorage")
local mbOrig = SSS.Server.MapBuilder
local ciOrig = RS.Shared.Circuit
-- Clone both, park the originals under a holder so the paths are free.
local holder = game:GetService("ServerStorage"):FindFirstChild("_cachebust")
if holder then
holder:Destroy()
end
holder = Instance.new("Folder")
holder.Name = "_cachebust"
holder.Parent = game:GetService("ServerStorage")
local ciClone = ciOrig:Clone()
local mbClone = mbOrig:Clone()
ciOrig.Parent = holder
ciOrig.Name = "Circuit_old"
mbOrig.Parent = holder
mbOrig.Name = "MapBuilder_old"
ciClone.Name = "Circuit"
ciClone.Parent = RS.Shared
mbClone.Name = "MapBuilder"
mbClone.Parent = SSS.Server
local out = {}
local function say(s)
table.insert(out, s)
end
say("swapped in fresh clones (require cache bypassed)")
local old = workspace:FindFirstChild("Map") or workspace:FindFirstChild("Circuit")
if old then
old:Destroy()
say("destroyed previous Map")
end
local ok, err = pcall(function()
local MB = require(mbClone)
MB.build()
end)
if not ok then
say("BUILD_ERROR: " .. tostring(err))
return table.concat(out, "\n")
end
local m = workspace:FindFirstChild("Map") or workspace:FindFirstChild("Circuit")
local n = 0
if m then
n = #m:GetDescendants()
end
say("BUILD_OK parts=" .. tostring(n))
-- Quick confirmation that the NEW code path actually ran.
local counts = { PARingPillar = 0, PAEntryRamp = 0, PAExitRamp = 0, PARampPillar = 0, PARampKerb = 0 }
for _, d in ipairs(workspace:GetDescendants()) do
for k in pairs(counts) do
if string.sub(d.Name, 1, #k) == k then
counts[k] += 1
end
end
end
for k, v in pairs(counts) do
say((" %-14s %d"):format(k, v))
end
return table.concat(out, "\n")