Quasar
Moderator

Posts: 2202
Registered: 08-00 |
Ohhh, I see ^_^
But yeah, the DeHackEd nums requested by all parameterized codepointers are the same ones you define via EDF. Before EDF, the DeHackEd numbers were determined solely by the order of the static definitions inside the EXE. Now that they're in EDF, the entities store their DEH number, and DEH numbers are looked up in a hash table and thus have nothing to do with order.
The fact the original entities as used by DOOM are in the same order as their DeHackEd numbers is just a consequence of the way I converted info.c into the various EDF modules using a program. They could be rearranged by hand into any order and would still work ;)
Keeping this in mind, you see that you can assign your own stuff any arbitrary DEH number. You don't have to use them in order or anything else special. The only reason you have to use ones greater than 10000 is that I have to reserve some space for the source port to use for new stuff I add -- if EDF patches used DEH nums less than 10000 and then I decided to use one myself, the patches would become unusable due to DeHackEd number conflicts ;)
Basically, think of the thingtype mnemonic and DeHackEd num as being two separate ids for the thingtype, both on equal footing. Sort of like how people call you by your name, and computers call you by an id number (ex: Social Security number). Things in the game engine (including parameterized codepointers) that must call things by a number for one reason or another (typically compatibility concerns or data storage limitations) always use the DeHackEd number.
Things with a -1 DEH num simply are never added to the hash table used to lookup things/frames/sounds by number. This is why such objects simply cannot be used with those features.
One other note: The number space for DeHackEd numbers is separate for frames, things, and sounds. You probably knew that already, though, since there's a frame #1, sound #1, and thing #1, but it bears stating I suppose. You can have a frame 10000 and a thing 10000, for example.
|