Log inGet started
World

Torque Valley: Driving, Drift and Crash Sandbox

README.md

engineVoices.voices

The eight engine voices, in the order car.voiceId uses: four, v8, v12, diesel, rotary, turbo, electric, kart. The module holds each voice's description and its default idle, redline and limiter rpm, plus the synthesis parameters that engineVoices.synth bakes it from. It also holds every clip the runtime plays (static identities, so a publish pins them), the skid sound for each driveSurfaces surface, and the calls that put a voice on a car. EngineVoice is the component that calls it at runtime. Game code calls attach, set and names.

local Voices = require("engineVoices.voices")
Voices.names()               --> { "four", "v8", "v12", "diesel", "rotary", "turbo", "electric", "kart" }
Voices.attach(car)           -- EngineVoice on the chassis, voice from car.voiceId
Voices.attach(car, "v12")    -- forced voice (or Voices.set(car, "v12") later)
Voices.detach(car)
Voices.get("v8").blurb       -- "Cross-plane V8 rumble and burble: ..."
Voices.surface(5).skid       --> "gravel"
Voices.firingHz("v8", 3000)  --> 200

The calls are names(), has(name), get(name), nameOf(id), idOf(name), loopName(voice, band, onLoad), firingHz(voice, rpm), clips(), surface(id), attach(car, voice?, volume?), set(car, voice) and detach(car).