API ReferenceGE Extensionsutil
Save Dynamic Data
Automated tool that iterates all vehicle configs, spawns each, and runs dynamic data tests to generate vehicle info files.
Automated tool that iterates all vehicle configs, spawns each, and runs dynamic data tests to generate vehicle info files.
Overview
util_saveDynamicData spawns every vehicle configuration on the autotest level and runs dynamicVehicleData.performTests() on each via vlua. Results are cached as info_<config>.touched files - existing configs are skipped. Includes watchdog and max-runtime safety.
Extension path: lua/ge/extensions/util/saveDynamicData.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
onInit | () | Logs initialization. |
onExtensionLoaded | () | Loads blacklist files, ensures camera/extensions are ready. |
onExtensionUnloaded | () | Logs unload. |
work | (pcFile?, vehicle?) | Starts the test pipeline. Optionally filters by config/vehicle name. |
vehicleDone | () | Signals that the current vehicle's tests are complete. |
heartbeat | () | Resets the watchdog timer (called from vlua). |
onClientStartMission | (levelPath) | Marks the level as ready when autotest loads. |
Internals
Test Flow
work(pcFile, vehicle)starts the job system coroutine_workMain.- Waits for mod manager readiness and
autotestlevel load. - Iterates filtered configs from
core_vehicles.getConfigList(true). - For each config without an existing
.touchedfile:- Spawns the vehicle via
core_vehicles.replaceVehicle. - Loads
dynamicVehicleDataextension on the vehicle. - Calls
dynamicVehicleData.performTests(model, config)viaqueueLuaCommand. - Waits for
vehicleDone()signal, watchdog timeout (20s), or max runtime (600s).
- Spawns the vehicle via
- After all configs, calls
shutdown(0).
Blacklist
Vehicles can be excluded via blacklist.json or blacklistDefault.json at the root. Blacklisted model names are skipped.
Safety Mechanisms
- Watchdog: If
heartbeat()isn't called within 20 seconds, the vehicle is skipped. - Max Runtime: Each vehicle has a 600-second cap.
- Physics Speed: Set to
physicsSpeedFactor(default 0) during tests.
How It Works
- Load extension, optionally pass filter params to
work(). autotestlevel loads automatically.- Each vehicle config is spawned, tested, and results saved.
- Game shuts down on completion.
Lua Examples
-- Run all vehicle configs
extensions.util_saveDynamicData.work()
-- Run only pickup configs
extensions.util_saveDynamicData.work(nil, "pickup")
-- Run a specific config
extensions.util_saveDynamicData.work("d15_4wd_A", "pickup")Additional Exports
M.heartbeat- (undocumented)M.onClientStartMission- (undocumented)M.onExtensionLoaded- (undocumented)M.onExtensionUnloaded- (undocumented)M.onInit- (undocumented)M.vehicleDone- (undocumented)M.work- (undocumented)