Skip to content

Pack Making General File Structure

Turbo Defender edited this page Jun 15, 2021 · 2 revisions

Before you even attempt to make a pack, you need to decide how you want your files to be arranged in the pack itself. Packs can have multiple file structures, and which one you choose determines where your files need to be for MTS to find them. This is to allow pack authors flexibility in how they arrange their pack components and to make it easier to see where things are and where components are missing. There are a few things you should be aware of when choosing your file structure:

  • All assets MUST be located in assets/<yourpackid> This prefix will be omitted in the follwing sections for clarity, but please remember this.
  • Whenever you see a <===>, it means that you can put the listed component into a sub-folder for easier organization.
  • Whenever you see a <+++> it means that the activator/blocker folder should be used at this point, if you have one set and wish to use it for the assets. If not, you can simply omit the folder.
  • Whenever you see a <###> it means that the component-specific folder name needs to be used here. This is based on the name of the component. For example, vehicles go in a vehicles/ folder, decors go in a decors/ folder, etc.
  • The main 1024x1024 instrument texture is located in assets/<yourpackid>/textures/. It cannot go anywhere else, even if you have sub-folders for textures. Because of this, you may have multiple textures/ folders in your pack, with one that's solely for the instrument texture.
  • Sounds are located in the assets/<yourpackid>/sounds/ folder.

Default

The default structure is the classic pack format. Pack components are grouped into folders based on their type, and some sub-folders exist that allow for some segmentation of components. Item textures and optional JSON models are hard-coded to the textures/items/ and models/item/ folders respectively. No sub-folders are permitted anywhere except the jsondefs folder. Therefore, the folder structure is as follows:

  • Pack JSON: assets/<yourpackid>/<+++>/jsondefs/<###>/<===>/component.json
  • OBJ Models: assets/<yourpackid>/objmodels/<###>/component.obj
  • OBJ Textures: assets/<yourpackid>/textures/<###>/component.png
  • Item Textures: assets/<yourpackid>/textures/items/<###>/component.png
  • Item JSON: assets/<yourpackid>/models/item/<###>/component .json

Layered

The layered structure is similar to the default format, except that when MTS loads a JSON in a sub-folder, it remembers that sub-folder and will load any assets assuming they are also in that sub-folder. For example, if it finds the file jsondefs/vehicles/planes/mc172.json, it will realize that the json was inside the planes/ sub-folder, and will then look for other assets, such as the model and texture, in such sub-folders. This allows for a bit more organization in pack files than the default format, while still allowing for common asset folders with the activator/blocker system. Therefore, the folder structure is as follows:

  • Pack JSON: assets/<yourpackid>/<+++>/jsondefs/<###>/<===>/component.json
  • OBJ Models: assets/<yourpackid>/objmodels/<###>/<===>/component.obj
  • OBJ Textures: assets/<yourpackid>/textures/<###>/<===>/component.png
  • Item Textures: assets/<yourpackid>/textures/items/<###>/<===>/component.png
  • Item JSON: assets/<yourpackid>/models/item/<###>/<===>/component.json

Modular

The modular structure is significantly different from the default or layered structure, in that it allows all the files for a component to be located in the same folder as that component's definition. This includes the item texture and item json, which, to prevent name collision, must be named with the extension _item.png and _item.json respectively. The only requirement still in effect are the component sub-folders, as MTS still needs to know what it's loading, and the folder placement is the only way for it to do that.

The modular structure, however, comes at the cost of having to duplicate components if an activator/blocker is used and there are common components between the two sub-sections. As such, this structure is mainly designed for smaller packs that don't do dynamic loading, or packs that do dynamic loading, but don't use common assets or whose common assets would not cause a bloat in pack size. The folder structure is as follows:

  • Pack JSON: assets/<yourpackid>/<+++>/<###>/<===>/component.json
  • OBJ Models: assets/<yourpackid>/<+++>/<###>/<===>/component.obj
  • OBJ Textures: assets/<yourpackid>/<+++>/<###>/<===>/component.png
  • Item Textures: assets/<yourpackid>/<+++>/<###>/<===>/component_item.png
  • Item JSON: assets/<yourpackid>/<+++>/<###>/<===>/component_item.json
Clone this wiki locally