Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
ViolentBeetle

How do I delete unused patches from PNAMES in SLADE

Question

Every time I do it, the patches in textures themselves shift and everything gets messed up. I don't want to keep unused lumps just for compatibility sake.

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 2

So as you probably know, PNAMES is a simple list of patch names, and then TEXTURE1 and TEXTURE2 refer to patch by their index in that list.

 

E.g. if you have texture FOO that uses patch BAR, in fact it doesn't use patch BAR. It uses patch #1337, and it's PNAMES that tells that patch #1337 is BAR.

 

So what happens if you decide to manually clean things around? Like you delete the unused patch #420, and then the unused patch #69, and now patch #1337 is no longer BAR but BAZ. Texture FOO is now made out of BAZ instead of BAR. Or, worse, the PNAMES no longer has 1337 patches in the first place, so texture FOO is made of a non-existent patch and causes the game to crash.

 

Conclusion: do not edit PNAMES manually unless you really, really know what you are doing. Anything that changes the order of the patches, such as inserting or removing entries, will cause troubles.

 

So what can you do if you really want to clean it out of unused patches? Well, here's a simple trick, if they are truly unused.

  1. Make a duplicate of your wad.
  2. Entirely delete the PNAMES and TEXTUREx lumps from this duplicate. Just get rid of them!
  3. Create new PNAMES + TEXTURE1 lumps in it (imported from the IWAD, or even empty, according to your needs).
  4. Open the texture editors for your original wad (with its intact TEXTURE1 and PNAMES lumps) and for your duplicate (with the pristine new TEXTURE1 and PNAMES).
  5. Select all the relevant textures from your original wad, and copy them.
  6. Paste them in the duplicate's texture list.
  7. The duplicate's PNAMES lump is automatically updated with all the new PNAMES needed for your textures -- but unused PNAMES are not added.
  8. You now have a version of your wad with functional PNAMES+TEXTURE1 but without unused PNAMES. Save!

Share this post


Link to post
  • 0

Well, PNAMES is just a table/list of lump names to be used by TEXTUREx, and I'm pretty sure the TEXTUREx lumps rely on patch index numbers rather than the names of the patches, so deleting entries in the PNAMES table is going to mess that up. (Deleting the 2nd entry in the table will shift all following entries up one step, so every texture that uses any of those will become associated with incorrect patches?)

 

The PNAMES lump is just a couple of kilobytes in size, so cleaning it up seems like a lot of effort for basically no gain?

Share this post


Link to post
  • 0

Yes, PNAMES lump is only a couple kilobytes in size. Patches themselves however are not and at the very least they occupy precious space in my SLADE interface, and I think PrBoom+ tends to crash if there's no lump to match on in PNAMES.

Share this post


Link to post
  • 0

Here's a solution I came up with when I found deleting a pname seemed to scramble my textures.   Now I understand why it happens from Gez's answer.

 

This is my method without deleting and remaking the whole pnames entry.   Of course you should back up your work to another folder before making a major change.

 

Put a new texture graphic in your wad you want.   Go in pnames editing.   Make sure the one you want to get rid of has zero uses.  It seems you can delete from texture1 or texture2 at will as long as you leave a trash texture such as aastinky or aashitty as the first entry in texture1.  Select the  pname to get rid of and click the icon for "Change Patch."   Change the name to that of the graphic wad entry you added.   There, now go ahead and use that new pname in any texture and you can delete the graphic entry in the wad for the no longer existent pname.

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
×