I know quickbms doesn't support repacking but I want to learn how to make a repack script. (Use Open FDDE or.. well, I'm not sure.) Is there a tutorial for it?
# Gunpoint # script for QuickBMS http://quickbms.aluigi.org
get BASE_OFF long get FILES long for i = 0 < FILES get NAMESZ long getdstring NAME NAMESZ get SIZE long get OFFSET long math OFFSET + BASE_OFF log NAME OFFSET SIZE next i
# placeholders put 0 long MEMORY_FILE # BASE_OFF put 0 long MEMORY_FILE # FILES
for FILES = 0
# copy&paste code scanDir "." NAME SIZE # get the file from the current folder if NAME == "" # no other files are available so append index break endif open "." NAME string NAME << 2 # remove ".\" if NAME != OUTPUT_ARCHIVE # in case the archive already exists # end of copy&paste code
# add information to the index table string NAME R \ / strlen NAMESZ NAME put NAMESZ long MEMORY_FILE putdstring NAME NAMESZ MEMORY_FILE put SIZE long MEMORY_FILE get OFFSET asize MEMORY_FILE2 put OFFSET long MEMORY_FILE
# add the file to the archive append log MEMORY_FILE2 0 SIZE append math FILES + 1 endif
next
get BASE_OFF asize MEMORY_FILE putvarchr MEMORY_FILE 0 BASE_OFF long # BASE_OFF putvarchr MEMORY_FILE 4 FILES long # FILES
get SIZE asize MEMORY_FILE log OUTPUT_ARCHIVE 0 SIZE MEMORY_FILE
I opted for the solution of using the output folder as also input folder where retrieving the files to add. The input file is useless so you can just select the same script, example: quickbms script.bms script.bms input_output_folder
aluigi wrote:There are tons of ways for creating a rebuilder script with quickbms, just in case the reimport feature is not enough.
I opted for the solution of using the output folder as also input folder where retrieving the files to add. The input file is useless so you can just select the same script, example: quickbms script.bms script.bms input_output_folder
Thank you! Great works! I have a question though. Would it be possible to write /(2F) instead of \(5C)? For example, the original file name is 'GL/Assets/GL/splash.png.phyre', not 'GL\Assets\GL\splash.png.phyre'. I found all of the data files was written in this format. It doesn't matter when unpacking or repacking but it causes error when the game read the file.
Hmm.. For example, another game's file path is also written in this case; 'cache/itf_cooked/pc32/enginedata/textures/'. When I change all of \(5C) to /(2F) then the game works well, but it is hard to edit manually all of \(5C) to /(2F).