VehicleTelemetry
public sealed class VehicleTelemetryNamespace Chassis.Api
Added in 1.2.0
Everything Chassis knows about a vehicle’s driving state at one moment, from ChassisApi.Telemetry. Each value carries its own validity; see GaugeReading.
Example
var t = ChassisApi.Telemetry(vehicle);if (t.SpeedKmh.Valid && t.SpeedKmh.Value > 120f) MelonLogger.Msg("Too fast: " + t.SpeedKmh);Properties
Section titled “Properties”Vehicle
Section titled “Vehicle”public LandVehicle Vehicle { get; }Added in 1.2.0
The vehicle the snapshot is of.
public float At { get; }Added in 1.2.0
Time.time when the snapshot was taken.
public GaugeReading Speed { get; }Type: GaugeReading
Added in 1.2.0
Speed in the player’s unit (km/h or mph, ChassisApi.UsesMph), as the speedometer shows it.
SpeedKmh
Section titled “SpeedKmh”public GaugeReading SpeedKmh { get; }Type: GaugeReading
Added in 1.2.0
Speed in km/h as the speedometer shows it: vanilla’s Speed_Kmh times 1.4, never negative.
Value On a passenger’s peer it trails the driver’s by about 0.4 s.
public GaugeReading Rpm { get; }Type: GaugeReading
Added in 1.2.0
Estimated engine speed in revolutions per minute: 800 idle up to 6000 at top speed, 0 with nobody aboard.
Value Vanilla has no engine model; this follows speed and throttle as vanilla’s engine sound does.
Throttle
Section titled “Throttle”public GaugeReading Throttle { get; }Type: GaugeReading
Added in 1.2.0
Throttle from -1 (reverse) to 1. Synced by Chassis from the driver’s peer, up to 10 times a second.
Handbrake
Section titled “Handbrake”public GaugeReading Handbrake { get; }Type: GaugeReading
Added in 1.2.0
1 while the handbrake is on, else 0. Synced like Throttle.
public GaugeReading Brake { get; }Type: GaugeReading
Added in 1.2.0
1 while the brakes are on, else 0.
Reverse
Section titled “Reverse”public GaugeReading Reverse { get; }Type: GaugeReading
Added in 1.2.0
1 while the vehicle drives backwards, else 0.
Headlights
Section titled “Headlights”public GaugeReading Headlights { get; }Type: GaugeReading
Added in 1.2.0
1 while the headlights are on, else 0.
Indicator
Section titled “Indicator”public GaugeReading Indicator { get; }Type: GaugeReading
Added in 1.2.0
-1 left, 0 off, 1 right; 0 while the hazard lights flash.
Hazard
Section titled “Hazard”public GaugeReading Hazard { get; }Type: GaugeReading
Added in 1.2.0
1 while the hazard lights flash, else 0.
public GaugeReading Steer { get; }Type: GaugeReading
Added in 1.2.0
Front wheel angle from -1 (full left) to 1 (full right).
public GaugeReading Clock { get; }Type: GaugeReading
Added in 1.2.0
Game time as HHMM, e.g. 1730 for half past five in the afternoon.
OdometerKm
Section titled “OdometerKm”public GaugeReading OdometerKm { get; }Type: GaugeReading
Added in 1.2.0
Total distance in km, counted by the host with the speedometer’s factor and saved with player-owned vehicles.
TripKm
Section titled “TripKm”public GaugeReading TripKm { get; }Type: GaugeReading
Added in 1.2.0
Distance in km since the last trip reset.
Occupied
Section titled “Occupied”public GaugeReading Occupied { get; }Type: GaugeReading
Added in 1.2.0
1 when anyone is aboard (players or NPCs), else 0.
Driver
Section titled “Driver”public GaugeReading Driver { get; }Type: GaugeReading
Added in 1.2.0
1 when someone is at the wheel (a player or an NPC), else 0.
Methods
Section titled “Methods”public GaugeReading Get(string source)Types: GaugeReading
Added in 1.2.0
Any source by name, read now; also the ones mods registered.
| Parameter | |
|---|---|
source | A name from ChassisApi.GaugeSources. |