Thanks, aluigi, the script works great.
I very want to translate the lego game(batman1,Indiana Jones1&2,etc.) to my language, although I am still working on the *.fnt(charmap).
But I couldn't test because I don't know how to reimport them.
Could you take a look when you have time, please?
the script can't be used for reimporting the files because the file format uses chunks.
have you tried if the game can use the extracted files without the original archive?
aluigi wrote:the script can't be used for reimporting the files because the file format uses chunks.
have you tried if the game can use the extracted files without the original archive?
# Traveller's Tales games DAT files extractor (script 0.5)
# LEGO Harry Potter
# LEGO Star Wars III
# LEGO Pirates of the Caribbean
#
# this script is expansion to the original script from aluigi
# original script for QuickBMS http://aluigi.org/papers.htm#quickbms
comtype lz2k
get INFO_OFF long
if INFO_OFF & 0x80000000
math INFO_OFF ^= 0xffffffff
math INFO_OFF <<= 8
math INFO_OFF += 0x100
endif
get INFO_SIZE long
log MEMORY_FILE INFO_OFF INFO_SIZE
get TYPE_BOH long MEMORY_FILE
get FILES long MEMORY_FILE
savepos INFO_OFF MEMORY_FILE
math TMP = FILES
math TMP *= 16
math NAME_INFO = INFO_OFF
math NAME_INFO += TMP
goto NAME_INFO MEMORY_FILE
get NAMES long MEMORY_FILE
savepos NAME_INFO MEMORY_FILE
math TMP = NAMES
math TMP *= 8
math NAME_OFF = NAME_INFO
math NAME_OFF += TMP
goto NAME_OFF MEMORY_FILE
get NAMECRC_OFF long MEMORY_FILE
savepos NAME_OFF MEMORY_FILE
math NAMECRC_OFF += NAME_OFF
goto NAMECRC_OFF MEMORY_FILE
for i = 0 < FILES
get CRC long MEMORY_FILE
putarray 0 i CRC
next i
if TYPE_BOH <= -2
get DUMMY1 long MEMORY_FILE
get DUMMY2 long MEMORY_FILE
if DUMMY1 > 0
print "Error: not implemented yet"
cleanexit
endif
endif
# print "files: %FILES%"
# print "names: %NAMES%"
# print "info_off: %INFO_OFF%"
# print "info_size: %INFO_SIZE%"
# print "name_info: %NAME_INFO%"
# print "name_off: %NAME_OFF%"
# print "namecrc_off: %NAMECRC_OFF%"
set NAMEZ long 0
set FULLNAME string ""
set FULLPATH string ""
for i = 0 < FILES
do
goto NAME_INFO MEMORY_FILE
get NEXT short MEMORY_FILE
get PREV short MEMORY_FILE
get OFF long MEMORY_FILE
savepos NAME_INFO MEMORY_FILE
math OFF += NAME_OFF
goto OFF MEMORY_FILE
get NAME string MEMORY_FILE
if NEXT & 0x8000 # 16bit sign conversion
math NEXT |= 0xffff0000
endif
if PREV != 0
getarray FULLPATH 1 PREV
endif
putarray 1 NAMEZ FULLPATH
if NEXT > 0 # folder
if NAME != ""
string FULLPATH += NAME
string FULLPATH += \
endif
else #file
endif
math NAMEZ += 1
while NEXT > 0
set FULLNAME string FULLPATH
string FULLNAME += NAME
math CRC = 0x811c9dc5
strlen NAMESZ FULLNAME
for j = 0 < NAMESZ
getvarchr CHR FULLNAME j
if CHR >= 0x61
if CHR <= 0x7a
math CHR -= 0x20
endif
endif
math CRC ^= CHR
math CRC *= 0x199933
next j
for j = 0 < FILES
getarray TMP 0 j
if CRC == TMP
break
endif
next j
if j >= FILES
print "Alert: the crc of the file %FULLNAME% has not been found, it can't be extracted!"
#cleanexit
# all wrongs!
math j = i
#math TMP = NEXT
#math j = 0
#math j -= NEXT
#math j -= 1
endif
math TMP = j
math TMP *= 16
math TMP += INFO_OFF
goto TMP MEMORY_FILE
get OFFSET long MEMORY_FILE
math OFFSET <<= 8
get ZSIZE long MEMORY_FILE
get SIZE long MEMORY_FILE
get PACKED long MEMORY_FILE
goto OFFSET
getdstring SIGN 4
if SIGN == "LZ2K"
set PACKED long 2
else
set PACKED long 0
endif
if PACKED & 2
callfunction UNLZ2K
log FULLNAME 0 SIZE MEMORY_FILE2
else
if SIZE != 0
if ZSIZE != 0
if SIZE != ZSIZE
print "SIZE (%SIZE%) and ZSIZE (%ZSIZE%) differ, contact me"
cleanexit
endif
endif
endif
log FULLNAME OFFSET SIZE
endif
next i
startfunction UNLZ2K
putvarchr MEMORY_FILE2 SIZE 0
log MEMORY_FILE2 0 0
append
for TMPSZ = 0 < ZSIZE
goto OFFSET
getdstring SIGN 4
if SIGN != "LZ2K"
print "Error: the signature at offset %OFFSET% (%SIGN%) is not LZ2K, contact me"
cleanexit
endif
get LZ2K_SIZE long
get LZ2K_ZSIZE long
savepos OFFSET
if LZ2K_ZSIZE == LZ2K_SIZE
log MEMORY_FILE2 OFFSET LZ2K_SIZE
else
clog MEMORY_FILE2 OFFSET LZ2K_ZSIZE LZ2K_SIZE
endif
math OFFSET += LZ2K_ZSIZE
savepos TMP MEMORY_FILE2
math TMPSZ += 12
math TMPSZ += LZ2K_ZSIZE
next
append
endfunction
I used Traveller's Tales games DAT files extractor (script 0.5), Export and ReImport works Perfectly with .DAT on PC, but with PS3 version, i have some problem:
Those of the PS3 don't work because they use something on the last chunk of each file.
But you can modify the script to skip the compressed files and so extracting all the others (mainly audio, video and music)
If you check the latest version of ttgames.bms I wrote this information in the notes at the beginning:
# Note that the script may not work with the compressed files of
# Lego Movie for PS3, in case of crashes or other issues you can
# extract only the non compressed files by setting
# EXTRACT_COMPRESSED to 0.
aluigi wrote:Those of the PS3 don't work because they use something on the last chunk of each file.
But you can modify the script to skip the compressed files and so extracting all the others (mainly audio, video and music)
If you check the latest version of ttgames.bms I wrote this information in the notes at the beginning:
# Note that the script may not work with the compressed files of
# Lego Movie for PS3, in case of crashes or other issues you can
# extract only the non compressed files by setting
# EXTRACT_COMPRESSED to 0.
Thanks! But I'm not coder. Thank you very much again,
aluigi wrote:the script can't be used for reimporting the files because the file format uses chunks.
have you tried if the game can use the extracted files without the original archive?
Can you explain this?
Is this something that we need better quickbms?