The Eternity Engine Definitive Code Pointer Reference -- 04/01/06

Return to the Eternity Engine Page

This is a reference that should be of value to DeHackEd patch authors. It exposes full information on all the code pointers available in the Eternity Engine, including both those from DOOM and those added in later ports. This reference attempts to expose all issues related to their use, as well as common pitfalls that lead to nasty crashes.


Changes
Return to Table of Contents


General Pitfall and Note on the Type Information:

General code pointers can be used in any frame that is not a player gun frame. Player Gun Frame code pointers cannot be used anywhere except in player gun frames. If a code pointer is used in the wrong type of frame, the internal function call stack will be corrupted, a "Segmentation Violation" error will most likely occur, and Cyberdemons will come to get you in the night. This isn't an Eternity bug or limitation. This problem would eventually manifest itself even in the original doom.exe, as a sudden, unexplained Venetian Blinds crash. There is additionally no way to type-check codepointers at run-time, so the user must accept this responsibility.

Note that as of Eternity Engine v3.31 public beta 3, there is a special codepointer called PlayerThunk, usable via EDF, which allows player gun frames to call a select set of monster codepointers by proxy.

Parameterized pointers take parameters via fields on the frame in which they are used. The code pointer parameter information will indicate what fields are used as parameters, and what parameter values mean.

Return to Table of Contents


Note on Damage Formulae:

Most damage in DOOM uses a random number, a modulus value, and a multiplier. In general, damage formulae will appear like this:

(rnd%modulus + 1) * multiplier

where rnd is a random number between 0 and 255, unless otherwise noted.

(rnd%modulus) + 1 results in a range of numbers from 1 to modulus, so if the following formula is shown:

(rnd%8 + 1) * 3

then the range of damage values is multiples of 3 from 3 to 24, since 1*3 = 3 and 8*3 = 24. Where damage values involve the summation of several random "dice" throws or other, more complicated formulae, the damage range will be shown explicitly for convenience.

Return to Table of Contents


Player Gun Frame Code Pointers


Weapon Maintenance Pointers
Return to Table of Contents


Player Attack Pointers
Return to Table of Contents


Miscellaneous Weapon Pointers
Return to Table of Contents


Parameterized Player Attack Pointers
Return to Table of Contents


Weapon Frame Scripting Pointers

General Notes for Weapon Frame Scripting Codepointers:

These pointers allow a degree of programmatic control over an weapon's behavior, and are therefore termed "frame scripting" codepointers.

Counter fields may have values from -32768 to 32767. Values above or below this range will wrap around.

Return to Table of Contents


General Code Pointers


Miscellaneous Pointers
Return to Table of Contents


Heretic Miscellaneous Pointers
Return to Table of Contents


Miscellaneous / Sound Pointers
Return to Table of Contents


Heretic Misc / Sound Pointers
Return to Table of Contents


Object Sound Pointers
Return to Table of Contents


AI Pointers
Return to Table of Contents


Heretic AI Pointers
Return to Table of Contents


AI Pointers with Walking Sounds
Return to Table of Contents


Blast Radius Attack Pointers
Return to Table of Contents


Heretic Blast Radius Attack Pointers
Return to Table of Contents


Monster Attack Pointers
Return to Table of Contents


Parameterized Monster Attacks
Return to Table of Contents


Heretic Monster Attack Pointers
Return to Table of Contents


Homing Missile Maintenance Pointers
Return to Table of Contents


Heretic Homing Missile Maintenance Pointers
Return to Table of Contents


Line of Sight Checking Pointers
Return to Table of Contents


Special Monster Death Effects
Return to Table of Contents


Heretic Special Monster Death Effects
Return to Table of Contents


Massacre Cheat Specials
Return to Table of Contents


Frame Scripting Pointers

General Notes for Frame Scripting Codepointers:

These pointers allow a degree of programmatic control over an object's behavior, and are therefore termed "frame scripting" codepointers. Note that some other codepointers utilize the Counter fields of a thing, and so using those pointers along with these will cause interference. Codepointer descriptions now make note of which Counter fields they utilize, so be sure to check for conflicts.

Counter fields may have values from -32768 to 32767. Values above or below this range will wrap around.

Return to Table of Contents


Small Scripting System

General Notes for Small Scripting Codepointers:

These codepointers allow execution of Small functions in either of the Gamescript or Levelscript VMs. See the Small Usage Documentation and the Small Function Reference for full information.


EDF-Related Pointers

These pointers interact directly with parts of the EDF system. For more information on EDF, see the EDF Documentation.

Return to Table of Contents