Configuration ​
Edit shared/config.lua before starting the resource. Names and defaults in this page follow the current shared config; confirm any local overrides against your checked-out version.
lua
Config.Debug = false
Config.Database = { table = 'np_vehiclehandler_vehicles' }
Config.Streaming = {
enabled = true,
radius = 260.0,
despawnRadius = 340.0,
interval = 1500,
maxSpawnPerTick = 4,
maxSpawnCandidatesPerTick = 256,
maxDespawnPerTick = 8,
gridSize = 512.0,
}
Config.Snapshot = {
tokenTtl = 12000, dirtyCooldown = 2500, interval = 30000,
maxPerTick = 4, maxAdaptivePerTick = 64, maxConcurrentFallbackSaves = 4,
maxBytes = 180000, maxDepth = 12,
}
Config.Defaults = { persistent = false, streamed = true, bucket = 0, heading = 0.0 }
Config.Integrations = { mechanicStateBag = 'npmVeh', serverEngineCheck = true }
| Setting | Meaning |
|---|---|
Debug |
Enables handler diagnostic logging. |
Database.table |
SQL table used for saved persistent vehicles. Restrict this to a simple table identifier. |
Streaming.enabled |
Enables spatial entity streaming for records marked streamed. |
Streaming.radius |
Distance at which a streamed record becomes eligible to spawn for a nearby player in its bucket. |
Streaming.despawnRadius |
Outer distance used to avoid repeated spawn/despawn at the edge. Keep this greater than radius. |
Streaming.interval |
Delay between spatial passes, in milliseconds. |
Streaming.maxSpawnPerTick / maxDespawnPerTick |
Per-pass work caps that spread entity churn over time. |
Streaming.maxSpawnCandidatesPerTick |
Maximum parked record candidates examined per spatial pass. Fair cursors resume on later passes. |
Streaming.gridSize |
Spatial index cell size in world units. |
Snapshot.tokenTtl |
Lifetime of a requested owner snapshot, in milliseconds. |
Snapshot.dirtyCooldown |
Minimum interval between dirty-triggered capture requests. |
Snapshot.interval / maxPerTick |
Target period and minimum per-pass budget for the independent active snapshot scheduler. |
Snapshot.maxAdaptivePerTick |
Maximum adaptive per-pass snapshot budget; defaults to 64. Higher populations can exceed the target interval when capped. |
Snapshot.maxConcurrentFallbackSaves |
Maximum concurrent periodic transform-save workers for vehicles without a client owner. |
Snapshot.maxBytes / maxDepth |
Upper bounds for client-supplied property data. |
Defaults.persistent |
Default persistence for a generic registration; false keeps persistence opt-in. |
Defaults.streamed |
Default streamed mode. A persistent record may set this false to keep its entity active. |
Defaults.bucket / heading |
Default routing bucket and heading for definitions that omit them. |
Integrations.mechanicStateBag |
State-bag key used for optional np_mechanic tune data; defaults to npmVeh. |
Integrations.serverEngineCheck |
When true, asks the server to authorize engine use for handled vehicles. Authorization is denied while an initial response is pending. Defaults to true. |
An optional deformation adapter defaults to the resource name VehicleDeformation; set Integrations.vehicleDeformationResource to use a differently named compatible resource.
Persistent parking also requires the SQL schema and oxmysql. See Persistent parking.