Torque Valley: Driving, Drift and Crash Sandbox
README.md
FakeCar
Makes the entity it sits on a pretend car: every frame it writes the driving
contract's values (car.kmh, car.speed, car.rpm, car.gear, car.gears,
car.rpmIdle, car.rpmRedline, car.rpmMax, car.throttle, car.brake,
car.boost, car.load, car.limiter, car.shiftCount) from a small drive
simulation: full throttle through six gears to the redline, braking with
downshifts, a stop, reverse, neutral, and again. Use it to test or demo
anything that reads car values (gauges, engine voices, cameras) without a
real car. Needs no sibling components and moves nothing.
local dummy = entity.spawn("dummyCar")
dummy.component.add("FakeCar", { speedScale = 1 })
entity.spawn("hud").component.add("GaugeCluster", { car = dummy })
Fields: running, speedScale. state() answers the simulation's speed,
rpm, gear, phase, throttle, brake and boost.