Editor number

From ZDoom Wiki
Jump to navigation Jump to search

The editor number aka DoomEdNum is a value between 1 and 32767 that is used by level editors to identify things placed in a map. Editor numbers should not be confused with SpawnID. SpawnIDs are largely unnecessary for custom actors.

When a DoomEdNum is needed

The only purpose of an editor number is to allow an actor to be visible in the level editor, so that the author could place it on their map. All actors that should be directly placeable on the map need a unique editor number.

However, actors that are only supposed to be dynamically spawnable (with functions like Spawn or similar in ACS or Spawn/A_SpawnItemEx and similar in ZScript/Decorate) do not need editor numbers since they're not placed on the map directly.

How to give your custom actor a DoomEdNum

Actors should be given editor numbers in the DoomEdNums block in MAPINFO.

In the DECORATE they can also be given directly in the code, at the end of an actor's declaration, but the MAPINFO method is highly recommended due to better visibility.

ZScript only allows giving editor numbers via MAPINFO. Internally, a value of -1 for the editor number means that the actor cannot be placed in a map.

In DECORATE, the editor number is, along with the SpawnID, filtered through the Game property to avoid conflicts.

How to pick a right DoomEdNum

DoomEdNums can only be given in the 1-32767 range. A large number of DoomEdNums is already used in GZDoom; they can be seen in the standard editor numbers list.

When giving a custom DoomEdNum to an actor, you must make sure that it does NOT use any of the existing DoomEdNums, unless you want to explicitly replace that original actor. (See Actor replacement for details on what replacement is and when it's needed). Most of the time you don't want that, so you need custom DoomEdNums that are not occupied by other actors.