IVF Carcols (Per vehicle carcols) - user-grinch/ModelExtras GitHub Wiki

🟡 ImVehFt Method (Legacy)

The IVF Carcols file (.ivfc extension) is used to define custom vehicle color variations in GTA: San Andreas when using ModelExtras. It allows separate color configurations independent of carcols.dat. You can open it with any notepad. The file can have any name (it is preferable to name it with the name of the vehicle model, for better organization), but the .ivfc extension is mandatory.

📂 File Structure

An .ivfc file consists of 3 main sections:

1️⃣ Vehicle ID Declaration – Specifies which vehicle the colors apply to.
2️⃣ Color Definitions 🎨 – Defines available colors using RGB values.
3️⃣ Car Variation Definitions 🔄 – Assigns specific color combos to the vehicle.

1️⃣ 🚘 Vehicle ID Declaration

The file starts with vehicle_id, which links the color set to a specific vehicle.

vehicle_id 451

👉 451 is the vehicle's ID in the game.

2️⃣ 🎨 Color Definitions

This section lists the available colors for the vehicle using RGB values (0-255).

🔹 Format:

  • Starts with num_colors (total number of colors).
  • Each color is defined using R G B values.
  • Comments (#) can be used to label colors.

📝 Example:

num_colors 7

#  R   G   B
0   0   0         # Col 0 (Black) ⚫
227 242 223       # Col 1 (Light Gray) ⚪
219 38  38        # Col 2 (Red) 🔴
246 170 39        # Col 3 (Orange) 🟠
31  81  140       # Col 4 (Blue) 🔵
37  37  39        # Col 5 (Dark Gray) ⚫
145 115 71        # Col 6 (Brown) 🟤

3️⃣ 🔄 Car Variation Definitions

This section assigns color combinations to the vehicle.

🔹 Format:

  • Starts with num_variations (total number of color combinations).
  • Each variation consists of 4 color indexes:
    • Primary Color
    • Secondary Color
    • Tertiary Color (often 0, unused)
    • Quaternary Color (often 0, unused)

📝 Example:

num_variations 8

# Primary Secondary Tertiary Quaternary
2        5        0         0
2        6        0         0
2        2        0         0
0        6        0         0
0        2        0         0
1        6        0         0
3        5        0         0
4        6        0         0

👉 These numbers reference the colors from the Color Definitions section.

📎 File Requirements

✅ The file must have a .ivfc extension.
✅ Indices in num_variations must reference valid colors in num_colors.
✅ RGB values must be within 0-255.
✅ Comments (#) can be used for clarity but are ignored by the parser.

📁 Example .ivfc File

This is how an IVF Carcols file should look:

# IVF Carcols Example File
# This is a comment

vehicle_id 451 

# Define colors
num_colors 7

#  R   G   B
0   0   0         # Col 0 (Black) ⚫
227 242 223       # Col 1 (Light Gray) ⚪
219 38  38        # Col 2 (Red) 🔴
246 170 39        # Col 3 (Orange) 🟠
31  81  140       # Col 4 (Blue) 🔵
37  37  39        # Col 5 (Dark Gray) ⚫
145 115 71        # Col 6 (Brown) 🟤

# Define color variations
num_variations 8

# Primary Secondary Tertiary Quaternary
2        5        0         0
2        6        0         0
2        2        0         0
0        6        0         0
0        2        0         0
1        6        0         0
3        5        0         0
4        6        0         0

🛠️ How to Use

📌 Place the .ivfc file inside:

ModelExtras/data/

📌 Make sure the vehicle ID matches the intended vehicle model.

Got it! Here's the updated section in Markdown format that includes support for the new JSONC format alongside the original .ivfc format:

🟢 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)

📁 File Structure

A JSONC file contains the following fields:

  • "carcols" – The main object.
    • "colors" – A list of RGB color values.
    • "variations" – A list of color combinations using indices from the color list.

📄 JSONC Example

// the name of the json file must either be the model id or model name

{
  "carcols": {
    "colors": [
      { "red": 255, "green": 0, "blue": 0 },     // Red 🔴
      { "red": 255, "green": 0, "blue": 0 },     // Red again 🔴
      { "red": 255, "green": 0, "blue": 0 },     // Red again 🔴
      { "red": 0, "green": 255, "blue": 0 },     // Green 🟢
      { "red": 0, "green": 255, "blue": 0 },     // Green again 🟢
      { "red": 0, "green": 255, "blue": 0 },     // Green again 🟢
      { "red": 0, "green": 0, "blue": 255 },     // Blue 🔵
      { "red": 0, "green": 0, "blue": 255 }      // Blue again 🔵
    ],
    "variations": [
      { "primary": 0, "secondary": 0, "tertiary": 0, "quaternary": 0 },
      { "primary": 1, "secondary": 0, "tertiary": 0, "quaternary": 0 },
      { "primary": 2, "secondary": 0, "tertiary": 0, "quaternary": 0 },
      { "primary": 3, "secondary": 0, "tertiary": 0, "quaternary": 0 },
      { "primary": 4, "secondary": 0, "tertiary": 0, "quaternary": 0 },
      { "primary": 5, "secondary": 0, "tertiary": 0, "quaternary": 0 },
      { "primary": 6, "secondary": 0, "tertiary": 0, "quaternary": 0 },
      { "primary": 7, "secondary": 0, "tertiary": 0, "quaternary": 0 }
    ]
  }
}