Requirements#
- Node.js 18 or newer, on the machine where you add packs. It is only used to run the generator, not on the game server.
- Packs in the usual GTA V audio layout:
.awcwave banks and.reldata files.
Installation steps#
You bought a pack called "2JZ Swap" that contains audio/2jz.awc, 2jz_game.dat151.rel, 2jz_sounds.dat54.rel and the audio object is called my_2jz.
Copy the pack into
packs/my_2jz/, keeping its folder structure.Add
packs/my_2jz/sound.json:{ "name": "my_2jz", "label": "2JZ inline six", "tier": 3 }From this resource folder run
node tools/generate-sounds.cjs. It prints how many packs anddata_filelines it wrote.Make sure
ensure glitch-engineSoundsis in server.cfg before the scripts that use it, then restart the resource.From any server script, set the sound on a vehicle:
local ok, err = exports['glitch-engineSounds']:SetVehicleSound(NetworkGetNetworkIdFromEntity(vehicle), 'my_2jz') -- ok is true, or false plus 'not_installed', 'no_entity', 'not_a_vehicle' or 'bad_net_id' exports['glitch-engineSounds']:SetVehicleSound(netId, nil) -- stop forcing it (the model default sound comes back straight away)
Start order#
Ensure glitch-engineSounds before any script that uses the sounds, and restart those scripts after you change a pack.
ensure glitch-engineSounds
ensure your-mechanic-script
Adding a pack#
Make a folder in
packs/, for examplepacks/my_2jz/.Copy the pack files into it. Accepted file types are
.awc,.rel,.json,.txtand.md. The generator refuses anything else.Add a
sound.json:Field Required Meaning nameyes The audio object name defined inside the pack. Letters, digits, _and-only.labelyes Display text for scripts that show a list. tieryes A whole number from 1 to 4. categoryno A short tag such as motorcycle.builtinno truefor an alias pack (see below).audiowith builtinThe vanilla GTA engine audio name the alias plays, for example adder.tierandcategoryare stored and passed on as they are. What they mean (engine stage, vehicle class, price band) is up to the script that reads them. This resource does not filter by them.Run
node tools/generate-sounds.cjs.Restart
glitch-engineSounds, then restart the scripts that use it.