DEF Language: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
I hope in the end I make the DEF page more clear
(38 intermediate revisions by 7 users not shown)
Line 1: Line 1:
DEF files are parsed scripts which allow definition of textures, 3D models, miscellaneous settings, higher-quality sounds and music, and more.
Comments can be used by prefixing the text with a double forward-slash <code>//</code>, or surrounding the text with <code>/* (comment here) */</code>.
__TOC__
==Setup==
=====include=====
{{Def table1}}
<span {{Def element}}>include <i><filename></i></span><br />
<span {{Def element}}>#include <i><filename></i></span>
Processes the script commands in <i><filename></i> at the point of the <b>include</b> call.
{{Def table2}}
=====includedefault=====
{{Def table1}}
<span {{Def element}}>includedefault</span><br />
<span {{Def element}}>#includedefault</span>
Processes the script commands in the default .def file at the point of the <b>include</b> call. Only useful for command-line overrides.
For Duke Nukem 3D, the file is duke3d.def. For NAM, it is nam.def. For WWII GI, it is ww2gi.def.
{{Def table2}}
=====define=====
{{Def table1}}
<span {{Def element}}>define <i><label> <integer-value></i></span><br />
<span {{Def element}}>#define <i><label> <integer-value></i></span>
Declares <i><label></i> to represent the numeric value <i><integer-value></i>. <i><integer-value></i> can be a label, in which case the value of the label given is used.
NOTE: You may find it convenient to include DEFS.CON or NAMES.H to predefine many of the tile (and sound) names in the art file.
{{Def table2}}
=====loadgrp=====
{{Def table1}}
<span {{Def element}}>loadgrp <i><.grp\.zip file></i></span>
The DEF equivalent of the <b>/g</b> command line switch.
{{Def table2}}
=====noautoload=====
{{Def table1}}
<span {{Def element}}>noautoload</span>
Disables the autoload dir feature.
{{Def table2}}
=====cachesize=====
{{Def table1}}
<span {{Def element}}>cachesize <i><size></i></span>
Specifies the size of the cache in Kb. Don't use this unless you know what you are doing.
{{Def table2}}
=====globalflags=====
{{Def table1}}
<span {{Def element}}>globalflags <i><flags></i></span>
Specifies a set of global flags. Multiple flags can be set by adding their numbers together.
0 = None<br>
1 = No palette emulation in OpenGL.<br>
2 = No fullbrights in OpenGL.<br>
4 = No fog shading in OpenGL.<br>
{{Def table2}}
==Color Palettes==
=====tint=====
{{Def table1}}
<span {{Def element}}>tint <i>{ ... }</i></span>
Defines a Hightile texture tint to simulate palette effects normally used on ART-file tiles.
Example:
tint { pal 1 red 127 green 127 blue 255 flags 0 }
tint { pal 2 green 127 blue 127 }
The brace-enclosed block may contain these instructions:
: <span {{Def subelement}}>pal <i><palnum></i></span>
: The palette number the tint applies to.
: <span {{Def subelement}}>red <i><value></i></span> (or <span {{Def subelement}}>r <i><value></i></span>)<br />
: <span {{Def subelement}}>green <i><value></i></span> (or <span {{Def subelement}}>g <i><value></i></span>)<br />
: <span {{Def subelement}}>blue <i><value></i></span> (or <span {{Def subelement}}>b <i><value></i></span>)
: Specifies a color component value, in the range of 0 to 255. Unspecified components are assumed to be 255 and any out of range values are clamped to the maximum or minimum as appropriate.
: <span {{Def subelement}}>flags <i><flags></i></span>
: Specifies any special processing effects to use for the tint. The value of flags may be the sum of any of these values:
: 0 = no effects<br />
: 1 = convert to greyscale<br />
: 2 = invert colors
{{Def table2}}
=====fogpal=====
{{Def table1}}
<span {{Def element}}>fogpal <i><palette number> <red intensity> <green intensity> <blue intensity></i></span>
<b>fogpal</b> defines a palette a sector-based fog effect. To use it, change the pal of your sector to the pal defined with <b>fogpal</b>.
Intensities range from 0-63. Palettes 26, 27, 28 and 29 are pre-defined for you as white, red, green and blue respectively. Sector visibility controls fog density.
{{Def table2}}
=====makepalookup=====
{{Def table1}}
<span {{Def element}}>makepalookup <i>{ ... }</i></span>
Interface to creating palette lookups containing both color index remapping (only in effect for non-hightile textures) and fog. This is in contrast to '''fogpal''', which always resets the remapping to the identity mapping ("pal 0").
The brace-enclosed block may contain these instructions:
: <span {{Def subelement}}>pal <i><palnum></i></span>
: The palette number, must be from 1 to 250.
: <span {{Def subelement}}>red <i><value></i></span> (or <span {{Def subelement}}>r <i><value></i></span>)<br />
: <span {{Def subelement}}>green <i><value></i></span> (or <span {{Def subelement}}>g <i><value></i></span>)<br />
: <span {{Def subelement}}>blue <i><value></i></span> (or <span {{Def subelement}}>b <i><value></i></span>)
: Specifies a color component value, in the range of 0 to 63. Unspecified components are assumed to be 0 and any out of range values are clamped to the maximum or minimum as appropriate.
: <span {{Def subelement}}>remappal <i><palnum></i></span>
: The palette number to take the index remapping from, i.e. 21 for blue -> red.  When absent, defaults to 0.
: <span {{Def subelement}}>remapself</span>
: The same as '''remappal''' ''<palnum>'', where ''<palnum>'' is the number provided for the '''pal''' token.
'''Examples'''<br/>
This creates palookup 200 with a fog of (30,0,0) and a blue-to-yellow remapping (assuming it has not been changed before):
  makepalookup { pal 200  red 30  remappal 23 }
This 'fogifies' palookup 21 with a red fog:
  makepalookup { pal 21  red 30  remapself }
This overwrites palookup 21 with a red fog, but clears the blue-to-red remapping:
  makepalookup { pal 21  red 30 }
{{Def table2}}
== Definitions ==
== Definitions ==


New to JFDuke3D\EDuke32 are DEF files. These parsed scripts allow redefinition of flat, Hightile textures, 3D models, miscellaneous settings, and, possibly, in the future, higher-quality sounds and music, and enhanced cutscenes.
===8-Bit .ART File Replacements===


Comments can be used by prefixing the text with a double forward-slash (C++ style), <code>//</code>, or surrounding the text with <code>/* (comment here) */</code> (C style).


__TOC__
=====tilefromtexture=====
{{Def table1}}
 
<span {{Def element}}>tilefromtexture <tilenum> <i>{ ... }</i></span>
 
Used to generate an 8-bit tile from an image file.  Use the alpha channel for transparency instead of the pink color.
 
: <span {{Def subelement}}>file <i><filename></i></span><br />
: <span {{Def subelement}}>name <i><filename></i></span>
 
: <span {{Def subelement}}>alphacut <i><value></i></span>
 
In addition to working when you are adding an image file as an art tile, the following parameters can also be used without specifying a file to ''modify'' the attributes of an existing ART tile.
 
: <span {{Def subelement}}>xoffset <i><value></i></span><br />
: <span {{Def subelement}}>xoff <i><value></i></span>
 
: <span {{Def subelement}}>yoffset <i><value></i></span><br />
: <span {{Def subelement}}>yoff <i><value></i></span>
 
: <span {{Def subelement}}>texhitscan</span><br />
: <span {{Def subelement}}>nofullbright</span>
 
{{Def table2}}
 
=====animtilerange=====
{{Def table1}}
 
<span {{Def element}}>animtilerange <i><tilenum1> <tilenum2> <speed value> <animation value></i></span>
 
Sets an animation range identical to the ones embedded in the .ART files.
 
Speed value ranges from 0 to 15, 0 being the fastest.
 
Values are:
 
0 = none<br />
1 = oscillating<br />
2 = forward<br />
3 = backward
 
{{Def table2}}
 
=====voxel=====
{{Def table1}}
 
<span {{Def element}}>voxel <i><filename> { ... }</i></span>
 
Defines a voxel to replace sprites. filename is the name of the .KVX file containing the voxel. The brace-enclosed block may contain these instructions:
 
: <span {{Def subelement}}>tile <i><tilenum></i></span><br />
: <span {{Def subelement}}>tile0 <i><tilenum></i></span><br />
: <span {{Def subelement}}>tile1 <i><tilenum></i></span>
 
: Use these instructions to map tiles that should be rendered as a voxels. Use <b>tile</b> to map a single tile to be rendered as voxels and <b>tile0</b>, <b>tile1</b> together define a range of tiles to be rendered as voxels. The <b>tile0</b> instruction should appear before the <b>tile1</b> instruction to define a correct range.
 
: <span {{Def subelement}}>scale <i><value></i></span>
 
: <i><value></i> is a (possibly fractional) value specifying a scaling factor for the voxelmodel when it is rendered, eg. 1.5 for one-and-a-half times as big.
 
{{Def table2}}
 
===High Resolution Art===
 


=====texture=====
{{Def table1}}
{{Def table1}}
=====<div {{Def link}}>texture</div>=====
<span {{Def element}}>texture <i><tilenum> { ... }</i></span>
<span {{Def element}}>texture <i><tilenum> { ... }</i></span>


Line 32: Line 266:
:: <span {{Def subelement}}>file <i><filename></i></span> (or <span {{Def subelement}}>name <i><filename></i></span>)
:: <span {{Def subelement}}>file <i><filename></i></span> (or <span {{Def subelement}}>name <i><filename></i></span>)


:: Defines which texture file to use. File may be any PNG, JPG, TGA, BMP, GIF or PCX file. This instruction must be supplied.
:: Defines which texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.


:: <span {{Def subelement}}>alphacut <i><cutoff-value></i></span>
:: <span {{Def subelement}}>alphacut <i><cutoff-value></i></span>
Line 57: Line 291:
:: <span {{Def subelement}}>file <i><filename></i></span>
:: <span {{Def subelement}}>file <i><filename></i></span>


:: Specifies which detail texture file to use. File may be any PNG, JPG, TGA, BMP, GIF or PCX file. This instruction must be supplied.
:: Specifies which detail texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.


:: <span {{Def subelement}}>scale <i><value></i></span>
:: <span {{Def subelement}}>scale <i><value></i></span>
Line 71: Line 305:
:: Specifies which glow map file to use. This instruction must be supplied.
:: Specifies which glow map file to use. This instruction must be supplied.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>tint</div>=====
=====skybox=====
<span {{Def element}}>tint <i>{ ... }</i></span>
{{Def table1}}
 
Defines a Hightile texture tint to simulate palette effects normally used on ART-file tiles.
 
Example:
 
tint { pal 1 red 127 green 127 blue 255 flags 0 }
tint { pal 2 green 127 blue 127 }
 
The brace-enclosed block may contain these instructions:
 
: <span {{Def subelement}}>pal <i><palnum></i></span>
 
: The palette number the tint applies to.
 
: <span {{Def subelement}}>red <i><value></i></span> (or <span {{Def subelement}}>r <i><value></i></span>)<br />
: <span {{Def subelement}}>green <i><value></i></span> (or <span {{Def subelement}}>g <i><value></i></span>)<br />
: <span {{Def subelement}}>blue <i><value></i></span> (or <span {{Def subelement}}>b <i><value></i></span>)
 
: Specifies a color component value, in the range of 0 to 255. Unspecified components are assumed to be 255 and any out of range values are clamped to the maximum or minimum as appropriate.
 
: <span {{Def subelement}}>flags <i><flags></i></span>
 
: Specifies any special processing effects to use for the tint. The value of flags may be the sum of any of these values:
 
: 0 = no effects<br />
: 1 = convert to greyscale<br />
: 2 = invert colors
 
{{Def table2}} {{Def table1}}
 
=====<div {{Def link}}>skybox</div>=====


<span {{Def element}}>skybox <i>{ ... }</i></span>
<span {{Def element}}>skybox <i>{ ... }</i></span>


Defines a skybox that overrides a parallaxing floor or ceiling in OpenGL Polymost rendering mode.
Defines a skybox that overrides a parallaxing floor or ceiling in OpenGL rendering modes.


Example:
Example:
  skybox {
  skybox {
   tile 3586 pal 0
   tile 3586 pal 0
   front "mymod/0089_la/sky_front.png" nocompress  
   front "mymod/sky_1.png" nocompress  
   right "mymod/0089_la/sky_right.png" nocompress  
   right "mymod/sky_2.png" nocompress  
   back  "mymod/0089_la/sky_back.png" nocompress
   back  "mymod/sky_3.png" nocompress
   left  "mymod/0089_la/sky_left.png" nocompress  
   left  "mymod/sky_4.png" nocompress  
   top  "mymod/0089_la/sky_top.png" nocompress
   top  "mymod/sky_5.png" nocompress
   down  "mymod/0089_la/sky_down.png" nocompress
   down  "mymod/sky_6.png" nocompress
  }
  }


Line 143: Line 346:
: NOTE: All six faces are required to be specified.
: NOTE: All six faces are required to be specified.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>model</div>=====
=====model=====
{{Def table1}}


<span {{Def element}}>model <i><filename> { ... }</i></span>
<span {{Def element}}>model <i><filename> { ... }</i></span>


Defines a model to replace certain sprites in the game when running in OpenGL Polymost mode. <i><filename></i> is the model file in md2 or md3 format.
Defines a model to replace certain sprites in the game when running in 32-bit OpenGL mode. <i><filename></i> is the model file in md2 or md3 format.


Note: md2 is considered deprecated.
Note: md2 is considered deprecated.
Line 187: Line 391:
:: <span {{Def subelement}}>file <i><filename></i></span>
:: <span {{Def subelement}}>file <i><filename></i></span>


:: Specifies the texture file to use for the skin. File may be any PNG, JPG, TGA, BMP, GIF or PCX file
:: Specifies the texture file to use for the skin. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file


:: IMPORTANT: If your model exists in a subdirectory (ie. the model filename includes a path to the .md2/3) you will need to give the same path to filename if the skin is in the same directory.
:: IMPORTANT: If your model exists in a subdirectory (ie. the model filename includes a path to the .md2/3) you will need to give the same path to filename if the skin is in the same directory.
Line 266: Line 470:
:: <span {{Def subelement}}>nodepth</span>
:: <span {{Def subelement}}>nodepth</span>


:: Use this to render a HUD model without the use of the depth buffer. Normally, you should avoid this. The one exception where this is useful is for the spinning nuke menu pointer because it should always be in front - and it just happens to be convex ... which is the one case that is safe with the depth buffer disabled … a rather fortunate coincidence. [[Image:Smile.gif]]
:: Use this to render a HUD model without the use of the depth buffer. Normally, you should avoid this. The one exception where this is useful is for the spinning nuke menu icon because it should always be in front -- and it just happens to be convex, which is the one case that is safe with the depth buffer disabled.


: <span {{Def subelement}}>detail <i>{ ... }</i></span>
: <span {{Def subelement}}>detail <i>{ ... }</i></span>
Line 274: Line 478:
:: <span {{Def subelement}}>file <i><filename></i></span>
:: <span {{Def subelement}}>file <i><filename></i></span>


:: Specifies which detail texture file to use. File may be any PNG, JPG, TGA, BMP, GIF or PCX file. This instruction must be supplied.
:: Specifies which detail texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.


:: <span {{Def subelement}}>scale <i><value></i></span>
:: <span {{Def subelement}}>scale <i><value></i></span>
Line 296: Line 500:
:: Specifies which MD3 surface this glow map should be applied to. This has no significance for MD2 models.
:: Specifies which MD3 surface this glow map should be applied to. This has no significance for MD2 models.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>voxel</div>=====
===Audio===


<span {{Def element}}>voxel <i><filename> { ... }</i></span>


Defines a voxel to replace sprites. filename is the name of the .KVX file containing the voxel. The brace-enclosed block may contain these instructions:
=====music=====
 
{{Def table1}}
: <span {{Def subelement}}>tile <i><tilenum></i></span><br />
<span {{Def element}}>music <i>{ ... }</i></span>
: <span {{Def subelement}}>tile0 <i><tilenum></i></span><br />
: <span {{Def subelement}}>tile1 <i><tilenum></i></span>
 
: Use these instructions to map tiles that should be rendered as a voxels. Use <b>tile</b> to map a single tile to be rendered as voxels and <b>tile0</b>, <b>tile1</b> together define a range of tiles to be rendered as voxels. The <b>tile0</b> instruction should appear before the <b>tile1</b> instruction to define a correct range.
 
: <span {{Def subelement}}>scale <i><value></i></span>
 
: <i><value></i> is a (possibly fractional) value specifying a scaling factor for the voxelmodel when it is rendered, eg. 1.5 for one-and-a-half times as big.
 
{{Def table2}} {{Def table1}}
 
=====<div {{Def link}}>music</div>=====
<span {{Def element}}>Music <i><tilenum> { ... }</i></span>


Example:
Example:
  Music { ID "E1L1" file "stalker1.ogg" }
  music { id "E1L1" file "stalker1.ogg" }
  Music { ID "Intro" file "grabbag.ogg" }
  music { id "intro" file "grabbag.ogg" }
  Music { ID "Briefing" file "briefing.ogg" }
  music { id "briefing" file "briefing.ogg" }
  Music { ID "Loading" file "bonus.ogg" }
  music { id "loading" file "menusng2.flac" }


: <span {{Def subelement}}>id <i><value></i></span>
: <span {{Def subelement}}>id <i><value></i></span>


: <i><value></i> is "Intro", "Briefing", "Loading" or "ExLy"(where x-episode, y-level).<br />
: <i><value></i> is "intro", "briefing", "loading" or "E'''x'''L'''y'''" (where x is the episode and y is the level).<br />


: <span {{Def subelement}}>file <i><filename></i></span>
: <span {{Def subelement}}>file <i><filename></i></span>


: Specifies which music file to use. File may be any MID or OGG(OpenAL is required) file.
: Specifies which audio file to use. File types: MIDI, Ogg Vorbis, FLAC


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>sound</div>=====
=====sound=====
<span {{Def element}}>Sound <i><tilenum> { ... }</i></span>
{{Def table1}}
<span {{Def element}}>sound <i>{ ... }</i></span>


Example:
Example:
  Sound { ID "249" file "bonus.ogg" }
  sound { id "249" file "bonus.ogg" }


: <span {{Def subelement}}>id <i><value></i></span>
: <span {{Def subelement}}>id <i><value></i></span>


: Specifies the ID of sound. The ID can be found in DEFS.CON.
: Specifies the ID of sound. The ID can be found in DEFS.CON. '''NOTE:''' This should only be used for HRP-like replacement of existing sounds. New sounds should use [[definesound]].


: <span {{Def subelement}}>file <i><filename></i></span>
: <span {{Def subelement}}>file <i><filename></i></span>


: Specifies which music file to use. File may be any WAV,VOC,OGG(OpenAL is not required) file.
: Specifies which audio file to use. File types: WAV, VOC, Ogg Vorbis, FLAC
 
{{Def table2}}
 
=====animsounds=====
{{Def table1}}
<span {{Def element}}>animsounds <anim> <i>{ frame1 sound1  frame2 sound2 ... }</i></span>
   
'''<anim>''' has to be one of the following tokens corresponding to hard-coded Duke3D anims:
* cineov2: Episode 2 ending
* cineov3: Episode 3 ending
* RADLOGO: "Come back to bed, Duke..."
* DUKETEAM: Duke3D team still
* logo: Intro nuke logo
* vol41a: Episode 4 intro 1
* vol42a: Episode 4 intro 2
* vol43a: Episode 4 intro 3
* vol4e1: Episode 4 ending 1
* vol4e2: Episode 4 ending 2
* vol4e3: Episode 4 ending 3
 
The '''frame'''''N'''s (1-based frame numbers) have to be in ascending order. They do not need to be strictly ascending, so that a frame may have more than one sound.


Example: for Duke3D's XBLA nuke logo animation (IVF extracted from nuke.webm),
the following definition overlays the video with a sound sequence similar
(identical save for timing) to the original nuke animation:
// frame 1: FLY_BY, frame 64: PIPEBOMB_EXPLODE
animsounds logo { 1 244  64 14 }
{{Def table2}}
{{Def table2}}


== Un-Definitions ==
== Un-Definitions ==


The main use for these is for cases in which the .ART files are somewhat different, and you want to ensure compatibility for the new art without new textures or models. A good example of this is the [http://www.freewebtown.com/hendricks266/nwhrp.html Duke: Nuclear Winter HRP] by [[User:Hendricks 266|Hendricks266]]. (see undef.def)
The main use for these is for cases in which the .ART files are somewhat different, and you want to ensure compatibility for the new art without new textures or models. A good example of this is [http://hendricks266.duke4.net/nw_plus.php Duke: Nuclear Winter Plus] by [[Hendricks266]]. (see [http://svn.eduke32.com/nw_plus/nwinter/undef.def undef.def])


{{Def table1}}


=====<div {{Def link}}>undeftexture</div>=====


=====undeftexture=====
{{Def table1}}
<span {{Def element}}>undeftexture <i><tile></i></span><br />
<span {{Def element}}>undeftexture <i><tile></i></span><br />
<span {{Def element}}>undeftexturerange <i><tile0> <tile1></i></span>
<span {{Def element}}>undeftexturerange <i><tile0> <tile1></i></span>
Line 364: Line 581:
This is for undefining Hightile textures.
This is for undefining Hightile textures.


{{Def table2}} {{Def table1}}
{{Def table2}}
 
=====<div {{Def link}}>undefmodel</div>=====


=====undefmodel=====
{{Def table1}}
<span {{Def element}}>undefmodel <i><tile></i></span><br />
<span {{Def element}}>undefmodel <i><tile></i></span><br />
<span {{Def element}}>undefmodelrange <i><tile0> <tile1></i></span><br />
<span {{Def element}}>undefmodelrange <i><tile0> <tile1></i></span><br />
<span {{Def element}}>undefmodelof <i><tile></span></i><sup>1</sup>
<span {{Def element}}>undefmodelof <i><tile></i></span><sup>1</sup>


This is for undefining 3D models.
This is for undefining 3D models.


With <b>undefmodelof</b> all the tiles grouped together within the same .DEF code block are un-defined.
With <b>undefmodelof</b> all the tiles grouped together within the same .def code block are un-defined.


1. Support of <b>undefmodelof</b> seems to be broken at this time. Using it in your .DEF files will result in crashing upon compiling.
<sup>1</sup>Support of <b>undefmodelof</b> is disabled indefinitely due to problems with its implementation.


{{Def table2}}
{{Def table2}}
Line 382: Line 599:
== Misc ==
== Misc ==


{{Def table1}}


=====<div {{Def link}}>alphahack</div>=====


<span {{Def element}}>alphahack <i><tilenum> <value></i></span><br />
=====dummytile=====
<span {{Def element}}>alphahackrange <i><tilenum1> <tilenum2> <value></i></span><br />
{{Def table1}}
 
<b>alphahack</b> is a deprecated command to improve alpha filtering of highres art of <i><tilenum></i>. <i><value></i> is always -1.
 
{{Def table2}} {{Def table1}}
 
=====<div {{Def link}}>animtilerange</div>=====
 
<span {{Def element}}>animtilerange <i><tilenum1> <tilenum2> <speed value> <animation value></i></span>
 
Animates hightile textures the same way as 8 bit art does. Hightile art needs to be defined first.
 
{{Def table2}} {{Def table1}}
 
=====<div {{Def link}}>dummytile</div>=====


<span {{Def element}}>dummytile <i><tilenum> <x-dimension> <y-dimension></i></span><br />
<span {{Def element}}>dummytile <i><tilenum> <x-dimension> <y-dimension></i></span><br />
Line 408: Line 609:
Used in DEF files to create a blank tile at location <b><''tilenum''></b> of the dimensions <b><''x-dimension''></b> and <b><''y-dimension''></b>. This allows the creation of placeholder tiles for use with definetexture\texture without having to edit .ART files.
Used in DEF files to create a blank tile at location <b><''tilenum''></b> of the dimensions <b><''x-dimension''></b> and <b><''y-dimension''></b>. This allows the creation of placeholder tiles for use with definetexture\texture without having to edit .ART files.


{{Def table2}} {{Def table1}}
'''NOTE:''' In most circumstances '''setuptile''' is a better command to use, unless you specifically want black boxes.


=====<div {{Def link}}>setuptile</div>=====
{{Def table2}}
 
=====setuptile=====
{{Def table1}}


<span {{Def element}}>setuptile <i><tilenum> <x-dimension> <y-dimension> <x-offset> <y-offset></i></span><br />
<span {{Def element}}>setuptile <i><tilenum> <x-dimension> <y-dimension> <x-offset> <y-offset></i></span><br />
Line 417: Line 621:
Used in DEF files to setup the properties which are applied to the highres replacement of the tile. This allows the creation of placeholder tiles for use with definetexture\texture without having to edit .ART files.
Used in DEF files to setup the properties which are applied to the highres replacement of the tile. This allows the creation of placeholder tiles for use with definetexture\texture without having to edit .ART files.


Unlike <b>dummytile</b> this command won't draw black squares and accepts the offsets.
Unlike <b>dummytile</b> this command won't draw black squares and accepts offsets.
 
It doesn't affect 8-bit tiles or HUD images.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>dummytilefrompic</div>=====
=====dummytilefrompic=====
{{Def table1}}


<span {{Def element}}>dummytilefrompic <i><tileID> <file></i></span>
<span {{Def element}}>dummytilefrompic <i><tileID> <file></i></span>


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>tilefromtexture</div>=====
== Mapster32 ==
 
<span {{Def element}}>tilefromtexture <i>{ ... }</i></span>
 
Used to generate an 8-bit tile from an image file.
 
: <span {{Def subelement}}>file <i><filename></i></span><br />
: <span {{Def subelement}}>name <i><filename></i></span>
 
: <span {{Def subelement}}>alphacut <i><value></i></span>
 
: <span {{Def subelement}}>xoffset <i><value></i></span><br />
: <span {{Def subelement}}>xoff <i><value></i></span>


: <span {{Def subelement}}>yoffset <i><value></i></span><br />
: <span {{Def subelement}}>yoff <i><value></i></span>


{{Def table2}} {{Def table1}}
=====<div {{Def link}}>include</div>=====
<span {{Def element}}>include <i><filename></i></span><br />
<span {{Def element}}>#include <i><filename></i></span>
Processes the script commands in <i><filename></i> at the point of the <b>include</b> call.
{{Def table2}} {{Def table1}}
=====<div {{Def link}}>define</div>=====
<span {{Def element}}>define <i><label> <integer-value></i></span><br />
<span {{Def element}}>#define <i><label> <integer-value></i></span>
Declares <i><label></i> to represent the numeric value <i><integer-value></i>. <i><integer-value></i> can be a label, in which case the value of the label given is used.
NOTE: You may find it convenient to include DEFS.CON (for JFDuke3D) or NAMES.H to predefine many of the tile names in the art file.
{{Def table2}} {{Def table1}}
=====<div {{Def link}}>loadgrp</div>=====
<span {{Def element}}>loadgrp <i><.GRP\.ZIP file></i></span>
The DEF equivalent of the <b>/g</b> command line switch. <b>loadgrp</b> can only be used in the originating .DEF file; it is usually <b>duke3d.def</b> or the .DEF file specified by the <b>/h</b> command line switch.
{{Def table2}} {{Def table1}}
=====<div {{Def link}}>noautoload</div>=====
<span {{Def element}}>noautoload</span>
Disables the autoload dir feature.
{{Def table2}} {{Def table1}}
=====<div {{Def link}}>cachesize</div>=====
<span {{Def element}}>cachesize <i><size></i></span>
Specifies the size of the cache in Kb.
{{Def table2}} {{Def table1}}
=====<div {{Def link}}>fogpal</div>=====
<span {{Def element}}>fogpal <i><palette number> <red intensity> <green intensity> <blue intensity></i></span>
<b>fogpal</b> defines a palette a sector-based fog effect. To use it, change the pal of your sector to the pal defined with <b>fogpal</b>.
Intensities range from 0-63. Palettes 26, 27, 28 and 29 are pre-defined for you as white, red, green and blue respectively. Sector visibility controls fog density.
{{Def table2}}
== Mapster32 ==


=====2dcol=====
{{Def table1}}
{{Def table1}}
=====<div {{Def link}}>2dcol</div>=====


<span {{Def element}}>2dcol <i><colornum> <red> <green> <blue></i></span>
<span {{Def element}}>2dcol <i><colornum> <red> <green> <blue></i></span>
Line 512: Line 647:
Certain low values are already hard-coded, and redefining them will change colors of the default layout. If you know the correct value, you can replace the default colors used for <b>all</b> the sprites. You truly have the power to customize Mapster32. Lime green 2D mode background, anyone?
Certain low values are already hard-coded, and redefining them will change colors of the default layout. If you know the correct value, you can replace the default colors used for <b>all</b> the sprites. You truly have the power to customize Mapster32. Lime green 2D mode background, anyone?


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>spritecol</div>=====
=====spritecol=====
{{Def table1}}


<span {{Def element}}>spritecol <i><tilenum> <normalcolornum> <blockingcolornum></i></span>
<span {{Def element}}>spritecol <i><tilenum> <normalcolornum> <blockingcolornum></i></span>
Line 520: Line 656:
<b>spritecol</b> is a definition of the color a sprite will appear in 2D mode, instead of the standard sky blue and hot pink, or another special color (like yellow for hard-coded enemies or white for the [[Special_Sprite_Reference_Guide|special sprites]]). <b><''normalcolornum''></b> is the <b><''colornum''></b> of the <b>2dcol</b> definition of your color for the standard sprite color as defined by <b><''tilenum''></b>. The same goes for <b><''blockingcolornum''></b>, except that this value is for when the sprite has the first bit of [[cstat]] set (1) (<code>[']+[B]</code> keys in [[Mapster32]]), which is the blocking flag.
<b>spritecol</b> is a definition of the color a sprite will appear in 2D mode, instead of the standard sky blue and hot pink, or another special color (like yellow for hard-coded enemies or white for the [[Special_Sprite_Reference_Guide|special sprites]]). <b><''normalcolornum''></b> is the <b><''colornum''></b> of the <b>2dcol</b> definition of your color for the standard sprite color as defined by <b><''tilenum''></b>. The same goes for <b><''blockingcolornum''></b>, except that this value is for when the sprite has the first bit of [[cstat]] set (1) (<code>[']+[B]</code> keys in [[Mapster32]]), which is the blocking flag.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>spritehotkey</div>=====
=====spritehotkey=====
{{Def table1}}


<span {{Def element}}>spritehotkey <i><key> <spriteID></i></span>
<span {{Def element}}>spritehotkey <i><key> <spriteID></i></span>
Line 528: Line 665:
Pressing a key from 1 to 0 on the upper row before pressing S will make the inserted sprite's picnum change according to this definition.
Pressing a key from 1 to 0 on the upper row before pressing S will make the inserted sprite's picnum change according to this definition.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>tilegroup</div>=====
=====tilegroup=====
{{Def table1}}


<span {{Def element}}>tilegroup <i><groupname> { ... }</i></span>
<span {{Def element}}>tilegroup <i><groupname> { ... }</i></span>


Defines group for tile tile selector(Press T in the tile seletor). Mapster32 loads TILES.CFG on startup.
Defines group for the tile selector (press 'T'). Mapster32 loads TILES.CFG on startup.


: <span {{Def subelement}}>tile <i><tilenum></i></span><br />
: <span {{Def subelement}}>tile <i><tilenum></i></span><br />
Line 550: Line 688:
: Colors are the colors for Blocking OFF and Blocking ON.
: Colors are the colors for Blocking OFF and Blocking ON.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>alphabet</div>=====
=====alphabet=====
{{Def table1}}


<span {{Def element}}>alphabet <i>{ ... }</i></span>
<span {{Def element}}>alphabet <i>{ ... }</i></span>


Defines alphabet for the input text feature(Ctrl+T). Mapster32 loads TILES.CFG on startup.
Defines alphabet for the input text feature (Ctrl+T). Mapster32 loads TILES.CFG on startup.


: <span {{Def subelement}}>map <i><value> <tile></i></span>
: <span {{Def subelement}}>map <i><value> <tile></i></span>
Line 574: Line 713:
== Deprecated Commands ==
== Deprecated Commands ==


=====definetexture=====
{{Def table1}}
{{Def table1}}
=====<div {{Def link}}>definetexture</div>=====


<span {{Def element}}>definetexture <i><tile-number> <palette-number> <x-center> <y-center> <x-size> <y-size> <filename></i></span>
<span {{Def element}}>definetexture <i><tile-number> <palette-number> <x-center> <y-center> <x-size> <y-size> <filename></i></span>


Defines a Hightile texture to replace an ART-file picture. <i><tile-number></i> may be an number, or a defined label. Use a value of 0 for <i><x-center></i> and <i><y-center></i> and a value of -1 for <i><x-size></i> and <i><y-size></i> for now until these values are actually used. <i><filename></i> may be any PNG, JPG, TGA, BMP, GIF or PCX file.
Defines a Hightile texture to replace an ART-file picture. <i><tile-number></i> may be an number, or a defined label. Use a value of 0 for <i><x-center></i> and <i><y-center></i> and a value of -1 for <i><x-size></i> and <i><y-size></i> for now until these values are actually used. <i><filename></i> may be any PNG, JPG, DDS, TGA, BMP, GIF, or PCX file.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>definetint</div>=====
=====definetint=====
{{Def table1}}


<span {{Def element}}>definetint <i><palette-number> <red> <green> <blue> <flags</i></span>
<span {{Def element}}>definetint <i><palette-number> <red> <green> <blue> <flags></i></span>


Defines a Hightile texture tint to simulate palette effects normally used on ART-file tiles. <i><red></i>, <i><green></i>, and <i><blue></i> are numbers in the range 0 to 255 which specify the color the tint should look like. <i><flags></i> specifies any processing effects to use. Valid values are:
Defines a Hightile texture tint to simulate palette effects normally used on ART-file tiles. <i><red></i>, <i><green></i>, and <i><blue></i> are numbers in the range 0 to 255 which specify the color the tint should look like. <i><flags></i> specifies any processing effects to use. Valid values are:
Line 596: Line 737:
These values can be added together to produce a combination of effects.
These values can be added together to produce a combination of effects.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>defineskybox</div>=====
=====defineskybox=====
{{Def table1}}


<span {{Def element}}>defineskybox <i><tile-number> <palette-number> <reserved> <front-face-filename> <right-face-filename> <back-face-filename> <left-face-filename> <top-face-filename> <bottom-face-filename></i></span>
<span {{Def element}}>defineskybox <i><tile-number> <palette-number> <reserved> <front-face-filename> <right-face-filename> <back-face-filename> <left-face-filename> <top-face-filename> <bottom-face-filename></i></span>


Defines a sky-box composed of six images mapped onto the faces  
Defines a sky-box composed of six images mapped onto the faces  
of a cube to be used when <i><tile-number></i> is set as parallaxing in GL Polymost mode. <i><reserved></i> should be 0 for now until its meaning is fully conceived.
of a cube to be used when <i><tile-number></i> is set as parallaxing in 32-bit OpenGL mode. <i><reserved></i> should be 0 for now until its meaning is fully conceived.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>definemodel</div>=====
=====definemodel=====
{{Def table1}}


<span {{Def element}}>definemodel <i><filename> <scale> <shade-offset></i></span>
<span {{Def element}}>definemodel <i><filename> <scale> <shade-offset></i></span>
Line 615: Line 758:
: <span {{Def subelement}}>definemodelskin <i><palette-number> <filename></i></span>
: <span {{Def subelement}}>definemodelskin <i><palette-number> <filename></i></span>


: Defines a skin to be used on the model for all frames declared after this command, when the sprite palette is equal to <i><palette-number></i>. (This makes more sense when given a demonstration.) <b>IMPORTANT:</b> If your model exists in a subdirectory (ie. <b>definemodel</b> includes a path to the .md2/3) you will need to give the same path to filename if the skin is in the same directory.
: Defines a skin to be used on the model for all frames declared after this command, when the sprite palette is equal to <i><palette-number></i>. (This makes more sense when given a demonstration.) IMPORTANT: If your model exists in a subdirectory (ie. <b>definemodel</b> includes a path to the .md2/3) you will need to give the same path to filename if the skin is in the same directory.


: <span {{Def subelement}}>selectmodelskin <i><skin ID></i></span>
: <span {{Def subelement}}>selectmodelskin <i><skin ID></i></span>
Line 632: Line 775:
: Defines a range of ART-file tiles to correspond with the given frame of the model specified in the last preceding <b>definemodel</b> instruction. <i><frame-name></i> is the name of the frame, which if identical to the starting frame of a <b>definemodelanim</b> animation will play that animation. If <i><frame-name></i> is not corresponding with an animation, the replacement will be static. <i><first-tile></i> and <i><last-tile></i> specify a range of ART-file tiles which this model frame should replace.
: Defines a range of ART-file tiles to correspond with the given frame of the model specified in the last preceding <b>definemodel</b> instruction. <i><frame-name></i> is the name of the frame, which if identical to the starting frame of a <b>definemodelanim</b> animation will play that animation. If <i><frame-name></i> is not corresponding with an animation, the replacement will be static. <i><first-tile></i> and <i><last-tile></i> specify a range of ART-file tiles which this model frame should replace.


{{Def table2}} {{Def table1}}
{{Def table2}}


=====<div {{Def link}}>definevoxel</div>=====
=====definevoxel=====
{{Def table1}}


<span {{Def element}}>definevoxel <i><filename></i></span><br />
<span {{Def element}}>definevoxel <i><filename></i></span><br />
Line 645: Line 789:
{{Def table2}}
{{Def table2}}


[[Category:All commands]]
=====alphahack=====
{{Def table1}}
 
<span {{Def element}}>alphahack <i><tilenum> <value></i></span><br />
<span {{Def element}}>alphahackrange <i><tilenum1> <tilenum2> <value></i></span><br />
 
<b>alphahack</b> is a deprecated command previously used to improve alpha filtering of highres art of <i><tilenum></i>. <i><value></i> is always -1.
 
{{Def table2}}

Revision as of 10:27, 31 March 2018

DEF files are parsed scripts which allow definition of textures, 3D models, miscellaneous settings, higher-quality sounds and music, and more.

Comments can be used by prefixing the text with a double forward-slash //, or surrounding the text with /* (comment here) */.

Setup

include

include <filename>
#include <filename>

Processes the script commands in <filename> at the point of the include call.

includedefault

includedefault
#includedefault

Processes the script commands in the default .def file at the point of the include call. Only useful for command-line overrides.

For Duke Nukem 3D, the file is duke3d.def. For NAM, it is nam.def. For WWII GI, it is ww2gi.def.

define

define <label> <integer-value>
#define <label> <integer-value>

Declares <label> to represent the numeric value <integer-value>. <integer-value> can be a label, in which case the value of the label given is used.

NOTE: You may find it convenient to include DEFS.CON or NAMES.H to predefine many of the tile (and sound) names in the art file.

loadgrp

loadgrp <.grp\.zip file>

The DEF equivalent of the /g command line switch.

noautoload

noautoload

Disables the autoload dir feature.

cachesize

cachesize <size>

Specifies the size of the cache in Kb. Don't use this unless you know what you are doing.

globalflags

globalflags <flags>

Specifies a set of global flags. Multiple flags can be set by adding their numbers together.

0 = None
1 = No palette emulation in OpenGL.
2 = No fullbrights in OpenGL.
4 = No fog shading in OpenGL.

Color Palettes

tint

tint { ... }

Defines a Hightile texture tint to simulate palette effects normally used on ART-file tiles.

Example:

tint { pal 1 red 127 green 127 blue 255 flags 0 }
tint { pal 2 green 127 blue 127 }

The brace-enclosed block may contain these instructions:

pal <palnum>
The palette number the tint applies to.
red <value> (or r <value>)
green <value> (or g <value>)
blue <value> (or b <value>)
Specifies a color component value, in the range of 0 to 255. Unspecified components are assumed to be 255 and any out of range values are clamped to the maximum or minimum as appropriate.
flags <flags>
Specifies any special processing effects to use for the tint. The value of flags may be the sum of any of these values:
0 = no effects
1 = convert to greyscale
2 = invert colors
fogpal

fogpal <palette number> <red intensity> <green intensity> <blue intensity>

fogpal defines a palette a sector-based fog effect. To use it, change the pal of your sector to the pal defined with fogpal.

Intensities range from 0-63. Palettes 26, 27, 28 and 29 are pre-defined for you as white, red, green and blue respectively. Sector visibility controls fog density.

makepalookup

makepalookup { ... }

Interface to creating palette lookups containing both color index remapping (only in effect for non-hightile textures) and fog. This is in contrast to fogpal, which always resets the remapping to the identity mapping ("pal 0").


The brace-enclosed block may contain these instructions:

pal <palnum>
The palette number, must be from 1 to 250.
red <value> (or r <value>)
green <value> (or g <value>)
blue <value> (or b <value>)
Specifies a color component value, in the range of 0 to 63. Unspecified components are assumed to be 0 and any out of range values are clamped to the maximum or minimum as appropriate.
remappal <palnum>
The palette number to take the index remapping from, i.e. 21 for blue -> red. When absent, defaults to 0.
remapself
The same as remappal <palnum>, where <palnum> is the number provided for the pal token.


Examples

This creates palookup 200 with a fog of (30,0,0) and a blue-to-yellow remapping (assuming it has not been changed before):

 makepalookup { pal 200  red 30  remappal 23 }

This 'fogifies' palookup 21 with a red fog:

 makepalookup { pal 21  red 30  remapself }

This overwrites palookup 21 with a red fog, but clears the blue-to-red remapping:

 makepalookup { pal 21  red 30 }

Definitions

8-Bit .ART File Replacements

tilefromtexture

tilefromtexture <tilenum> { ... }

Used to generate an 8-bit tile from an image file. Use the alpha channel for transparency instead of the pink color.

file <filename>
name <filename>
alphacut <value>

In addition to working when you are adding an image file as an art tile, the following parameters can also be used without specifying a file to modify the attributes of an existing ART tile.

xoffset <value>
xoff <value>
yoffset <value>
yoff <value>
texhitscan
nofullbright
animtilerange

animtilerange <tilenum1> <tilenum2> <speed value> <animation value>

Sets an animation range identical to the ones embedded in the .ART files.

Speed value ranges from 0 to 15, 0 being the fastest.

Values are:

0 = none
1 = oscillating
2 = forward
3 = backward

voxel

voxel <filename> { ... }

Defines a voxel to replace sprites. filename is the name of the .KVX file containing the voxel. The brace-enclosed block may contain these instructions:

tile <tilenum>
tile0 <tilenum>
tile1 <tilenum>
Use these instructions to map tiles that should be rendered as a voxels. Use tile to map a single tile to be rendered as voxels and tile0, tile1 together define a range of tiles to be rendered as voxels. The tile0 instruction should appear before the tile1 instruction to define a correct range.
scale <value>
<value> is a (possibly fractional) value specifying a scaling factor for the voxelmodel when it is rendered, eg. 1.5 for one-and-a-half times as big.

High Resolution Art

texture

texture <tilenum> { ... }

Defines a Hightile texture to replace an ART-file tile. <tilenum> may be a number, or a defined label.

Example:

texture 3586 {
  pal 0 { file "mymod/tree.png" }
  pal 21 { file "mymod/tree_red.png" xscale 2.0 yscale 2.0 alphacut 0 nodownsize nocompress }
  glow { file "mymod/tree_light.png" }
  detail { file "mymod/plant_texture.png" scale 0.5 }
}

The brace-enclosed block may contain these instructions:

pal <palnum> { ... }
Replaces the palette <palnum>. If a palette has no pal definition palette 0 definition will be used. Tint will not be used on palettes defined with this instruction.
The brace-enclosed block may contain these instructions:
file <filename> (or name <filename>)
Defines which texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.
alphacut <cutoff-value>
Sets the level of transparency at which a pixel in the texture is considered opaque. Pixels with more transparency than the cut-off are not drawn to the screen when rendered. The default setting is 0.32, which is just below the 33% transparency level of Build. If your texture has areas that are more transparent than the default, you can lower the cut-off level to preserve that detail.
nocompress
Prevents the texture from being compressed using S3TC if texture compression is enabled.
nodownsize
Prevents the texture from being downsized.
xscale <value>
yscale <value>
Sets the scale of the hightile texture in relation to the original texture. A <value> of 1.0 makes it the same size, higher makes it cover more then the original tile and smaller makes it cover a smaller area. xscale (aka scale, detailscale, intensity) sets the horizontal scale and yscale sets the vertical scale.
detail { ... }
Defines a detail texture for the texture. The brace-enclosed block may contain these instructions:
file <filename>
Specifies which detail texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.
scale <value>
<value> is a positive floating-point value that'll determine how much your detail map should repeat on your diffuse map (if you want your detail map to repeat five times, use a 1/5 scale : 0.2).
glow { ... }
Defines a glow map for the texture. The brace-enclosed block may contain these instructions:
file <filename>
Specifies which glow map file to use. This instruction must be supplied.
skybox

skybox { ... }

Defines a skybox that overrides a parallaxing floor or ceiling in OpenGL rendering modes.

Example:

skybox {
  tile 3586 pal 0
  front "mymod/sky_1.png" nocompress 
  right "mymod/sky_2.png" nocompress 
  back  "mymod/sky_3.png" nocompress
  left  "mymod/sky_4.png" nocompress 
  top   "mymod/sky_5.png" nocompress
  down  "mymod/sky_6.png" nocompress
}

The brace-enclosed block may contain these instructions:

tile <tilenum>
Specifies the ART file tile to override.
pal <palnum>
Specifies the palette number the skybox should happen for.
front <filename> (or Front / ft / forward)
right <filename> (or rt / right)
back <filename> (or bk / back)
left <filename> (or lf / left) / lt)
top <filename> (or up / top / ceiling / ceil)
down <filename> (or dn / bottom / floor / down)
Defines a single face of the skybox where facename may be any of these keywords appropriate for the face in question:
NOTE: All six faces are required to be specified.
model

model <filename> { ... }

Defines a model to replace certain sprites in the game when running in 32-bit OpenGL mode. <filename> is the model file in md2 or md3 format.

Note: md2 is considered deprecated.

The brace-enclosed block may contain these instructions:

scale <value>
<value> is a (possibly fractional) value specifying a scaling factor for the model when it is rendered, eg. 1.5 for one-and-a-half times as big.
shade <shade-offset>
<shade-offset> is an integer value specifying how much to bias the sprite's shade value by. A negative value for this makes the model brighter. Conversely, a positive value makes it darker.
zadd <offset>
<offset> is a (possibly fractional) value specifying a height offset for the model. Quake models are aligned in the center while Build models are aligned at the floor. Using this command will allow Build to use Quake models without modification to the MD2/3 file itself.
flags <flags>
Specifies any special properties the model should have, the values of which should be added together to combine multiple options.
0: default value
1: Prevents the the model from being affected by the tints.
skin { ... }
Defines a skin to be used on the model for all frames declared after this command. The brace-enclosed block may contain these instructions:
pal <palnum>
Specifies which palette this skin maps to.
surface <surfnum>
Specifies which MD3 surface this skin should be applied to. This has no significance for MD2 models.
file <filename>
Specifies the texture file to use for the skin. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file
IMPORTANT: If your model exists in a subdirectory (ie. the model filename includes a path to the .md2/3) you will need to give the same path to filename if the skin is in the same directory.
anim { ... }
Defines an animation from a group of frames in the model. The brace-enclosed block may contain these instructions:
frame0 <framename>
frame1 <framename>
Specifies the names of the start (frame0) and end (frame1) frames of the animation.
fps <fps>
Specifies the frame rate at which the animation should play. This value may be fractional.
flags <flags>
Specifies any special properties the animation should have, the values of which should be added together to combine multiple options.
Valid options are:
0 none (looping animation)
1 one-shot (plays beginning to end once and stops on the last frame).
frame { ... }
Defines a range of ART-file tiles to correspond with the given frame/animation of the model. The brace-enclosed block may contain these instructions:
name <framename>
frame <framename>
If <framename> is identical to the starting frame of an animation, the engine will play that animation, otherwise the replacement will be static. You can choose to use the frame or name versions of this instruction as both are identical.
tile <tilenum>
tile0 <tilenum>
tile1 <tilenum>
Use the tile instruction to specify an ART-file tile which this model should replace. Use the tile0 and tile1 instructions together to specify a range of ART-file tiles. If you use tile0, you must also have a tile1. You may not use the same instruction twice to specify multiple ranges.
smoothduration <value>
If smoothduration is non-zero switching from another animation to the one defined by that frame block will trigger an intermediary animation smoothing state of duration <value> seconds.
pal <value>
Makes the model definition exclusive for the this pal. This allow to assign different models for different pal.
hud { ... }
Defines a range of ART-file tiles to use with a heads-up-display. The brace-enclosed block may contain these instructions:
tile <tilenum>
tile0 <tilenum>
tile1 <tilenum>
tile0 and tile1 together specify a range of ART-file tiles which this model frame should replace when rendered as part of the HUD. You can specify individual tiles using a single tile command.
xadd <offset>
yadd <offset>
zadd <offset>
angadd <offset>
Use these offsets to fine-tune the location of the model placement. xadd, yadd, and zadd are position offsets relative to the viewer's orienation. You can use floating point values with them. angadd is a Build angle offset. (512 90 degrees, 1024 180 degrees, etc...).
hide
Some weapons use multiple ART tiles for constructing the gun or animation. Use this option to hide parts that you don't need in your replacement.
nobob
By default, the HUD model offset is affected by the player bobbing offset when the player is walking. Use this option to disable that.
flipped
Use this option to apply the settings inside the hud block only if the object is normally rendered x-flipped (mirror image). Some weapons, such as the devastator, are rendered in 2 pieces, the left devastator is actually a mirror image of the right.
nodepth
Use this to render a HUD model without the use of the depth buffer. Normally, you should avoid this. The one exception where this is useful is for the spinning nuke menu icon because it should always be in front -- and it just happens to be convex, which is the one case that is safe with the depth buffer disabled.
detail { ... }
Defines a detail texture for the model. The brace-enclosed block may contain these instructions:
file <filename>
Specifies which detail texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.
scale <value>
<value> is a positive floating-point value that'll determine how much your detail map should repeat on your diffuse map (if you want your detail map to repeat five times, use a 1/5 scale : 0.2).
surface <surfnum>
Specifies which MD3 surface this detail texture should be applied to. This has no significance for MD2 models.
glow { ... }
Defines a glow map for the model. The brace-enclosed block may contain these instructions:
file <filename>
Specifies which glow map file to use. This instruction must be supplied.
surface <surfnum>
Specifies which MD3 surface this glow map should be applied to. This has no significance for MD2 models.

Audio

music

music { ... }

Example:

music { id "E1L1" file "stalker1.ogg" }
music { id "intro" file "grabbag.ogg" }
music { id "briefing" file "briefing.ogg" }
music { id "loading" file "menusng2.flac" }
id <value>
<value> is "intro", "briefing", "loading" or "ExLy" (where x is the episode and y is the level).
file <filename>
Specifies which audio file to use. File types: MIDI, Ogg Vorbis, FLAC
sound

sound { ... }

Example:

sound { id "249" file "bonus.ogg" }
id <value>
Specifies the ID of sound. The ID can be found in DEFS.CON. NOTE: This should only be used for HRP-like replacement of existing sounds. New sounds should use definesound.
file <filename>
Specifies which audio file to use. File types: WAV, VOC, Ogg Vorbis, FLAC
animsounds

animsounds <anim> { frame1 sound1 frame2 sound2 ... }

<anim> has to be one of the following tokens corresponding to hard-coded Duke3D anims:

  • cineov2: Episode 2 ending
  • cineov3: Episode 3 ending
  • RADLOGO: "Come back to bed, Duke..."
  • DUKETEAM: Duke3D team still
  • logo: Intro nuke logo
  • vol41a: Episode 4 intro 1
  • vol42a: Episode 4 intro 2
  • vol43a: Episode 4 intro 3
  • vol4e1: Episode 4 ending 1
  • vol4e2: Episode 4 ending 2
  • vol4e3: Episode 4 ending 3

The frameN's (1-based frame numbers) have to be in ascending order. They do not need to be strictly ascending, so that a frame may have more than one sound.

Example: for Duke3D's XBLA nuke logo animation (IVF extracted from nuke.webm), the following definition overlays the video with a sound sequence similar (identical save for timing) to the original nuke animation:

// frame 1: FLY_BY, frame 64: PIPEBOMB_EXPLODE
animsounds logo { 1 244  64 14 }

Un-Definitions

The main use for these is for cases in which the .ART files are somewhat different, and you want to ensure compatibility for the new art without new textures or models. A good example of this is Duke: Nuclear Winter Plus by Hendricks266. (see undef.def)


undeftexture

undeftexture <tile>
undeftexturerange <tile0> <tile1>

This is for undefining Hightile textures.

undefmodel

undefmodel <tile>
undefmodelrange <tile0> <tile1>
undefmodelof <tile>1

This is for undefining 3D models.

With undefmodelof all the tiles grouped together within the same .def code block are un-defined.

1Support of undefmodelof is disabled indefinitely due to problems with its implementation.

Misc

dummytile

dummytile <tilenum> <x-dimension> <y-dimension>
dummytilerange <tilenum1> <tilenum2> <x-dimension> <y-dimension>

Used in DEF files to create a blank tile at location <tilenum> of the dimensions <x-dimension> and <y-dimension>. This allows the creation of placeholder tiles for use with definetexture\texture without having to edit .ART files.

NOTE: In most circumstances setuptile is a better command to use, unless you specifically want black boxes.

setuptile

setuptile <tilenum> <x-dimension> <y-dimension> <x-offset> <y-offset>
setuptilerange <tilenum1> <tilenum2> <x-dimension> <y-dimension> <x-offset> <y-offset>

Used in DEF files to setup the properties which are applied to the highres replacement of the tile. This allows the creation of placeholder tiles for use with definetexture\texture without having to edit .ART files.

Unlike dummytile this command won't draw black squares and accepts offsets.

It doesn't affect 8-bit tiles or HUD images.

dummytilefrompic

dummytilefrompic <tileID> <file>

Mapster32

2dcol

2dcol <colornum> <red> <green> <blue>

2dcol is a definition of a color to be used in the 2D mode of Mapster32, in conjunction with spritecol that works similarly to tint and definetint. <colornum> is a unique identifier, similar to defines and gamevars. <red>, <green>, and <blue> are the RGB color values that are mixed together to get your custom color.

Certain low values are already hard-coded, and redefining them will change colors of the default layout. If you know the correct value, you can replace the default colors used for all the sprites. You truly have the power to customize Mapster32. Lime green 2D mode background, anyone?

spritecol

spritecol <tilenum> <normalcolornum> <blockingcolornum>

spritecol is a definition of the color a sprite will appear in 2D mode, instead of the standard sky blue and hot pink, or another special color (like yellow for hard-coded enemies or white for the special sprites). <normalcolornum> is the <colornum> of the 2dcol definition of your color for the standard sprite color as defined by <tilenum>. The same goes for <blockingcolornum>, except that this value is for when the sprite has the first bit of cstat set (1) ([']+[B] keys in Mapster32), which is the blocking flag.

spritehotkey

spritehotkey <key> <spriteID>

Pressing a key from 1 to 0 on the upper row before pressing S will make the inserted sprite's picnum change according to this definition.

tilegroup

tilegroup <groupname> { ... }

Defines group for the tile selector (press 'T'). Mapster32 loads TILES.CFG on startup.

tile <tilenum>
tilerange <tilenum1> <tilenum2>
tiles { <tile1> <tile2> ... <tileN> }
Adds tiles to the group. Names can be found in DEFS.CON.
hotkey <value>
Specifies the hotkey for the group.
colors <value1> <value2>
Colors are the colors for Blocking OFF and Blocking ON.
alphabet

alphabet { ... }

Defines alphabet for the input text feature (Ctrl+T). Mapster32 loads TILES.CFG on startup.

map <value> <tile>
mapa <string> <tile>
maprange <value1> <value2> <tile>
maprangea <char1> <char2> <tile>
offset <value> <offset>
offseta <string> <offset>

Deprecated Commands

definetexture

definetexture <tile-number> <palette-number> <x-center> <y-center> <x-size> <y-size> <filename>

Defines a Hightile texture to replace an ART-file picture. <tile-number> may be an number, or a defined label. Use a value of 0 for <x-center> and <y-center> and a value of -1 for <x-size> and <y-size> for now until these values are actually used. <filename> may be any PNG, JPG, DDS, TGA, BMP, GIF, or PCX file.

definetint

definetint <palette-number> <red> <green> <blue> <flags>

Defines a Hightile texture tint to simulate palette effects normally used on ART-file tiles. <red>, <green>, and <blue> are numbers in the range 0 to 255 which specify the color the tint should look like. <flags> specifies any processing effects to use. Valid values are:

0 no effects
1 convert to greyscale
2 invert colours

These values can be added together to produce a combination of effects.

defineskybox

defineskybox <tile-number> <palette-number> <reserved> <front-face-filename> <right-face-filename> <back-face-filename> <left-face-filename> <top-face-filename> <bottom-face-filename>

Defines a sky-box composed of six images mapped onto the faces of a cube to be used when <tile-number> is set as parallaxing in 32-bit OpenGL mode. <reserved> should be 0 for now until its meaning is fully conceived.

definemodel

definemodel <filename> <scale> <shade-offset>

Defines an MD2/3-format model file to replace certain sprites in the game. See definemodelframe and definemodelanim for details on how to specify the ART-file tiles to replace. <filename> is the name of the MD2/3 model. <scale> is a (possibly fractional) value specifying a scaling factor for the model when it is rendered, eg. 1.5 for one-and-a-half times as big. <shade-offset> is an integer value specifying how much to bias the sprite's shade value by. A negative value for this makes the model brighter. Conversely, a positive value makes it darker.

definemodelskin <palette-number> <filename>
Defines a skin to be used on the model for all frames declared after this command, when the sprite palette is equal to <palette-number>. (This makes more sense when given a demonstration.) IMPORTANT: If your model exists in a subdirectory (ie. definemodel includes a path to the .md2/3) you will need to give the same path to filename if the skin is in the same directory.
selectmodelskin <skin ID>
Selects a model skin.
definemodelanim <start-frame> <end-frame> <frame-rate> <flags>
Defines an animation from a group of frames in the model given by the last preceding definemodel instruction. <start-frame> and <end-frame> specify the names of the starting and ending frames of the animation. <frame-rate> is the frame rate at which the animation should play. This value can be fractional. <flags> specifies any special properties the animation should have. Valid options are:
0 none (looping animation)
1 one-shot (plays beginning to end once and stops on the last frame)
definemodelframe <frame-name> <first-tile> <last-tile>
Defines a range of ART-file tiles to correspond with the given frame of the model specified in the last preceding definemodel instruction. <frame-name> is the name of the frame, which if identical to the starting frame of a definemodelanim animation will play that animation. If <frame-name> is not corresponding with an animation, the replacement will be static. <first-tile> and <last-tile> specify a range of ART-file tiles which this model frame should replace.
definevoxel

definevoxel <filename>
definevoxeltiles <first-tile> <last-tile>

Defines a voxel to replace sprites in the game. <filename> is the name of the .KVX file containing the voxel.

definevoxeltiles defines the range of ART-file tiles to replace with the voxel.

alphahack

alphahack <tilenum> <value>
alphahackrange <tilenum1> <tilenum2> <value>

alphahack is a deprecated command previously used to improve alpha filtering of highres art of <tilenum>. <value> is always -1.