dumpVar: only available in dev mode
Table of Contents
NOTE: If this is your first time migrating a mod, I strongly suggest going through Building your first mod once, to play around with and get a feel for the new file structure, as well as how to use DTMT to build the mod bundles.
Migration requires two steps:
- Rework the project structure and create necessary files to package files into bundles
- Adjust certain parts of your code
1. Rework project structure
Automatically
For most projects, the built-in migration command should be enough to convert a mod to the DTMT project structure:
- Determine a directory to migrate the mod to. The migration will create a new folder named after the mod here. In-place migrations are not supported.
E.g.: C:\projects
- Locate the <mod_id>.modfile for your mod.
- In a Command Prompt (or similar terminal application, e.g. Windows Terminal), execute dtmt migrate C:\path\to\my_mod.id C:\projects
- Navigate to C:\projects\<mod_id>and executedtmt buildanddtmt package
Manually
If the automated way doesn't work for you, or you want to dig in and see how it's done, you'll need the following:
- a dtmt.cfgthat defines the mod's metadata, entry points and packages
- at least one .packagefile that lists your files to be bundled
One way to quickly generate a skeleton would be to use dtmt new in a new location as outlined in Building your first mod, then move files over from your old location.
If you want to migrate manually, or need to edit things, read on:
To create your dtmt.cfg use the file reference at dtmt.cfg Reference.
The resources section can be adapted from the contents of your .mod file. The example uses DMF for the mod ID, but you'll want to use your own here, which must be the same value you pass to DMF's new_mod and get_mod in your code.
The .package file supports wildcards, so the most simple version would look like this:
lua = [
    "scripts/mods/DMF/*"
]
A suggested final file structure looks as follows:
<path/to/new/folder>
└──DMF
   ├──dtmt.cfg
   ├──packages
   │  └──mods
   │     └──DMF.package
   └──scripts
      └──mods
         └──DMF
            ├──data.lua
            ├──init.lua
            └──localization.lua
All additional Lua files can then be dropped into scripts/mods/DMF (sub-directories are supported) and can be required in-game with the full path, e.g. require("scripts/mods/DMF/my_extra_file").
Modding veterans from VT2 may recognize this file structure 🙂
2. Adjust code
- All script loading must happen via the regular Lua requireordofile. Functions likemod:io_dofiledon't work anymore. You can default to usingmod:requireandmod:dofile, which switch internally to do "the right thing" for either bundled or non-bundled mods.
- mod:add_require_path()only works for non-bundled mods. Any scripts in bundled mods are already available via- require(hence the point above)
Wiki
Building the source code
Obtaining the Oodle library
DTMM
Installing mods
Register DTMM as handler for Nexus downloads
DTMT
CLI Reference
Building your first mod
Migrating from loose files
dtmt.cfg Reference
Murmur hashes and dictionaries
Reverse Engineering
Getting Started
Sound
Textures
File Types
Status
Bundle
Bundle Database
Texture
Material
Strings
Package
Wwise Event
Wwise Stream
Wwise Bank