API ReferenceGE Extensionsutil
util/vehicleRopeDebug - Rope Physics Debug UI
Reference for `extensions/util/vehicleRopeDebug.lua`. Provides an ImGui debug sandbox for visualizing and editing rope physics parameters on the current vehicle.
Reference for extensions/util/vehicleRopeDebug.lua. Provides an ImGui debug sandbox for visualizing and editing rope physics parameters on the current vehicle.
Exports
| Key | Signature | Description |
|---|---|---|
onUpdate | (dt) | Main update loop: draws debug visualization and ImGui window |
Internals
Debug Visualization
- Strain-colored segments: Lines between rope nodes colored green→red based on stretch strain.
- Node spheres: Sized by mass; colored by type (blue=anchor A, red=fixed B, green=free B, light blue=intermediate).
- Direction arrows: Shows anchor direction vectors (magenta for A, cyan for B).
- Mass labels: Optional per-node mass text display.
Node Interaction
- Hover detection: Raycasts against node spheres (0.1m radius) to find hovered nodes.
- Drag support: Click-drag nodes on XY plane at node's Z height. Updates rope anchor positions and intermediate node positions.
ImGui Window ("Rope Visual Sandbox")
Exposes all rope parameters for live editing:
- Anchors: Base position (editable) and calculated position (read-only) for A and B, plus direction vectors.
- Physics: Node count, length scale, diameter, damping, total mass, mass falloff, iterations, gravity (XYZ), Young's modulus.
- Constraints: XPBD toggle, bending (stiffness + segment length), strain limit.
- Environment: Wind scale, wind drag, simulation FPS.
- Rendering: Material name, render toggle, debug visualization toggles.
- Stats: Max/avg strain, current/rest length, sim time.
Performance Tracking
- Tracks per-rope sim times over 60-frame history.
- Computes average, max, and spike counts (>2x average).
- Displays total sim/render time as percentage of frame budget.
How It Works
- Load via
extensions.load('util_vehicleRopeDebug'). - Automatically finds ropes on the current player vehicle via
be:getPlayerVehicle(0).ropeIds. - Auto-selects first rope; UI parameters sync bidirectionally with the rope object.
- Changes to physics parameters (node count, etc.) trigger
rope:rebuild(). - Debug drawing happens every frame via
debugDrawercalls.
-- Load the debug UI
extensions.load('util_vehicleRopeDebug')
-- The ImGui window appears automatically with rope controlsAdditional Exports
M.onUpdate- (undocumented)
Test JSON Files Syntax
Validates the syntax of every JSON, JBeam, and PC file in the game by attempting to decode each.
util/worker - Batch Job Worker
Reference for `extensions/util/worker.lua`. Processes batch work items from a JSON file (`/work.json`) for automated tasks like mesh compilation, imposter generation, mod testing, and vehicle previews