Jump to content
  • 0

compiling to .PK3 with Slade3 - suppress full path?


smeghammer

Question

Hi Y'all - I'm building a .PK3 that plays fine uncompressed (dropping the folder onto gzdoom shortcut). I want to compress to .pk3 in slade3 (>archive>build archive). This compresses OK to a .PK3 file. However, the paths inside the archive are from the filesystem root, rather than from the build root:

 

SLADE3 - uncompressed filesystem view of project:

image.png.70d0dc3de59cfa61a1556c6dc5e44088.png

 

FILESYSTEM:

image.png.b384ae7bd9090c205364008b37d4ec13.png

 

Slade3 compression result - note the path in the archive is the full filesystem path:

image.png.63c91ffbbb963a16e46a648e6755bfc2.png

 

This obviously doesn't play. I can't see any obvious option in Slade3 to control this, other than changing the extension.

 

I could just use an archiver and compress to .ZIP from the project root and change the extension to .pk3 (and this does play fine), but I read somewhere that Slade3 does something a little different and doing this may result in invalid .PK3 files...

 

 

Any suggestions?

 

 

 

 

 

Edited by smeghammer

Share this post


Link to post

7 answers to this question

Recommended Posts

  • 1
21 minutes ago, smeghammer said:

Slade3 compression result - note the path in the archive is the full filesystem path:

This is really weird.

 

What happens if you close and reopen it? Do you get a "Game" top directory in the archive? Because then you could navigate down to src, select all, cut, navigate back to top level, paste, and delete the Game directory.

 

 

22 minutes ago, smeghammer said:

I could just use an archiver and compress to .ZIP from the project root and change the extension to .pk3 (and this does play fine), but I read somewhere that Slade3 does something a little different and doing this may result in invalid .PK3 files... 

This is also really weird. A pk3 is a zip file.

 

However, SLADE uses wxWidget's implementation of a zip reader/writer and this implementation is not complete -- it only handles the STORE (0) and DEFLATE (8) methods. There are plenty others, so using other tools may result in archives that SLADE can't handle. But that's a limitation of the tool, the archive is still valid as far as GZDoom is concerned.

Share this post


Link to post
  • 0
1 minute ago, Gez said:

This is also really weird. A pk3 is a zip file.

 

Thanks @Gez - that's what I thought.

 

However, this:
 

2 minutes ago, Gez said:

using other tools may result in archives that SLADE can't handle. But that's a limitation of the tool, the archive is still valid as far as GZDoom is concerned.

 

is actually good news because it should be OK for me to develop the uncompressed project in Slade and compress with another tool as that will result in an archive that gzdoom understands.

Share this post


Link to post
  • 0
13 minutes ago, Gez said:

What happens if you close and reopen it? Do you get a "Game" top directory in the archive? Because then you could navigate down to src, select all, cut, navigate back to top level, paste, and delete the Game directory.

 

Hmm. Closing and re-opening then cut/paste the contents to the root seems to work OK. Still very odd that the archive includes that full path at all. 

 

FYI it's the latest Windows build of Slade - I'll have  crack with the Ubuntu build.

 

I have a workaround that works. Closing...

Edited by smeghammer

Share this post


Link to post
  • 0

Internally, a zip file does not have folders -- it's just as flat as a wad file. However, it has very long file names... And each file name contains the full path (relative to archive root).

SLADE lets you do things with zip files that the format technically supports but that normal zip managers do not, such as having several files with identical names, but you can also rename files. Try changing a file's name from WHATEVER.TXT to WHAT\EVER.TXT, save, re-open, and surprise, your file has disappeared -- instead you have a folder named WHAT that contains a file named EVER.TXT...

Share this post


Link to post
  • 0

So I tested the exact same process of menu '>archive>build archive' on Slade3 on Ubuntu (18.04) and - surprise surprise - it works as I expected and I end up with a correctly structured .pk3 file.

 

 

1 hour ago, Gez said:

Internally, a zip file does not have folders -- it's just as flat as a wad file. However, it has very long file names... And each file name contains the full path (relative to archive root).

SLADE lets you do things with zip files that the format technically supports but that normal zip managers do not, such as having several files with identical names, but you can also rename files. Try changing a file's name from WHATEVER.TXT to WHAT\EVER.TXT, save, re-open, and surprise, your file has disappeared -- instead you have a folder named WHAT that contains a file named EVER.TXT...

 

I did not know that - interesting info. That actually suggests that Slade on Windows doesn't process the path correctly and perhaps sees the full path prior to the Slade-managed project as a long filename? - I've come across issues with Windows path separators before in other contexts - obviously a backslash in all sane operating systems is an escape character...

 

Yet another reason to not use Windoze.

Edited by smeghammer

Share this post


Link to post
  • 0

I could have used WHAT/EVER.TXT in my example, same result. Zip software usually treat both types of slash separators identically; otherwise you couldn't handle a zip archive made on DOS or Windows in a Unix system and vice-versa.

Share this post


Link to post
  • 0
On 12/22/2020 at 2:06 PM, Gez said:

Internally, a zip file does not have folders -- it's just as flat as a wad file. However, it has very long file names... And each file name contains the full path (relative to archive root).

SLADE lets you do things with zip files that the format technically supports but that normal zip managers do not, such as having several files with identical names, but you can also rename files. Try changing a file's name from WHATEVER.TXT to WHAT\EVER.TXT, save, re-open, and surprise, your file has disappeared -- instead you have a folder named WHAT that contains a file named EVER.TXT...

 

Just tried this. I see what you mean - Windows shell and WinRAR catch slashes if you try, but 7Zip allows it, and sure enough I get a folder...

 

You learn something new every day!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...