This guide outlines a scheme for packaging mods, including directory structure, essential files, useful CON commands, instructions on launching packaged and unpacked mods, and tips for working with version control.
This guide assumes you are modding for EDuke32 on Windows; you may need to make adjustments for other games or operating systems.
It's possible to test your mod without ever packaging it, by placing your files in a subdirectory alongside the EDuke32 executable.
First, create a new subdirectory alongside the EDuke32 executable, and name it mymod.
All of your mod's files will live here, including CON scripts, DEF files, maps, graphical and audio assets, and so on. You can name and organize these in subdirectories as you please, with only the following exception.
Next, create a CON script named eduke.con directly inside of the mymod directory and add the following line:
The game.con here refers to a file in duke3d.grp, not a part of your mod. Eduke32 will automatically load eduke.con if present, or game.con if not. Since eduke.con is loaded in this case, we must load game.con ourselves.
Now, create a file called mymod.def and leave it blank for now. This will contain any DEF_Language instructions your mod needs. In eduke.con, add the following line:
The [setdefname] command tells Eduke32 where to find your DEF file. Note that you could name it whatever you like or put it in a subdirectory and adjust the line above as necessary.
Episodes and levels
Finally, fire up Mapster32, create a quick map, and save it in mymod as mymap01.map. Add the following to eduke.con:
definevolumename 0 Episode One definelevelname 0 0 mymap01.map 01:02 02:03 My Map One
The definevolumename command registers "Episode One" as the name of your first episode. The definelevelname command registers the path to the first map of the first episode, as well as target completion times and the name of the map.
Again, you could name the map whatever you like, or put it in a subdirectory, and adjust the line above as necessary.
Testing your mod
To launch the mod in its unpackaged form, simply run the following command:
eduke32 -j mymod
If you're not comfortable working from the command line, create a shortcut to eduke32.exe, right click it, select Properties, and edit the Target field to add -j at the end:
You can now drag your mymod folder onto the shortcut to launch it. If you want the shortcut to be a dedicated launcher for your mod instead of having to drag the folder onto it, add mymod after the -j.
The easy way
To package your mod, simply zip up the contents of mymod using a tool like 7-Zip. Be sure to zip up the contents rather than the directory itself; the zip file should not include a directory called mymod.
To test the packaged mod, simply drag the zip file onto the EDuke32 executable.
The Git way
# after committing everything... git archive HEAD -o ../mymod.zip
This will keep Git's dotfiles from getting packaged, as well as anything listed in .gitignore or having the export-ignore attribute.