Project Zomboid

Project Zomboid

评价数不足
[B41] Vehicle Respawn Manager
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
245.980 KB
8 月 10 日 上午 11:28
1 项改动说明 ( 查看 )

订阅以下载
[B41] Vehicle Respawn Manager

描述
Take control of where, what, and how vehicles respawn after salvaging them. Define your own spawn zones, balance vehicle types with category rates, protect safehouses, and keep performance smooth on live servers.

What it does
  • Zones: Create your own vehicle respawn zones. Mark them as Global (use the entire map's world vehicle zones) or Non-Global (restricted to world vehicle zones inside set coordinates).
  • Blacklist Zones: Mark areas where no vehicles ever spawn (great for big bases or event locations). Global blacklist disables spawning entirely.
  • Safehouse-aware: World vehicle zones that intersect a player safehouse (with a configurable buffer) are automatically excluded to avoid driveway/base spawns.
  • Categories & Rates: Group vehicles into categories (e.g., Common, Rare, Military) and assign a spawn rate per category. When a category is picked, a vehicle from that category is chosen at random.
  • Default Category: Optionally auto-assign all unassigned vehicle scripts to a chosen default category; maintain a per-zone blacklist to exclude the ones you never want.
  • Per-zone cap: Set a maximum vehicles per zone to prevent overcrowding.
  • Manual spawns: From the UI, queue spawns Random or Fixed (by script), with a count.
  • Import/Export: Save and load your full zone setup to JSON for backups or sharing.
  • Performance-friendly: Server-side queue with retries, timed spawns per tick, chunk-aware delayed spawns, and configurable intervals.
  • Logging: Toggle debug logs to see zone picks, attempts, failures/successes.

How spawning works (short version)
  • Priority: If a global blacklist exists > no spawns. Else pick the first Global Zone (if any), otherwise a Non-Global Zone.
  • Location: For Global Zones, pick a random world vehicle zone anywhere on the map. For Non-Global, pick a world defined vehicle zones which intersects with the picked zone and tries to spawn a vehicle in it.
  • Validation: Rejects world defined vehicle zones inside blacklist zones, near safehouses (based on a sandbox configurable buffer), water, or tiles too close to other vehicles. Respects the zone's max-vehicle limit.
  • Retries & queue: Limited attempts per request. If the chunk isn't ready or the point is blocked, the request is re-queued or delayed until the square loads.

Admin / Debug UI
  • Open via Debug Menu > Vehicle Respawn Manager or the Admin Panel.
  • Add/Remove zones; toggle Global/Blacklist; set x1,y1,x2,y2 for Non-Global/Blacklist zones.
  • Build categories and adjust spawn rate sliders. Assign vehicles (single or batch) or move unwanted ones to the Blacklist.
  • Optionally enable Default Category for Unassigned and pick which category it is.
  • Set Maximum Vehicles per Zone. Use Manual Vehicle Spawn to queue Random/Fixed spawns.
  • Export/Import your configuration as VehicleRespawnZones.json in your user Lua folder.

Sandbox options (server-side)
  • Enable Logging (debug level)
  • Engine Quality range (e.g., 1;100) - affects power/loudness; randomized per spawn
  • Max Spawn Attempts per Request and Max Random Zone Search Attempts
  • Max Timed Spawns Per Tick and Timed Spawns Delay (ms)
  • Queue Process Interval (ms)
  • Safehouse Check Interval (ms) and Safehouse Buffer Zone (tiles)
  • Spawn Clear Range (tiles around the point must be vehicle-free)
  • Square Load Spawn Delay (ms) for chunk-ready spawns

Requirements
  • ElyonLib
  • Starlit Library
Load these before Vehicle Respawn Manager.



Frequently Asked Question:

Is it compatible with Multiplayer?
Absolutely! Extensively tested and fully functional on MP servers.

Does it work on existing saves?
Absolutely! Enable it mid-save without issues.

Why don't vehicles spawn at my base?
World vehicle zones that intersect a safehouse plus its buffer are excluded. Adjust the Safehouse Buffer Zone sandbox option if needed.

A spawn failed in the logs - is that normal?
Yes. The system queues, delays, and retries spawns if chunks aren't loaded or tiles are blocked, up to the configured attempt limits.

Does it work for all game versions?
Only tested and working on the latest game version (v41.78.16).

Developer Note: This mod is in development, featuring the latest improvements and experimental features. While thoroughly tested, some features may be refined in future stable releases.

This mod was commissioned by the Dawn of the Dead community. I'm open to new commissions - contact me on Discord .ely0n or find me in the PZ Modding Discord.



[discord.gg]

[github.com][ko-fi.com]
引用自 author
This mod's permissions fall under TIS's policy On Lockdown [theindiestone.com]
This mod cannot be modified by anyone else, for anything else, at all, ever. Even if the user disappears, they would much rather you didn't touch the fruits of their hard labour.
[theindiestone.com]

Workshop ID: 3546341523
Mod ID: VehicleRespawnManager
7 条留言
KappaID 11 月 13 日 下午 5:10 
I'm trying this mod, an info, if i create a category like standard vehicles, do i need to populate the roster with the white list ? or the mod pick all cars in the standard category ?
El1oN  [作者] 10 月 24 日 下午 9:50 
@RatKnight1 Other people's lists may include car scripts from mods that you probably don't have. I recommend that you create your own setup with the mods that you have active.

@FoOLkiLLeR It only works after salvaging. It does not work with the initial spawn of cars, as those are very hardcoded and are not the purpose of this mod.

@Alkanshel You can manually initiate a respawn wave with a certain number of random cars.
RatKnight1 10 月 24 日 下午 3:10 
Anyone have an export of some pre built zone lists they could post? Would make it easier for the initial setup.

Love this mod overall :)
FoOLkiLLeR 10 月 18 日 上午 7:56 
Does this only work after salvaging cars? Or can these settings be used to determine what vehicles spawns in a zone that players have not visited yet? Specifically wondering if I can use this to blacklist certain vehicles from spawning in zones that have not visited yet.
Alkanshel 9 月 12 日 下午 7:15 
Any way to have vehicles replaced with new vehicles on occasion without having to salvage?
El1oN  [作者] 8 月 12 日 上午 9:40 
By 'main roads', do you mean all the big/highway roads in the map, or specific roads you want to keep completely free of vehicles? The mod can definetrly block respawns in any defined area using Blacklist Zones, so if you know the exact spots, you can stop all respawns there. FYI this mod is intended for vehicle respawns (after salvaging a vehicle) not initial spawns.
Selpak fili 8 月 12 日 上午 8:56 
can this mod make no vehicle spawn on the main roads ?