This is an old revision of the document!
DeHackEd is an ancient and antiquated means to edit the behavior of items and monsters in Doom. It's severely limited, but most source ports are fully or mostly compatible with it all the way down to vanilla (if you hack the vanilla exe that is, hence the name deHACKed).
The gist is this - Doom monsters, weapons, and items (“Things”) update their behavior every tic of game logic. 35 tics per second. So if you make a rabbit thing and want it to jump up every 2 seconds you set it's jumping “State” to happen every 70 tics. Every state has a set amount of time it runs for before moving onto the next state. With dehacked you can tell the thing what order to run it's states in, and for how long, and you can attach “Actions” to those states. Like firing a fireball or whatever.
The info you need to specify for each state would be:
Sprite
Animation frame of that sprite
The next state this object goes to
Duration of this state in tics (35 per second)
Action this state will execute (fireball, chase, die, etc)
Only certain states can have actions, and once you've used those up that's it. You can't add more with vanilla DeHackEd. Also if you try to use an action state with no action it crashes in vanilla.
States can be changed when an event occurs on the object as well. For example, when a monster in doom is pained by chaingun fire, it enters it's “pain” state. Or if it dies it enters it's death state, which runs through it's death animation, each frame of that animation being a subsequent state itself.
Certain features are hardcoded to certain things. You can't make an imp drop health, for instance. But you could replace all the information of a former human with the information of an imp, and replace all the information of a clip (that the former human normally drops) with the information of a medkit. Then you have an imp that drops medkits. But you lose your former human. You could replace the original imp with the former humans info/logic, but it still wouldn't drop clips.
Speaking of pickups: Those things are hardcoded to give you an item based on the first 4 characters of their sprite name. So an object with the sprite “CLIPA” will give you a clip. And so will “CLIPB”, and “CLIPC” etc. So you could have some variety in your pickups visually if you want. The only thing you can change in regard to ammo pickups really is how much it gives you and what your total ammo capacity is. Same with health. I'm sure there are limitations on this, but I don't have much experience with it.
WIP - more later.