Groups Reference
Module defined in `lua/common/jbeam/groups.lua`. Processes group arrays on JBeam rows, converting group name lists into indexed lookup tables and assigning group IDs.
Module defined in lua/common/jbeam/groups.lua. Processes group arrays on JBeam rows, converting group name lists into indexed lookup tables and assigning group IDs.
Exports
Functions
M.process(vehicle)
Walks all sections/rows of the vehicle data. For each row with a group field (table of group name strings), assigns unique integer IDs to each group name and converts the group array into a map of {[groupId] = groupName}. Sets row.firstGroup to the first group's ID. Populates vehicle.groups with the global {groupName → groupId} map.
- Parameters:
vehicle- table - The assembled vehicle data table
- Returns:
self(module table, for chaining)
Internal Notes
- Group IDs are assigned incrementally starting from 0.
- Empty string group names (
"") are skipped. - The
vehicle.groupstable maps group name → integer ID (shared across all sections). - Must run after
processWheelsandprocessRotatorssince those add rows with group data. row.firstGroupstores the ID of the first non-empty group for quick access.
ExpressionParser Reference
Module defined in `lua/common/jbeam/expressionParser.lua`. Parses and evaluates `$=` expressions in JBeam data, providing a sandboxed math environment with variable substitution.
Interaction Reference
Module defined in `lua/common/jbeam/interaction.lua`. Loads and merges `.interaction.json` files for vehicle input action definitions.