Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Zork Nemesis - zfs file

Featured Replies

  • Author
  • Localization

ghylard, posted Thu Jul 15, 2021 3:03 pm (65210)


There is a patch to add subtitles to the English version of this game.
https://www.thezorklibrary.com/installguides/znpatch.zip
I would like to be able to adapt this patch to allow subtitles to be added to this game in other languages.
The subtitles are included in the subpatch.zfs file.
A bms script https://github.com/AlexKimov/heavygear-file-formats/blob/master/scripts/zfs.bms allows you to decompile it into many files (sub, txt, etc...=)
The subtitles seem to be in some of the txt files but these files are not directly usable in a text editor.
Image
Is it possible to properly extract the text from these txt files, edit it and then reinsert it?
  • Author
  • Localization

swuforce, posted Mon Jul 19, 2021 2:12 am (65253)


Although the repacked file is different, the extracted ones are similar, so you can give a try to this.
Extract the files to a folder named "unpacked"
Code:
quickbms zfs.bms subpatch.zfs unpacked

Use the attached modified script to repack.
Code:
quickbms zfs_repack.bms subpatch.zfs .

Code:
GoTo 12
get FILECOUNT long
get COUNT long
GoTo 28

XMath SECTION_COUNT "COUNT/FILECOUNT 1"
XMath REMAINDER "COUNT % FILECOUNT"

savepos OFFSET
log MEMORY_FILE 0 OFFSET

for k = 0 < SECTION_COUNT
   get HEADER_POS long
   get HPOS asize MEMORY_FILE
   append
   put HEADER_POS long MEMORY_FILE
   append
   XMath NUMBER "k 1"
   if SECTION_COUNT == NUMBER
      math FILECOUNT = REMAINDER
   endif
   xmath OFFSET "OFFSET 4 FILECOUNT * 36"
   log MEMORY_FILE2 0 0
   for i = 0 < FILECOUNT
      GetDString FILENAME 16
      get POS long
      get unk1 long
      get SIZE long
      get unk2 long
      get unk3 long
      string NAME p "unpacked\%s" FILENAME
      open FDSE NAME 1
      get SIZE asize 1
      append
      PutDString FILENAME 16 MEMORY_FILE
      put OFFSET long MEMORY_FILE
      put unk1 long MEMORY_FILE
      put SIZE long MEMORY_FILE
      put unk2 long MEMORY_FILE
      put unk3 long MEMORY_FILE
      log MEMORY_FILE2 0 SIZE 1
      append
      math OFFSET = SIZE
   next i
   get SIZE asize MEMORY_FILE2
   append
   log MEMORY_FILE 0 SIZE MEMORY_FILE2
   append
   get SIZE asize MEMORY_FILE
   putVarChr MEMORY_FILE HPOS SIZE long
   GoTo HEADER_POS   
next k

get SIZE asize MEMORY_FILE
log "REPACKED.zfs" 0 SIZE MEMORY_FILE
  • Author
  • Localization

ghylard, posted Mon Jul 19, 2021 5:41 am (65255)


Thank you for this script which allows me to recompile the zfs file. :D
Unfortunately, I won't be able to use it if I can't modify the files containing the game's subtitles beforehand. :(
Let's take for example the case of the file tb2el11c.txt which contains the text
Quote:

Finally someone has come.
You've got to help us.
They're in the temple.

The file opened in Notepad looks like this: Each character is separated by NUL
Image
Editing is therefore impossible to achieve with the text in this form.
  • Author
  • Localization

swuforce, posted Mon Jul 19, 2021 12:46 pm (65259)


Open the file with hex editor. Replace 0D0A to 0D000A, then edit as unicode text.
After edit replace back.
  • Author
  • Localization

ghylard, posted Mon Jul 19, 2021 3:37 pm (65261)


swuforce wrote:
Open the file with hex editor. Replace 0D0A to 0D000A, then edit as unicode text.
After edit replace back.


Thank you for this tip!
It works perfectly!!! :D :D :D
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.