DeHackEd / BEX Reference

From Eternity Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

DeHackEd with BOOM Extensions (BEX) is a form of text script for modifying various aspects of the DOOM engine. Originally, DeHackEd patches were used by the DeHackEd program to modify the DOOM.EXE file itself. Now, modern source ports provide alternative methods of use.

Eternity allows use of DeHackEd files via the -deh or -bex command-line parameter, via GFS files, and as a text lump called "DEHACKED" in wad files. Eternity can also specify up to two DeHackEd patches which are always added at start-up in its configuration file. Starting with Eternity Engine v3.31 public beta 5, DeHackEd/BEX files can also be included by EDF modules.

DeHackEd allows editing of things, frames, codepointers, ammo and weapon data, cheats, miscellaneous settings, and text strings. Through BEX and Eternity extensions, support has also been added for a cleaner form of text substitution, default level par times, a more powerful method of codepointer editing, helper thing type editing, and better support for substitution of sprite, sound, and music names.

DeHackEd does NOT support the addition or deletion of any of these elements, however. It is limited to the number and order of entries as they exist in the source port. For information on how Eternity addresses this problem via the EDF system, see the EDF Documentation.

NOTES:

  • DeHackEd lumps are always loaded after EDF has been fully loaded.
  • Heretic HHE patches are not supported and will not be. Make sure to provide equivalent EMAPINFO (or UMAPINFO) and EDF equivalents for whatever HHE patching you want in your mod.
Back to Eternity Engine
  • This section incorporates text from the HTML Eternity documentation.

General Syntax

White-space, empty lines, and unrecognized tokens are ignored outside of any block, and the DeHackEd parser is in general very forgiving.

Comments can be provided for your own benefit, or for that of other editors. Comments start with a pound sign (#) and extend to the end of the line. Example:

# This is a comment

Note that comments are not allowed within some blocks, including several of the BEX extension blocks. It is best to keep all comments outside of blocks for this reason.

It is common for this header to appear in DeHackEd files which pre-date the DOOM source release:

Patch File for DeHackEd v3.0

# Note: Use the pound sign ('#') to start comment lines.

Doom version = 21
Patch format = 6

However, none of this information is needed or used by Eternity in any way, and it is discarded as unrecognized text. You do not need to include any header information in your own files. Note that the patch version information is important for old patches in that it will tell you whether or not Eternity can use the file. Patches of format other than 6 are not guaranteed to work, and Eternity does NOT support the older, obsolete binary patch format.

BEX Extension: INCLUDE Directive

To include a DEH or BEX file in another one, put one or more of the following lines in your BEX file:

  INCLUDE filename
  INCLUDE NOTEXT filename

Filename must be specified in full, including a path if it's not going to be in the current directory, and including its .deh or .bex extension. It is better by far to ship a file completely self-contained, but you can use this during testing and development, or to adjust existing patches for your own use.

The NOTEXT directive will cause Eternity to skip any DeHackEd-style text blocks in the included file, with the assumption that you're doing something else in your main BEX file instead.

You may not nest include files (one include file can't include another). In addition, DEHACKED lumps in wads cannot use INCLUDE directives in any form.

Thing Block

See DeHackEd / BEX Reference/Thing Block

Frame Block

See DeHackEd / BEX Reference/Frame Block

Sound Block

See DeHackEd / BEX Reference/Sound Block

Ammo Block

See DeHackEd / BEX Reference/Ammo Block

Weapon Block

See DeHackEd / BEX Reference/Weapon Block

Cheat Block

See DeHackEd / BEX Reference/Cheat Block

Misc Block

See DeHackEd / BEX Reference/Misc Block

BEX Extension: [STRINGS] Block

See DeHackEd / BEX Reference/BEX Extension: STRINGS Block

BEX Extension: [PARS] Block

See DeHackEd / BEX Reference/BEX Extension: PARS Block

BEX Extension: [CODEPTR] Block

See DeHackEd / BEX Reference/BEX Extension: CODEPTR Block

Eternity Extension: [HELPER] Block

See DeHackEd / BEX Reference/Eternity Extension: HELPER Block

Eternity Extension: [SPRITES] Block

See DeHackEd / BEX Reference/Eternity Extension: SPRITES Block

Eternity Extension: [SOUNDS] Block

See DeHackEd / BEX Reference/Eternity Extension: SOUNDS Block

Eternity Extension: [MUSIC] Block

See DeHackEd / BEX Reference/Eternity Extension: MUSIC Block

BEX String Mnemonics Table

See DeHackEd / BEX Reference/BEX String Mnemonics Table

Sound Table

See DeHackEd / BEX Reference/Sound Table