Switch on cfggameplay.json
Object Spawner is loaded through cfggameplay.json, so enableCfgGameplayFile must be on in your Nitrado settings.
Create the JSON file
Each object needs a classname, a position and a rotation. Map editors export these files for you. Put the file in a custom folder inside your mission folder.
List it in cfggameplay.json
Add the file's path to objectSpawnersArr in WorldsData. You can list several files.
Check and restart
Validate every file with the JSON validator. A single missing comma stops the objects loading. Then restart.
What you can build with it
Anything that exists in the base game as a placeable object: buildings, walls, wrecks, containers, rocks, trees and props. Common uses on console servers:
- A safe zone or trader area at a crossroads, with walls and containers
- An arena or a PvP event area, fenced off for the weekend
- Extra military points of interest so loot isn't all in the same few bases
- Bridges, ramps and roadblocks that change how players move around the map
Get positions right
pos is the object's position in metres: x across the map, y height and z up the map. ypr is yaw, pitch and roll in degrees, so 90 in the first value turns it a quarter turn. Most people place objects in a map editor and export the file rather than typing numbers by hand.
Height is the part that goes wrong. An object a metre too low sinks into the ground, and one too high floats. If you edit positions by hand, change them in small steps and check in game.
Keep files small and named
Use one file per area, such as trader.json and arena.json, so you can switch one off without touching the others. Very large files are slow to edit and hard to check. The JSON Splitter breaks a big export into smaller files by size or map area.
Watch performance and loot
Every object is something the server has to load and players' consoles have to draw. A few hundred objects is fine. Many thousands in one place can make that area stutter. Objects added this way don't come with loot spawn points of their own, so to make a new building useful, place containers or plan a trader there.
Test on a quiet restart
Add new buildings at a quiet time, then walk the area yourself. Check players can't get stuck in walls, that doors open, and that nothing floats above the ground.