diff --git a/Building-your-first-mod.md b/Building-your-first-mod.md new file mode 100644 index 0000000..cb87438 --- /dev/null +++ b/Building-your-first-mod.md @@ -0,0 +1,25 @@ +In a Command Prompt/terminal, run `dtmt new ` to create a skeleton structure from the default template. +During this, DTMT will prompt for several fields, including: + + - `name`: The human-readable name of your mod. This will show up in various places like DTMM's mod list or DMF's mod options view. + - `id`: A unique ID for your mod. The default is generated from `name` and should be good enough in most cases (clicking Enter without typing accepts the default value). This will be used throughout your code (e.g. in `get_mod()` calls). + +DTMT will now create the given directory from the mod template: + +``` + +└── + ├──dtmt.cfg + ├──packages + │ └──.package + └──scripts + └──mods + └── + ├──data.lua + ├──init.lua + └──localization.lua +``` + +You're now ready to start editing the `init.lua` file. For starters, you might want to just add a simple `print("Hello, world!")`, which will print this string in your console logs once you've loaded the mod. + +With the file edited, you now need to turn your mod into something that DTMM can load into the game. To do that, navigate to your mod's folder (where the `dtmt.cfg` is) and run `dtmt build`. Watch the output for any errors, but if all goes well, this will produce a `.zip` file, which you can then import in DTMM and deploy. \ No newline at end of file