User:Frost Salamander

From The DarkMod Wiki
Jump to navigationJump to search

TDM Files and Contents

Caption text
Content File path Notes
Skins tdm_models_decls01.pk4\skins skin files shipped with TDM
Script Constants tdm_base01.pk4\script\tdm_defs.script constant values. Useful if you need to know the literal values for use in your scripts.
Script Objects tdm_base01.pk4\script various script objects for entities.
tdm_ai_humanoid_newskel.def tdm_ai_humanoid_undead01.pk4\def\tdm_ai_humanoid_newskel.def Base class for all TDM humanoid entities
GUI Icons tdm_gui01.pk4\dds\guis\assets\hud\ HUD icons. e.g. loot, potions, etc
sound shaders tdm_sound_ambient_decls01.pk4\sound ambient environmental sound shaders
materials definitions tdm_textures_base01.pk4\materials base materials files

Creating a material using existing images (e.g. from textures.com) using GIMP

This will describe how to create your own texture (material) using an image found on the internet. I will use textures.com as an example. Ensure that the license for whatever source you use is appropriate for TDM (e.g. allows use in video games)

Obtain your image

  1. Log into textures.com and find an image you like. Make sure it's seamless if it needs to be tiled/repeatable (e.g. for bricks or walls). If it's something like a door or window, it doesn't need to be seamless. There is normally a JPG format that that is close to or exactly 1024x1024 pixels. Download it.

Create the Diffuse Map (DDS)

  1. Open the image in GIMP and choose File -> Export as... Choose 'Select File Type (By Extension)' at the bottom of the dialogue and select 'DDS Image' and click 'Export'
  2. On the next pop-up, choose 'BC3 / DXT5' for Compression and select 'Generate mipmaps'. Leave everything else as default. (ADVICE NEEDED) Click 'Export'
  3. Name the file 'texturename.dds'

Create the Normal Map

  1. With the original image open in GIMP, select Filters -> Generic -> Normal Map..
  2. The only thing I adjust here is the 'Scale' property. For things like bricks, I use a value < 5 or else the finished texture will look very grainy in TDM. For stuff like doors, a value of about 10 looks OK.
  3. After adjusting the scale, click 'OK'
  4. Choose 'Select File Type (By Extension)' at the bottom of the dialogue and select 'TarGA Image' and click 'Export'
  5. On the next pop-up, untick 'RLE compression' and leave 'Origin' at 'Bottom left'. Click 'Export'. (ADVICE NEEDED)
  6. Name the file 'texturename_local.tga'

Create the editor icon

  1. Since you've modified the image, either close and re-open the image in GIMP, or go back in your Undo History in GIMP and select the original image before you made any changes. It will be called '[ Base Image ]'.
  2. Choose Image -> Scale Image... from the menu.
  3. On the dialogue, either scale it to 256x256 px (if it was a 1024x1024 image originally), or just scale it down to 25% if it was something else. Click 'Scale'.
  4. Choose File -> Export as... Choose 'Select File Type (By Extension)' at the bottom of the dialogue and select 'JPEG Image' and click 'Export'
  5. On the next pop-up, untick all the 'save data' boxes except for 'Save color profile' (ADVICE NEEDED). Click 'Export'
  6. Name the file 'texturename_ed.jpg'

Create TDM materials file

  1. Within your FM folder, save all your images in the appropriate TDM folder structure. Just follow the existing conventions. For example your DDS files go into 'dds/textures/darkmod/stone/brick' and your normal map and editor files go into 'textures/darkmod/stone/brick'
  2. Create the materials file as follows below. Give it a name like 'mybricks.mtr' and put it in the /materials folder in your FM. The material name as it appears in DarkRadiant appears at the top.
textures/darkmod/stone/brick/bricks_dirty
{
    stone
    description	"vine_friendly"

    qer_editorimage textures/darkmod/stone/brick/bricks_dirty_ed
    diffusemap      textures/darkmod/stone/brick/bricks_dirty
    bumpmap         textures/darkmod/stone/brick/bricks_dirty_local
}