API ReferenceGE Extensionsflowgraphnodesvehicle
Custom Parts Config Provider
- **Node Name:** `Custom Parts Config Provider`
Overview
- Node Name:
Custom Parts Config Provider - Category:
provider - File:
extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
Provides an interactive editor for building a custom vehicle parts configuration. Allows loading configs from files, copying from the current vehicle, and manually editing part slots and tuning variables. Outputs a model name and config table usable by vehicle spawn nodes.
Pin Schema
Output Pins
| Pin | Type | Table Type | Description |
|---|---|---|---|
model | string | - | The model of the selected vehicle |
config | table | vehicleConfig | The parts/vars configuration table |
Internals
Key Methods
| Method | Description |
|---|---|
init() | Initializes empty partConfig with parts and vars tables, and sorted key lists |
drawCustomProperties() | Renders the ImGui editor UI: file loader, current vehicle reader, and key-value pair editors |
showKVPairs(name, field, tpe) | Generic ImGui editor for parts (string values) or vars (number values) with add/remove/sort |
sortKeys() | Alphabetically sorts part and var keys for display |
drawMiddle(builder, style) | Shows model name and part/var counts in the node body |
work() | Outputs the current partConfig and model to pins |
_onSerialize(res) | Saves all editor state for project persistence |
_onDeserialized(nodeData) | Restores editor state and re-sorts keys |
Editor Sections
- Load from File - Uses the vehicle selector UI to pick a model/config
.pcfile, then loads it withjsonReadFile. - Current Vehicle - Reads config from the player vehicle. Supports reading from
.pcfiles or deserializing inline configs. Offers "Copy from Vehicle", "Copy only Parts", and "Copy only Vars" buttons. - Parts Editor - Editable key-value pairs (string keys → string values) for JBeam slot assignments.
- Vars Editor - Editable key-value pairs (string keys → float values) for tuning variables.
How It Works
- The node stores a
partConfig = {parts = {}, vars = {}}table internally. - The custom properties panel lets the user populate this config from files or the current vehicle.
- Parts and vars can be manually added, edited, or removed through the ImGui interface.
- On each frame,
work()outputs the config table and model string for downstream nodes (e.g., spawn vehicle).
Usage Example
-- In a flowgraph:
-- [Custom Parts Config Provider] → model → [Spawn Vehicle]
-- → config → [Spawn Vehicle]
-- The partConfig structure:
local partConfig = {
parts = {
["slot_engine"] = "engine_v8",
["slot_transmission"] = "transmission_6speed",
},
vars = {
["$spring_F"] = 45000,
["$damp_F"] = 2500,
},
partConfigFilename = "/vehicles/etk800/sport.pc" -- optional
}Key Dependencies
jsonReadFile()- loads.pcconfig filescore_vehicles.getModel()- retrieves available configs for a modelui_flowgraph_editor.vehicleSelector()- shared vehicle/config picker widgetffi- for ImGui text input buffer handling
See Also
- Align for Coupling (Flowgraph Node) - Related reference
- Apply Velocity to Vehicle (Flowgraph Node) - Related reference
- Boost Vehicle (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide