Difference between revisions of "Model (DEF)"

From EDukeWiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''model''' <filename> { [...] }
+
{{Under construction}}
 +
 
 +
<span {{code}}>'''model''' <filename> { [...] }</span>
  
 
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.
 
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.
Line 7: Line 9:
 
== Tokens ==
 
== Tokens ==
  
: '''scale''' <value>
+
<span {{code}}>'''scale''' <value></span>
 +
 
 +
<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.
 +
 
 +
<span {{code}}>'''shade''' <value></span>
 +
 
 +
<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.
  
: <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.
+
<span {{code}}>'''yoffset''' <offset></span>
  
: '''shade''' <shade-offset>
+
DESCRIPTION
  
: <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.
+
<span {{code}}>'''zadd''' <offset></span>
  
: '''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.
  
: <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.
+
<span {{code}}>'''flags''' <flags></span>
  
: '''flags''' <flags>
+
Specifies any special properties the model should have, the values of which should be added together to combine multiple options.
  
: Specifies any special properties the model should have, the values of which should be added together to combine multiple options.
+
* 0: default value
: 0: default value
+
* 1: Prevents the the model from being affected by the tints.
: 1: Prevents the the model from being affected by the tints.
 
  
: '''skin''' { [...] }
+
<span {{code}}>'''skin''' { [...] }</span>
  
: Defines a skin to be used on the model for all frames declared after this command. The brace-enclosed block may contain these instructions:
+
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>
+
<span {{code}}>'''detail''' { [...] }</span>
  
:: Specifies which palette this skin maps to.
+
Defines a [[Detail_mapping|detail texture]] for the model. The brace-enclosed block may contain these instructions:
  
:: '''surface''' <surfnum>
+
<span {{code}}>'''glow''' { [...] }</span>
  
:: Specifies which MD3 surface this skin should be applied to. This has no significance for MD2 models.
+
Defines a [[Glow_mapping|glow map]] for the model. The brace-enclosed block may contain these instructions:
  
:: '''file''' <filename>
+
<span {{code}}>'''specular''' { [...] }</span>
  
:: Specifies the texture file to use for the skin. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file
+
DESCRIPTION
  
:: 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.
+
<span {{code}}>'''normal''' { [...] }</span>
  
: '''anim''' { [...] }
+
DESCRIPTION
  
: Defines an animation from a group of frames in the model. The brace-enclosed block may contain these instructions:
+
:: <span {{code}}>'''pal''' <palnum></span>
  
:: '''frame0''' <framename>
+
:: Specifies which palette this texture maps to.
  
:: '''frame1''' <framename>
+
:: <span {{code}}>'''surface''' <surfnum></span> (or '''surf''')
       
+
 
:: Specifies the names of the start ('''frame0''') and end ('''frame1''') frames of the animation.
+
:: Specifies which MD3 surface this texture should be applied to. This has no significance for MD2 models.
 +
 
 +
:: <span {{code}}>'''file''' <filename></span>
 +
 
 +
:: Specifies the texture file to use. 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 texture is in the same directory.
  
:: '''fps''' <fps>
+
:: <span {{code}}>'''scale''' <value></span>
  
:: Specifies the frame rate at which the animation should play. This value may be fractional.
+
:: <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).
  
:: '''flags''' <flags>
+
:: <span {{code}}>'''scale''' <value></span> (or '''detailscale''' / '''intensity''')
  
:: Specifies any special properties the animation should have, the values of which should be added together to combine multiple options.
+
:: DESCRIPTION
  
:: Valid options are:
+
:: <span {{code}}>'''specpower''' <value></span>
  
:: 0 none (looping animation)
+
:: DESCRIPTION
  
:: 1 one-shot (plays beginning to end once and stops on the last frame).
+
:: <span {{code}}>'''specfactor''' <value></span>
  
: '''frame''' { [...] }
+
:: DESCRIPTION
  
: 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:
+
:: <span {{code}}>'''nocompress'''</span>
  
:: '''name''' <framename>
+
:: DESCRIPTION
:: '''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.
+
:: <span {{code}}>'''nodownsize'''</span>
  
:: '''tile''' <tilenum>
+
:: DESCRIPTION
:: '''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.
+
:: <span {{code}}>'''forcefilter'''</span>
  
:: '''smoothduration''' <value>
+
:: DESCRIPTION
  
:: 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.
+
:: <span {{code}}>'''artquality'''</span>
  
:: '''pal''' <value>
+
:: DESCRIPTION
  
:: Makes the model definition exclusive for the this pal. This allow to assign different models for different pal.
+
<span {{code}}>'''anim''' { [...] }</span>
  
: '''hud''' { [...] }
+
Defines an animation from a group of frames in the model. The brace-enclosed block may contain these instructions:
  
: Defines a range of ART-file tiles to use with a heads-up-display. The brace-enclosed block may contain these instructions:
+
:: <span {{code}}>'''frame0''' <start framename></span><br />
 +
:: <span {{code}}>'''frame1''' <end framename></span>
 +
       
 +
:: Specifies the names of the start ('''frame0''') and end ('''frame1''') frames of the animation.
  
:: '''tile''' <tilenum>
+
:: <span {{code}}>'''fps''' <fps></span>
  
:: '''tile0''' <tilenum>
+
:: Specifies the frame rate at which the animation should play. This value may be fractional.
  
:: '''tile1''' <tilenum>
+
:: <span {{code}}>'''flags''' <flags></span>
  
:: '''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.
+
:: Specifies any special properties the animation should have, the values of which should be added together to combine multiple options.
   
 
:: '''xadd''' <offset>
 
  
:: '''yadd''' <offset>
+
:: Valid options are:
  
:: '''zadd''' <offset>
+
:: {| cellpadding="0" cellspacing="0" border="0"
 +
|
 +
* 0: none (looping animation)
 +
* 1: one-shot (plays beginning to end once and stops on the last frame).
 +
|-
 +
|}
  
:: '''angadd''' <offset>
+
<span {{code}}>'''frame''' { [...] }</span>
  
:: 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...).
+
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:
  
:: '''hide'''
+
:: <span {{code}}>'''name''' <framename></span> (or '''frame''')
  
:: 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.
+
:: 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.
  
:: '''nobob'''
+
:: <span {{code}}>'''tile''' <tilenum></span><br />
 +
:: <span {{code}}>'''tile0''' <start tilenum></span><br />
 +
:: <span {{code}}>'''tile1''' <end tilenum></span>
  
:: By default, the HUD model offset is affected by the player bobbing offset when the player is walking. Use this option to disable that.
+
:: 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.
  
:: '''flipped'''
+
:: <span {{code}}>'''smoothduration''' <value></span>
  
:: 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.
+
:: 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.
  
:: '''nodepth'''
+
:: <span {{code}}>'''pal''' <value></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 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.
+
:: Makes the model definition exclusive for the this pal. This allow to assign different models for different pal.
  
: '''detail''' { [...] }
+
<span {{code}}>'''hud''' { [...] }</span>
  
: Defines a [[Detail_mapping|detail texture]] for the model. The brace-enclosed block may contain these instructions:
+
Defines a range of ART-file tiles to use with a heads-up-display. The brace-enclosed block may contain these instructions:
  
:: '''file''' <filename>
+
:: <span {{code}}>'''tile''' <tilenum></span><br />
 +
:: <span {{code}}>'''tile0''' <start tilenum></span><br />
 +
:: <span {{code}}>'''tile1''' <end tilenum></span>
  
:: 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.
+
:: '''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.
 +
   
 +
:: <span {{code}}>'''xadd''' <offset></span><br />
 +
:: <span {{code}}>'''yadd''' <offset></span><br />
 +
:: <span {{code}}>'''zadd''' <offset></span><br />
 +
:: <span {{code}}>'''angadd''' <offset></span>
 +
 
 +
:: 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...).
  
:: '''scale''' <value>
+
:: <span {{code}}>'''fov'''</span>
  
:: <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).
+
:: DESCRIPTION
  
:: '''surface''' <surfnum>
+
:: <span {{code}}>'''hide'''</span>
  
:: Specifies which MD3 surface this detail texture should be applied to. This has no significance for MD2 models.
+
:: 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.
  
: '''glow''' { [...] }
+
:: <span {{code}}>'''nobob'''</span>
  
: Defines a [[Glow_mapping|glow map]] for the model. The brace-enclosed block may contain these instructions:
+
:: By default, the HUD model offset is affected by the player bobbing offset when the player is walking. Use this option to disable that.
  
:: '''file''' <filename>
+
:: <span {{code}}>'''flipped'''</span>
  
:: Specifies which glow map file to use. This instruction must be supplied.
+
:: 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.
  
:: '''surface''' <surfnum>
+
:: <span {{code}}>'''nodepth'''</span>
  
:: Specifies which MD3 surface this glow map should be applied to. This has no significance for MD2 models.
+
:: 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.
  
 
[[Category:DEF commands]]
 
[[Category:DEF commands]]

Latest revision as of 01:53, 23 February 2020

Under construction.png
This page is under construction.
Please help review and edit this page.

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.

Tokens

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 <value>

<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.

yoffset <offset>

DESCRIPTION

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:

detail { [...] }

Defines a detail texture for the model. The brace-enclosed block may contain these instructions:

glow { [...] }

Defines a glow map for the model. The brace-enclosed block may contain these instructions:

specular { [...] }

DESCRIPTION

normal { [...] }

DESCRIPTION

pal <palnum>
Specifies which palette this texture maps to.
surface <surfnum> (or surf)
Specifies which MD3 surface this texture should be applied to. This has no significance for MD2 models.
file <filename>
Specifies the texture file to use. 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 texture is in the same directory.
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).
scale <value> (or detailscale / intensity)
DESCRIPTION
specpower <value>
DESCRIPTION
specfactor <value>
DESCRIPTION
nocompress
DESCRIPTION
nodownsize
DESCRIPTION
forcefilter
DESCRIPTION
artquality
DESCRIPTION

anim { [...] }

Defines an animation from a group of frames in the model. The brace-enclosed block may contain these instructions:

frame0 <start framename>
frame1 <end 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> (or frame)
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 <start tilenum>
tile1 <end 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 <start tilenum>
tile1 <end 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...).
fov
DESCRIPTION
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.