Code: Select all
for i = 0
findloc OFFSET binary "\x01\x00\x00\x00\x48\x00\x00\x00"
math OFFSET + 8
goto OFFSET
get SIZE long
get SIZE long
get OFFSET longlong
math TMP = OFFSET
math TMP + SIZE
goto TMP
get WIDTH long
get LENGTH long
string NAME p "%d_%dx%d.raw" i WIDTH LENGTH
log NAME OFFSET SIZE
next i
Now I'm looking to build a .dds from the extracted .raw files. I've borrowed the following code from another script we use, and adjusted it for Tekken 7's format:
Code: Select all
for i = 0
get null long
get Tsize long
get Tsize longlong
get offset long //offset in uasset package
get null long
savepos Toffset // texture offset
// go to bottom
set footer = Toffset
math footer + Tsize
goto footer
get WIDTH long
get HEIGHT long
//building DDS file
//add blank DDS header to memory
set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x31\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
// Modify Header with HEIGHT and WIDTH
putVarChr MEMORY_FILE 0xC HEIGHT long
putVarChr MEMORY_FILE 0x10 WIDTH long
append
log MEMORY_FILE Toffset Tsize //append texture body to memory
append
if i = 0
string OUT P "%offset|hex%_%Name%.dds"
endif
math Tsize + 0x80 // append Header size
log OUT 0 Tsize MEMORY_FILE // output to file
next i
The only thing that's in that script, that i'm somewhat confident needs to be there is the Binary portion, which I've adjusted to follow format for tekken 7. Do I simply append this portion of the script to the previous& test if it'll work, is there something that's incorrect or missing, or should I try something different?
EDIT: Well the script doesn't seem to work. It's not creating any additional files. It only runs the 1st part of the script, which extracts the .raw files. I know that I've screwed up somewhere in the 2nd part.
set MEMORY_FILE binary - is correct
MEMORY_FILE 0xC HEIGHT long - is correct offset
MEMORY_FILE 0x10 WIDTH long - is correct offset