Do you have a meta file from before the 256k was added? Does it have any missing entries?
Wtih regards to the PAZ files - in theory the META file is not required for the game to run. It could (but probably doesnt) scan the header block of every PAZ file in the folder at startup to build the lookup tree. I say probably doesnt because even breaking the file block list in the beginning of the PAZ file, the stuff inside loads fine.
That said, looking at the BMS script, the file strings come after the file blocks. It calcs the offset for the strings block, bulk reads them, then continues from where it left off and reads the fileblocks.
Yes I have. They are included in Meta Injector v1.0 to v1.4 in the "patcher_resources/pre-patch meta files".
And yes, they have all entries from all the files, including the ones we don't find in the current meta file.
Something happened in the patch that broke the script and made some files go missing.
About the script.
Yes, it bulk reads it, but it bulk reads the file strings, and then procceeds to the fileblocks
savepos OFFSET
xmath OFFSET "OFFSET + (PAZ_FILES * 4 * 6)"
This is OFFSET += FILES_COUNT * (4 * 6)
OFFSET is used to pre-alocate the size of the "vector" MEMORY_FILE later with the right amount of bytes. Since each File Block has 6 long ints and each long int has 4 bytes, that's why the 6 * 4
Then e have
log MEMORY_FILE OFFSET NAMES_SIZE
NAMES_SIZE contains the total length of the strings part.
this saves the next "NAMES_SIZE" bytes in the MEMORY_FILE file (like a vector), which has OFFSET positions.
Now, MEMORY_FILE has stuff like this:
"folder_name1/\0file_name1\0"
"folder_name2/\0file_name2\0"
....
math i = 0
for TMP = 0 < NAMES_SIZE
get NAME string MEMORY_FILE
if NAME == ""
break
endif
putarray 0 i NAME
savepos TMP MEMORY_FILE
next i
So now, "get NAME string MEMORY_FILE" retrieves "folder_name1/\0" and saves it to the array "NAME"
next we have "savepos TMP MEMORY_FILE" which saves the byte right after the '\0' at the end of the string ""folder_name1/\0", which is where the second part of the string ("file_name1\0") starts.
Notice that this current part, doesn't move the file pointer at all, it stays at the same place, right after the strings end ( log MEMORY_FILE OFFSET NAMES_SIZE was the last thing to move the file pointer)
So now, the array NAMES have the folder names and the array TMP has the file names.
now the part
for i = 0 < PAZ_FILES
get HASH long
get FOLDER_NUM long
get FILE_NUM long
get OFFSET long
get ZSIZE long
get SIZE long
getarray NAME 0 FOLDER_NUM
getarray TMP 0 FILE_NUM
string NAME += TMP
math TMP_SIZE = ZSIZE
callfunction SET_ENCRYPTION 1
if SIZE > ZSIZE
clog NAME OFFSET ZSIZE SIZE
else # yeah SIZE is < ZSIZE
log NAME OFFSET SIZE
endif
encryption "" ""
next i
Reads the File Blocks and then extracts the files, with the log command.
Notice that no "goto" was used, that means that the File Blocks are the last thing that the PAZ file contains.
This is different from what happens in the .meta file script:
....
savepos OFFSET # Position right after getting the total_files
xmath TMP "OFFSET + (FILES * 0x1c)"
# 0x1c is 28 in dec, which is the size of a File Block
goto TMP
# Skips All the file blocks (so they are what's comming next)
..... colects folder names and file names.....
goto OFFSET # Goes back to where the file blocks definition starts
for i = 0 < FILES
get HASH long
get FOLDER_NUM long # 48c
get FILE_NUM long # 9ea5 e18d
get PAZ_NUM long # 9ec c20
get OFFSET long # 4603c 261cc
get ZSIZE long # 4a70 1970
get SIZE long # 5f13 2000
...