chore(prototype): rebuild via replaceSegment; record mod/game-folder findings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
39f2c63667
commit
949462566e
2 files changed
+15
-17
No files matched your search
@@ -8,7 +8,7 @@
|
||||
local TAG = "[overtake_probe] "
|
||||
local INTERVAL = 2.0
|
||||
local MAX_GAP = 40.0
|
||||
local MAX_REBUILDS = 0 -- rebuild disabled: proposals were silently rejected (segments kept their ids)
|
||||
local MAX_REBUILDS = 3 -- hand-built proposals were silently rejected; now via api.engine.util.proposal.replaceSegment
|
||||
local MAX_SETLINES = 0 -- set-line disabled: lanes ahead get re-planned by the engine anyway, no forced lane change
|
||||
local MAX_JUMPS = 3 -- EXPERIMENT: debug component exchange of MovePath with pathPos moved past the leader
|
||||
local JUMP_AHEAD = 15.0
|
||||
@@ -66,22 +66,9 @@ local function rebuildable(seg : integer) : boolean, string
|
||||
end
|
||||
|
||||
local function rebuild(seg : integer)
|
||||
local be = api.engine.getComponent(seg, api.type.ComponentType.BASE_EDGE) as Engine.Component.BaseEdge
|
||||
local bes = api.engine.getComponent(seg, api.type.ComponentType.BASE_EDGE_STREET) as Engine.Component.BaseEdgeStreet
|
||||
local owned = api.engine.getComponent(seg, api.type.ComponentType.PLAYER_OWNED) as Engine.Component.PlayerOwned
|
||||
|
||||
local sae = api.type.SegmentAndEntity.new()
|
||||
sae.entity = -1
|
||||
sae.type = 0
|
||||
sae.comp = be
|
||||
sae.streetEdge = bes
|
||||
if owned ~= nil then sae.playerOwned = owned end
|
||||
|
||||
local proposal = api.type.SimpleProposal.new()
|
||||
proposal.streetProposal.edgesToRemove[1] = seg
|
||||
proposal.streetProposal.edgesToAdd[1] = sae
|
||||
-- engine-state scripts can't pass a callback; the next dump shows the effect
|
||||
api.cmd.sendCommand(api.cmd.makeWorldBuildProposalCmd(proposal, nil, true, false))
|
||||
-- same call the official campaign (mission 03 init.script.tl) uses to refresh a road segment in place
|
||||
local proposal = api.engine.util.proposal.replaceSegment(seg)
|
||||
api.cmd.sendCommand(api.cmd.makeWorldBuildProposalCmd(proposal, nil, true, true))
|
||||
end
|
||||
|
||||
-- lanes of the next few path edges, to see whether a re-path changes the lane choice
|
||||
|
||||
Reference in new issue
Block a user