Modding Support


Introduction

D2X-XL offers full modding support for Descent 1 and 2 levels. The following paragraphs describe how to utilize this feature of the program. The general rule is that level specific data (e.g. from a level's pog or hxm file) overrides mod specific data, and that mod specfic data (e.g. a sound file) overrides standard data.


General structure

A missions mod data has to be placed in a subfolder of the D2X-XL main folder named "mods/<mission name>" (if the mission hog name was e.g. "boilpnt.hog", the mod folder name would be "mods/boilpnt").


2. HAM and V-HAM

Mission specific ham and v-ham files can be stored in the mods folder. They have to have the mission hog file's name plus the extension "ham" and "vham" respectively (e.g. "mods/boilpnt/wshock.ham" and "mods/boilpnt/wshock.vham").


Textures

Default textures can be overriden by placing the mod's textures in a subfolder of the mission's mod folder named "textures" (e.g. "mods/boilpnt/textures"). The texture must be in uncompressed TGA format, alpha channel is supported.

To override textures on a per level base, place a level's custom textures in a sub folder of the general mod texture folder named "level" for regular and "slevel" for secret levels (e.g. "mods/boilpnt/textures/level01"). Regard that the level number must be padded to two digits using zeros. When mixing mod and level textures, levels textures take precedence.

Textures found in a level's pog file will take precedence over textures from the mod folders.

D2X-XL specific textures (like e.g. spark or shield textures) are stored in the D2X-XL installation's textures folder and can be overriden by placing equally named textures in the mod's textures folder. D2X-XL currently uses the following textures:

blast.tga:Explosion blast rings
bubble.tga:Bubble texture (underwater bubble effects)
bullcase.tga:Bullet casings (gatling guns)
corona.tga:Light coronas and solid light trails
deadzone.tga:Deadzone marker (joystick emulation)
glare.tga:Light coronas and solid light trails
halo.tga:Glow effect (shield spheres)
joymouse.tga:Mouse cursor (joystick emulation)
pwupicon.tga:Icon for powerup tally display (HUD)
rboticon.tga:Icon for robot tally display (HUD)
shield.tga:Shield sphere texture
smoke.tga:Smoke puff texture (smoke effects)
sparks.tga:Energy and repair center sparks
thrust2d.tga:2D thruster flame
thrust3d.tga:3D thruster flame

Regard that the mod's texture folder needs to contain at least one TGA file to activate mod hires texture support in D2X-XL. You can place a dummy file there if all hires textures of your mod are stored in level texture folders.


Models

Model modding is supported in a two tiered approach:

You can place a hxm file for mission wide use in the mod folder. It has to have the name of the mission hog file (e.g. "boilpnt.hxm"). These models will be overriden by level specific custom robots just as mod textures are by pog textures.

Custom hires models can be placed in a subfolder of the mod folder named "models" (e.g. "mods/boilpnt/models"). These models will override all other models (standard, standard hires, hxm). You can place both ASE and OOF models in this folder.

To override models on a per level base, place a level's custom models in a sub folder of the general mod models folder named "level" for regular and "slevel" for secret levels (e.g. "mods/boilpnt/models/level01"). Regard that the level number must be padded to two digits using zeros. When mixing mod and level models, levels models take precedence.

When D2X-XL detects hires models for a mod it will automatically enable hires model usage while the mod is being played.

Regard that the mod's textures needs to contain at least one TGA file to activate mod hires texture support in D2X-XL. You can place a dummy file there if all hires textures of your mod are stored in level texture folders.

Regard that the mod's model folder needs to contain at least one ASE or OOF file to activate mod hires model support in D2X-XL. You can place a dummy file there if all models of your mod are stored in level model folders.


Sounds

The default sound files can be overriden by placing alternative soundfiles in the mod folder (e.g. ""mods/boilpnt/boilpnt.s22")

Additionally, hires sounds can be placed in a subfolder of the mod folder named "sounds" (e.g. ""mods/boilpnt/sounds"). Using 44 KHz sounds is mandatory for mods.

To override sounds on a per level base, place a level's custom models in a sub folder of the general mod models folder named "level" for regular and "slevel" for secret levels (e.g. "mods/boilpnt/models/level01"). Regard that the level number must be padded to two digits using zeros. When mixing mod and level sounds, levels sounds take precedence.

When D2X-XL detects hires sounds for a mod, it will automatically enable hires sound usage while the mod is being played.

A hint regarding mixing sounds in standard format with ogg music: D2X-XL has to resample standard music (8 bits, mono, 22 khz) to 16 bits signed, stereo, 44 khz. This can cause a loss of quality because D2X-XL's resampling function is as basic as can be, not really dealing well with control information embedded in wav files. The preferrable method is to use properly (re-) sampled hires sounds (16 bit signed, stereo, 44 khz).

Regard that the mod's sound folder needs to contain at least one WAV file to activate mod hires sound support in D2X-XL. You can place a dummy file there if all sounds of your mod are stored in level sound folders.


Songs

The default music and the music from user specified global playlists can be overriden by placing alternative song files in the music folder (e.g. ""mods/boilpnt/music/title.ogg")

Level song names need to be composed of the text "level" for regular and "slevel" for secret levels and the level number with trailing zeros (e.g. "mods/boilpnt/music/slevel01.ogg").

Menu, briefing and credit songs can be overriden by placing songs with the names "title", "briefing" and "credits" in the music folder.

D2X-XL only supports music in OGG format for mods.


PIG files

DLE-XP allows using alternative PIG files. These have to go to the D2X-XL installation's data folder (e.g. "c:\program files\d2x-xl\data")

Using alternative PIG files is not recommended; use custom textures in the mission's mod folder instead.


Briefings

D2X-XL accepts RGB colors in the color tags of briefing pages. Specify the current foreground RGB color with "$CF <red> <green> <blue>" (e.g. "$CF 255 128 0") and the current background color with "$CB <red> <green> <blue>" (e.g. "$CB 0 16 64").


Wallpapers

You can use per mission and per level custom background images for your missions with D2X-XL. Custom background images must be in uncompressed TGA format and have to be placed in a subfolder of the mod folder named 'wallpapers'. The default wallpaper's name is 'default.tga'. A level's wallpaper name is 'levelXX.tga' for regular and 'slevelXX.tga' for secret levels; 'XX' is the two digit level number (e.g. 'level01.tga' for the first level, or 'slevel02.tga' for the second secret level).1


Mission Configuration

D2X-XL supports per mission and per level configuration files, allowing a mission author to influence certain behavior of the game. The configuration files have to be placed in the mission HOG file. The (global) mission configuration file must have the name "global.ini". Level configuration files must have the name of their level file and the extension ".ini" (e.g. if there is a level named "level01.rl2", the level configuration's name would need to be "level01.ini". The settings in a level configuration take precedence over those from the global mission settings. This means that you can override selected global configuration settings per level.

Currently the following configuration parameters are supported:

-light_ship {0|1}disable (0) / enable (1) the light interceptor ship
-medium_ship {0|1}disable (0) / enable (1) the standard player ship
-heavy_ship {0|1}disable (0) / enable (1) the heavy bomber ship
-player_ship {-1|0|1|2}Make the player spawn with a certain ship (0: standard, 1: light, 2: heavy ship, -1: use whatever ship the player chose)
-teleport {0|1}disable (0) / enable (1) marker teleportation
-secret_save {0|1}disable (0) / enable (1) saving in secret levels
-collision_model {0|1}spheres (0) / bounding boxes (1)
-3d_powerups {0|1}disallow 3D powerups (0) / allow 3D powerups (1)

Please regard that the program cannot exclude certain ship types when the player starts the mission, as the mission config only gets read later when the mission is actually launched. D2X-XL will however switch his ship if he had selected an unavailable one.