DeHackEd / BEX Reference
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.
NOTE: DeHackEd lumps are always loaded after EDF has been fully loaded.
- Back to Eternity Engine
- This section incorporates text from the HTML Eternity documentation.
- 1 General Syntax
- 2 BEX Extension: INCLUDE Directive
- 3 Thing Block
- 4 Frame Block
- 5 Sound Block
- 6 Ammo Block
- 7 Weapon Block
- 8 Cheat Block
- 9 Misc Block
- 10 BEX Extension: [STRINGS] Block
- 11 BEX Extension: [PARS] Block
- 12 BEX Extension: [CODEPTR] Block
- 13 Eternity Extension: [HELPER] Block
- 14 Eternity Extension: [SPRITES] Block
- 15 Eternity Extension: [SOUNDS] Block
- 16 Eternity Extension: [MUSIC] Block
- 17 BEX String Mnemonics Table
- 18 Sound Table
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.