Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
40oz

Reducing Linedef numbers

Recommended Posts

Some vanilla doom actions that inherit properties of a neighboring sector have a hardcoded quirk in which they inherit the properties from the adjacent sector attached by the linedef with the lowest linedef number.

This is a lame and archaic way of handling things but Doom has been around for 20 years and its too late to fix that without a source port.

So suppose the sector you want to change the flat of isn't joined to the sector whose properties you want in to inherit by the linedef with the lowest number. As I understand it, every linedef you create gets a new number in ascending order, unless you've deleted linedefs, then new linedefs you create inherit those lost numbers before ascending again from where you left off.

So suppose you've already designed a complex map with many areas deleted and redesigned, and your sector thats supposed to inherit properties from an adjacent sector is still not grabbing properties from the sector you want it to. Is there some way to swap linedef numbers, or rotate a sector until the lowest linedef number is attached to the sector you want the properties from?

Share this post


Link to post

I'd also make a feature suggestion so that GZDoomBuilder can add some magic to move around some linedefs to make the whole thing easier.

MaxED seems to be quite receptive if sensible suggestions are being made that actually help editing.

Share this post


Link to post

Here is a little tutorial to swap 2 linedef indexes via a hex editor:

1. Look at your map in a map editor, and take note of the 2 linedef indexes you want to swap. Let's call them "i" and "j" (see step 5).
2. Close the wad in map editor and open the wad in SLADE3.
3. Export LINEDEFS lump belonging to the respective map into a file.
4. Open the file in a hex editor.
5. Find bytes at position from "i*14" to "i*14+13", and bytes at position from "j*14" to "j*14+13" (byte positions being numbered from "0" to "file size in bytes minus 1"). It's because linedef data are stored in LINEDEFS lump in sequential order (order of a particular linedef = its linedef index), with 14 bytes of data per linedef.
6. Swap these ranges of bytes (copy to somewhere else, paste back to the respective positions, be sure to not change size of the file).
7. Import this edited LINEDEFS file back into the wad to replace your map's LINEDEFS lump.

Share this post


Link to post

EdMap allows byte-wise editing of any map structure (other than nodes), making scifista's method slightly less impractical. This feature is one of the reasons I keep it around despite its map-corrupting bugs - be sure to make backups.

Share this post


Link to post
wesleyjohnson said:

Yadex has a menu command to swap two sector or linedef numbers.
Select two linedef, and hit Cntl-X.

I'm a little surprised that GZDoom Builder (daily reminder that it needs to change its friggin name) doesn't have this functionality too, but it should.

Share this post


Link to post

As I said, someone with interest should make a feature request. If something's not on a developer's radar it can't happen - plain and simple.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×