About

fivem-merge is a library made with Node.js which may pack a number of automobile sources into one useful resource.
Additionally comes with a CLI software.

Prerequisites

node-current
Node.js and NPM is required.

Installation

fivem-merge version
With npm:

$ npm set up -g fivem-merge

With yarn:

$ yarn international add fivem-merge

Usage

With shell inside your server’s resource directory:

$ vmerge --help
$ vmerge ./car1 ./car2 ./carEtc --output ./cars
fivem-merge is also a library and therefore can be used in Node.js
const vmerge = require('fivem-merge');
vmerge([ './car1', './car2', './carEtc' ], {
  outputPath: './cars'
}) // => Promise<undefined>

Examples

With shell inside your server’s resource directory:

$ # merges the 18lamborghini and the 17lamborghini resources into a new resource called lamborghinis
$ vmerge ./18lamborghini ./17lamborghini --output ./lamborghinis
$ # merges fd vehicle resources into one pack
$ vmerge ./fd1 ./fd2 ./fd3 ./fd4 --output ./fd
$ # if you don't want meta files to be linted automatically, add the `--lint false` parameter
For Node.js
const vmerge = require('fivem-merge');
/**
 * an array of vehicle resources to merge together
 * @type {string[]}
 */
const resourcesToMerge
/** @type {Object} */
const options = {
  /**
   * whether output XML files should be linted for human readability
   * @type {Boolean}
   * @default true
   */
  lintOutput: true,
  /**
   * the output directory of the merge resource
   * @type {string}
   */
  outputPath: './vehicles',
}

vmerge(resourcesToMerge, options)

How it works

The fivem-merge API creates a temp directory with a fxmanifest.lua containing a files table and data_file statements of all your selected resources’ manifests combined (also compatible with FXv1 __resource.lua).
All data files will be merged into the data folder. Unused or empty data files will be omitted.
Streamed files will then get moved into their own stream/<gamename> folder. If there are any vehicles with the same game or file name, an error will be emitted and will exit. You will need to manually fix this.
Once all these operations have been complete, the temp directory will get moved to your --output directory.

Keep in mind

fivem-merge is currently in an unstable release version, you will probably find bugs.
In case you do encounter a breaking error, getting frustrated and uninstalling the package doesn’t help.
Instead,
open an issue for help and so we are able to repair it, or in the event you’re a developer make a pull request.

fivem-merge can’t merge scripts (together with any vehicle_names.lua).
If any of your sources comprise something unmerge-able, a warning shall be emitted with particulars to merge manually.

As a result of my restricted information (and restricted documentation), fivem-merge presently solely helps the next information information:

  • HANDLING_FILE
  • VEHICLE_METADATA_FILE
  • CARCOLS_FILE
  • VEHICLE_VARIATION_FILE
  • VEHICLE_LAYOUTS_FILE
  • CONTENT_UNLOCKING_META_FILE

An error shall be emitted and the applying will exit with code 1 if the API meets a knowledge file not of the above.
If you want to assist make different information information supported, message me on Discord or make a pull request.

Contributions



Looking for paid scripts? Click here