Skip to content

101 — Getting started and mod_info

Balthazar edited this page Aug 24, 2021 · 2 revisions

A working example of the tangible results of this tutorial can be found here.

The first thing any new mod needs is its own mod folder and mod_info.lua file. .lua files are just plaintext so you can create and edit them with any plaintext editor including Notepad. I would, however, recommend getting an editor with syntax highlighting if you don't have one already; It will make things easier in the long run. I personally recommend Atom.

mod_info.lua

The bare minimum that a mod info file needs is as follows:

name = "Basic Mod"
uid = "0e6ac7fe-5c74-4e4c-802a-b452a8f10bc8"
version = 1
description = "This mod does nothing except appear on the mods list."
author = "Balthazar"

Update the values as described below and save it as mod_info.lua in your mods own folder in your games mods folder, which you can find in your documents. If you are doing this in Notepad, change the 'Save as type' to All Files (*.*) so you can save as .lua instead of .txt.

This will get you an item that appears on the mod manager and can be loaded. At this point it doesn't do anything else, but you need to start somewhere.

Primary values

Most of the values are fairly self explanatory, but for completeness I will outline them all:

  • name: A string representing the name of the mod. Good conventions, and also FAF vault rules, say to not include any versioning in the name string.
  • uid: A unique string identifier. Actual specifics are unimportant, since the game only uses it for string comparisons, however don't copy paste uid's from other mods, and change the uid whenever you publish a new version of your mod. This change can be as trivial as having the version number at the end of the it. You can generate them fresh here.
  • version: The version of the mod. The game doesn't care if this is a string or number or whatever, however the FAF vault requires it to be an integer, and requires newer uploaded versions to be greater. Sorry if you're a fan of semantic versioning.
  • description: A string expected to outline the basic effects of the mod. This is primarily visible in the mod manager, but also usually visible in any other index of mods. The vanilla lobby has a fairly restrictive character limit before it starts to spill over outside of its UI element, of two short-ish lines.
  • author: The game doesn't actually reference this by default, although many other things do. Attribution is important. Should probably be a string.

That's slightly more than the bare minimum you need to get something appearing on the games mod manager.

Secondary values

Other functional mod info values that may be useful, but aren't essential are:

  • icon: A string path to an image to represent the mod. Path wants to start at /mods/. Various standard formats are accepted, including .png. .dds is accepted in game, but generally isn't supported by anything outside the game.
  • enabled: You can set this to false to remove your mod from the mod manager. No other value matters since it checks not false to make it show. Undefined, nil, true and anything else is all treated the same. The only reason to do this would be if you wanted to make a dummy container mod for the FAF vault, or some other external mod index.
  • exclusive: When set to true no other mods can be enabled along side it. There are basically no good reasons to do this.
  • ui_only: When set to true, the game will ignore any aspects of the mod that would make changes to the game simulation.
  • conflicts: An array of uid strings of other mods that this mod is known to be incompatible with; for preventing them from being loaded together. For example:
conflicts = {
    "0e6ac7fe-5c74-4e4c-802a-b452a8f10bc8",
}
  • requires: An array of uid strings of other mods that this mod requires to run. Will cause the game to enforce that mods with those uid's be enabled before allowing this mod to be activated. It is recommended to combine it with requiresNames unless the required mods will always be packaged with this mod. Personally I leave this unpopulated and mention requirements in the descriptions so that if that mod updates, players can use the updated version of that mod without this mod being updated first to reference the new mod. Assuming that actually works.
  • requiresNames: A table keyed with uid's with mod-name values so that the missing requirement dialogue gives a human readable error instead of a random string. For example:
requiresNames = {
    ["0e6ac7fe-5c74-4e4c-802a-b452a8f10bc8"] = "Basic Mod",
}
  • before: An array of uid strings. Controls mod load order.
  • after: An array of uid strings. Controls mod load order.