Can TpF3 scripting make cars overtake? #2

Closed
opened 2026-10-04 19:53:46 +00:00 by haylan · 1 comment
Owner

Question

Does the TpF3 script API (modifiers/filters, script-doc) expose what overtaking needs — vehicle position, speed, lane/path control, per-vehicle hooks — and at what script phase would it run? Verdict: feasible / partly / not, with the candidate mechanism(s) and evidence. Sources: modifiersfilters wiki page and https://wiki.transportfever3.com/script-doc/.

Part of #1

## Question Does the TpF3 script API (modifiers/filters, script-doc) expose what overtaking needs — vehicle position, speed, lane/path control, per-vehicle hooks — and at what script phase would it run? Verdict: feasible / partly / not, with the candidate mechanism(s) and evidence. Sources: modifiersfilters wiki page and https://wiki.transportfever3.com/script-doc/. Part of #1
haylan added the wayfinder:research label 2026-10-04 19:53:46 +00:00
Author
Owner

Resolution

Verdict: not feasible with the documented API (partly only as indirect approximations).

  • The modifiers/filters page covers resource-load modifiers (addModifier/addFileFilter), not runtime vehicle behaviour.
  • Scripts can read vehicles (landVehicleMoveSystem, MovePath, LandVehicle components) in update/postUpdate/handleEvent. api.engine is read-only.
  • Writes go through api.cmd. There is no command to set a land vehicle's lane, path position or speed. makeVehicleSetModifiersCmd (topSpeedScale) is the closest. makeComponentExchangeCmd is debug-only and limited to EmissionEmitter/ModelInstanceList.
  • No overtaking/passing term appears in api.engine, api.engine.system or api.cmd.

Candidate mechanisms: per-vehicle topSpeedScale (no passing), static lane layout via street/lane config (engine AI behaviour undocumented), and a custom-entity fake-car hack (unproven for road vehicles).

Open question: the LandVehicleMoveInfo fields and any native engine passing logic need in-game testing.

Findings: branch research/overtake-feasibility, file docs/research/overtake-feasibility.md (local, not pushed).

## Resolution **Verdict: not feasible with the documented API** (partly only as indirect approximations). - The modifiers/filters page covers resource-load modifiers (addModifier/addFileFilter), not runtime vehicle behaviour. - Scripts can read vehicles (landVehicleMoveSystem, MovePath, LandVehicle components) in update/postUpdate/handleEvent. api.engine is read-only. - Writes go through api.cmd. There is no command to set a land vehicle's lane, path position or speed. makeVehicleSetModifiersCmd (topSpeedScale) is the closest. makeComponentExchangeCmd is debug-only and limited to EmissionEmitter/ModelInstanceList. - No overtaking/passing term appears in api.engine, api.engine.system or api.cmd. Candidate mechanisms: per-vehicle topSpeedScale (no passing), static lane layout via street/lane config (engine AI behaviour undocumented), and a custom-entity fake-car hack (unproven for road vehicles). Open question: the LandVehicleMoveInfo fields and any native engine passing logic need in-game testing. Findings: branch `research/overtake-feasibility`, file `docs/research/overtake-feasibility.md` (local, not pushed).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: haylan/tpf3-overtake#2