Can a script swap the positions of a held-back follower and its leader, so that the faster vehicle continues from the leader's spot and the slower one from the follower's? Candidate: on the GUI thread, exchange the two vehicles' MovePath components (route plus position) with api.cmd.debug.makeComponentExchangeCmd. The callbacks report the game's success or failure per exchange. The doc comment only promises EmissionEmitter/ModelInstanceList, and from the engine thread the command can't be sent at all.
HITL: the human runs a save copy with debug mode on and watches a fast/slow pair. The probe on branch prototype/vehicle-probe (guiUpdate in overtake_probe.script.tl) does the flip at most twice and traces both vehicles for about 10 s.
Outcome:
Does the exchange succeed?
Do the vehicles visibly swap and keep driving normally (route, stops, line)?
Is debug mode required?
Go/no-go for the position flip as the single-lane overtaking mechanism.
Part of #1
## Question
Can a script swap the positions of a held-back follower and its leader, so that the faster vehicle continues from the leader's spot and the slower one from the follower's? Candidate: on the GUI thread, exchange the two vehicles' `MovePath` components (route plus position) with `api.cmd.debug.makeComponentExchangeCmd`. The callbacks report the game's success or failure per exchange. The doc comment only promises `EmissionEmitter`/`ModelInstanceList`, and from the engine thread the command can't be sent at all.
HITL: the human runs a save copy with debug mode on and watches a fast/slow pair. The probe on branch `prototype/vehicle-probe` (`guiUpdate` in `overtake_probe.script.tl`) does the flip at most twice and traces both vehicles for about 10 s.
Outcome:
1. Does the exchange succeed?
2. Do the vehicles visibly swap and keep driving normally (route, stops, line)?
3. Is debug mode required?
4. Go/no-go for the position flip as the single-lane overtaking mechanism.
No-go: a script cannot swap (or otherwise set) the positions of road vehicles.
api.cmd.debug.makeComponentExchangeCmd(vehicle, movePath) fails at sendCommand with Error decoding argument #3: The lua object can't be cast to desired type on both the engine thread (without callback) and the GUI thread (with callback; the callback is never reached). Debug mode was active. The command only accepts EmissionEmitter/ModelInstanceList, as its doc says.
No other command writes a line vehicle's position or route. The only teleport is makeVehicleSendToDepotCmd(…, jumpToDepotEntity), which can only target a depot. makeCustomVehicleCreateOrUpdateCmd is aircraft-only.
Together with the earlier results (no native passing, timeToIgnore unreachable, set-line doesn't force lanes, segment rebuild has no effect on single-lane roads), no script mechanism moves a vehicle past another on a single-lane road.
Details: docs/research/vehicle-probe.md on branch prototype/vehicle-probe (the flip code is last in commit 0465a93 and removed in 9623abb).
## Resolution
**No-go: a script cannot swap (or otherwise set) the positions of road vehicles.**
- `api.cmd.debug.makeComponentExchangeCmd(vehicle, movePath)` fails at `sendCommand` with `Error decoding argument #3: The lua object can't be cast to desired type` on **both** the engine thread (without callback) and the GUI thread (with callback; the callback is never reached). Debug mode was active. The command only accepts `EmissionEmitter`/`ModelInstanceList`, as its doc says.
- No other command writes a line vehicle's position or route. The only teleport is `makeVehicleSendToDepotCmd(…, jumpToDepotEntity)`, which can only target a depot. `makeCustomVehicleCreateOrUpdateCmd` is aircraft-only.
- Together with the earlier results (no native passing, `timeToIgnore` unreachable, set-line doesn't force lanes, segment rebuild has no effect on single-lane roads), **no script mechanism moves a vehicle past another on a single-lane road.**
Details: docs/research/vehicle-probe.md on branch prototype/vehicle-probe (the flip code is last in commit 0465a93 and removed in 9623abb).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #1
Question
Can a script swap the positions of a held-back follower and its leader, so that the faster vehicle continues from the leader's spot and the slower one from the follower's? Candidate: on the GUI thread, exchange the two vehicles'
MovePathcomponents (route plus position) withapi.cmd.debug.makeComponentExchangeCmd. The callbacks report the game's success or failure per exchange. The doc comment only promisesEmissionEmitter/ModelInstanceList, and from the engine thread the command can't be sent at all.HITL: the human runs a save copy with debug mode on and watches a fast/slow pair. The probe on branch
prototype/vehicle-probe(guiUpdateinovertake_probe.script.tl) does the flip at most twice and traces both vehicles for about 10 s.Outcome:
Resolution
No-go: a script cannot swap (or otherwise set) the positions of road vehicles.
api.cmd.debug.makeComponentExchangeCmd(vehicle, movePath)fails atsendCommandwithError decoding argument #3: The lua object can't be cast to desired typeon both the engine thread (without callback) and the GUI thread (with callback; the callback is never reached). Debug mode was active. The command only acceptsEmissionEmitter/ModelInstanceList, as its doc says.makeVehicleSendToDepotCmd(…, jumpToDepotEntity), which can only target a depot.makeCustomVehicleCreateOrUpdateCmdis aircraft-only.timeToIgnoreunreachable, set-line doesn't force lanes, segment rebuild has no effect on single-lane roads), no script mechanism moves a vehicle past another on a single-lane road.Details: docs/research/vehicle-probe.md on branch prototype/vehicle-probe (the flip code is last in commit
0465a93and removed in9623abb).