Asset Editing - DW2MC/DW2ModLoader GitHub Wiki
Before getting started you will need to install the Mod Loader and the Bundle Manager. Both need to be extracted to the Distant Worlds 2 main folder.
-
Open a shell / command prompt in your DW2 folder. (Shift+Right-Click -> Open PowerShell Here)
-
Enter
.\dw2bm
to get an overview of available commands and some examples. -
Use
.\dw2bm lb
to list the available bundles. -
.\dw2bm ls <bundle name> <search pattern>
lists the files inside the bundle which match the pattern. The patter is a glob pattern, so*
matches any number of any characters in a directory or file name and**
matches subdirectories. Some examples:-
.\dw2bm ls Abandoned **
lists all files in the 'Abandoned' bundle. -
.\dw2bm ls Abandoned Ships/**
lists all files in the 'Abandoned' bundle inside the 'Ships' subfolder. -
.\dw2bm ls Abandoned Ships/**/*spaceport*
lists only lists files inside 'Ships' containing 'spaceport' in the filename.
-
-
For this example we will extract everything in a 'Sounds' directory in the 'CoreContent' bundle to some different folder inside the DW2 installation:
.\dw2bm ex CoreContent Sounds/** ./extracted_sounds/
which should give you something like this:
-
Now we probably want to convert these extracted files, which are still in Xenko's (the game engine) internal format, to something we can use. This is currently only supported for Textures and Sounds, while shaders (.xksl extension) can immediately be edited with a text editor. If you're unsure what type a file is you can use
.\dw2bm id <file path>
to identify it.
For textures use.\dw2bm xt <source file> <destination file>
where the destination must be a .dds file. For sounds it's.\dw2bm xs <source file> <destination file>
where the destination can have any extension that FFmpeg can handle. If you want to convert many files you can also use.\dw2bm xs <source pattern> <destination folder> <file extension>
. (Same thing for textures soon(tm))
IMPORTANT: You need to have FFmpeg installed and it's binaries path added to your PATH environment variable for sound conversions.
So to convert all the sound files we extracted earlier:
.\dw2bm.exe xs "./extracted_sounds/**" "./source_sounds/" ogg
will convert all these sounds to ogg format and place them in 'source sounds'.
Example: .\dw2bm.exe sx "./source_sounds/**" "./mods/MyMod/assets/" "./"
Example mod.json:
{
"name": "MyMod",
"displayName": "My Mod",
"version": "1.0.0",
"overrideAssets": "assets",
"dependencies": []
}