Odometer (for Vehicles) - user-grinch/ModelExtras GitHub Wiki

Vehicle Odometer for Dashboard

Overview

The Odometer feature measures the distance traveled by the vehicle and displays the digits on the dashboard, supporting up to 6 numbers with a maximum value of 999999. There are two types of odometers available: Analog (with a rotating effect, used by default) and Digital (with an instant number change). Follow the instructions below to adapt your odometer to this function.

Dummy and Cylinder Setup

  1. Dummy Setup:

    • Add a dummy to your model and name it x_odometer. This dummy will serve as the anchor for the odometer setup.
  2. Cylinder Objects:

    • Under the x_odometer dummy, add 6 cylinder-shaped objects with 10 faces each. These cylinders represent the individual digits of the odometer.

Odometer Type Selection

  • For Analog Odometer (default, with rotating effect)
  • For Digital Odometer (instant number change)

Cylinder Placement

  • Positioning: Arrange the cylinders from right to left, ensuring visibility of all digits (e.g., 000000) from the dashboard.
  • Rotation: The script assumes the positioning of cylinders from right to left and rotates them accordingly to display the value. Keep this in mind while arranging the cylinders.

Example

Suppose you want to create an Analog Odometer for your vehicle:

  • Add a dummy to your model and name it x_odometer.

  • Under x_odometer, add 6 cylinder-shaped objects with 10 faces each, positioned and rotated appropriately to display the odometer digits.

    x_odometer
    ├── Cylinder_6 (10 faces)
    ├── Cylinder_5 (10 faces)
    ├── Cylinder_4 (10 faces)
    ├── Cylinder_3 (10 faces)
    ├── Cylinder_2 (10 faces)
    ├── Cylinder_1 (10 faces)
    

By following these instructions, you integrate the Odometer feature into your model, ensuring a realistic representation of the distance traveled on the dashboard.





JSONC Configuration Method (Recommended)

Instead of renaming nodes manually, you can configure the data via JSONC, allowing easier tuning and adjustments.

📂 JSONC File Location & Structure

📌 Path: ModelExtras/data/<model_id or model_name>.jsonc
📌 Example File: ModelExtras/data/522.jsonc (for model_ID 522)

{
    "odometer": {
        "kph": true,
        "digital": false
    }
}
⚠️ **GitHub.com Fallback** ⚠️