DECALDEF

From ZDoom Wiki
Jump to navigation Jump to search

The DECALDEF lump allows the wad maker to redesign the decals that are left on walls by monsters or the player. Hitscan weapons as well as projectile weapons can leave decals. You can also place decals on the map with a Decal thing (9200) or through ACS with SpawnDecal.

The information of a decal begins with the decal itself followed by a generator to tell ZDoom which object will leave this decal. You can also specify a Decal ID in order to place decals directly on the map. The Decal ID must be a number between 1 and 65535 (inclusive). Several options can be used when defining a decal:

  • pic <graphics name>
This is the graphic ZDoom will paste on the wall.
  • shade "rr gg bb"
This allows you to recolor the picture using specific RGB values. The value is specified as a string containing 3 hexadecimal values.
  • x-scale <scale>
This scales the graphic on the x axis. 1.00 is default.
  • y-scale <scale>
This scales the graphic on the y axis. 1.00 is default.
  • flipx
This tells ZDoom to flip the graphic on the x axis when drawing it.
  • flipy
This tells ZDoom to flip the graphic on the y axis when drawing it.
  • randomflipx
This tells ZDoom to randomly flip the graphic on the x axis when drawing it.
  • randomflipy
This tells ZDoom to randomly flip the graphic on the y axis when drawing it.
  • solid
draws the decal non-translucent.
  • opaqueblood
Draws the decal non-shaded, i.e. the same way as sprites are drawn with the 'Normal' Renderstyle. This is useful when the decal is supposed to imitate the look of a sprite.
  • translucent <alpha>
Draws a translucent decal with the specified translucency. 0.0 means it's invisible, 1.0 means it's opaque
  • add <alpha>
Draws the decal with additive translucency. 0 means it's invisible, 1 means it's drawn in full intensity.
  • fuzzy
Draws the decal with a fuzz effect (like the spectre in Doom.)
  • fullbright
Draws the decal full bright regardless of the current lighting in the sector.
  • lowerdecal decalname
Draws another decal below this one. The BFG lightning effect uses this for example
  • colors "rr gg bb" "rr gg bb"
Creates a translation table. From a look at the implementation it doesn't look useful. If somebody has more information or some experience how to use it please post it here!
  • animator
Sets a Decal animator for the current decal

Note that not all of these must be used for each decal. However, the following example shows each in use.

   decal MyDecal 4
   {
       pic SCORCH1
       shade "00 10 00"
       x-scale 0.25
       y-scale 0.25
       randomflipx
       randomflipy
   }
   generator FrostMissile        MyDecal

In this example, the image "SCORCH1" is read, and shaded slightly green. It is then scaled to 25% its normal size, and randomly flipped on the two axes. To place this decal on a map with the decal thing, use an ID number of 4.

The last line shows the "generator," which tells ZDoom that the "FrostMissile" object will use the "MyDecal" decal. This means that any time the Mage's Frost Shards hit the wall, it will leave a decal of this kind. This name comes from using a dumpclass via the console, and is case sensitive.

Using None instead of an actual decal name, clears the decal that was previously assigned to the generator.

An optional keyword can be added after generator to exempt a generator definition from being error-reported by the engine if the referenced actor or decal definitions do not exist.

The following example shows another version of a decal, which randomly selects between two different decals to paste. The decals are set up as usual, and a "decalgroup" header is added, with the names of the two (or more) decals to use. The generator then references the decalgroup.

   decal MyDecal1
   {
       pic PLASMA1
       shade "08 08 08"
       randomflipx
       randomflipy
   }
   decal MyDecal2
   {
       pic PLASMA2
       shade "08 08 08"
       randomflipx
       randomflipy
   }
   decalgroup MyDecal
   {
       MyDecal1        1
       MyDecal2        1
   }
   generator CFlameMissile        MyDecal

Blood decals

The engine is hardcoded to use either the decalgroup BloodSplat or the decalgroup BloodSmear for blood splattered on walls. This depends on the damage inflicted:

  • Less than 15: One BloodSplat decal (about 60% chance of no decal at all if damage is less than 11);
  • Less than 25: Two BloodSplat decals;
  • 25 or more: Either three BloodSplat decals (nearly 91% chance) or one BloodSmear decal (about 9% chance).

These decals are then projected on nearby walls, if possible, according to the direction of the attack, slightly altered by random noise.

See also