# Game: TwelveSky & TwelveSky 2 (PC)
# by fatduck Jul2011
# script for QuickBMS
Luigi Auriemma
get PRENAME basename
get NUMRES long
savepos OFS_RES
for i = 1 to NUMRES
goto OFS_RES
get FLAG1 long
get USIZE long
if FLAG1 != 1
math FLAG1 -= USIZE
math FLAG1 *= -1
else
math FLAG1 -= 1
endif
get CSIZE long
savepos OFS_RES
set RESNAME PRENAME
string RESNAME += _
if i < 10
string RESNAME += "0"
endif
string RESNAME += i
string RESNAME += .mdl
if USIZE > 0
clog RESNAME OFS_RES CSIZE USIZE
endif
math OFS_RES += CSIZE
math OFS_RES += FLAG1
goto OFS_RES
get FLAG1 long
get USIZE long
if FLAG1 != 1
math FLAG1 -= USIZE
math FLAG1 *= -1
else
math FLAG1 -= 1
endif
get CSIZE long
savepos OFS_RES
set RESNAME PRENAME
string RESNAME += _
if i < 10
string RESNAME += "0"
endif
string RESNAME += i
string RESNAME += .dds
if USIZE > 0
clog RESNAME OFS_RES CSIZE USIZE
endif
math OFS_RES += CSIZE
math OFS_RES += FLAG1
next i