get filenamebase FULLBASENAME get chunkID long get null long idstring "SPR0" endian little get dataStartOffset long get dataEndOffset long get textureCount short get keyFrameCount short get textureOffsetArrayStart long get keyFrameOffsetArrayStart long // lets get the textures first goto textureOffsetArrayStart for j = 0 < textureCount get null long get OFFSETS_TEXTURE[j] long next j // now for the keyframes goto keyFrameOffsetArrayStart for i = 0 < keyFrameCount get null long get OFFSET_KEY[i] long next i // now to extract it xmath trueFRAMECOUNT "keyFrameCount - 1" for i = 0 < keyFrameCount string filename = filenamebase if i == trueFRAMECOUNT math j = 0 math OFFSET = OFFSETS_TEXTURE[j] math SIZE = OFFSET_KEY[i] xmath TRUESIZE "OFFSET - SIZE" string filename += i string filename += ".keyframe" log filename SIZE TRUESIZE break endif math OFFSET = OFFSET_KEY[i] math i + 1 math SIZE = OFFSET_KEY[i] math SIZE - OFFSET math i - 1 string filename += i string filename += ".keyframe" log filename OFFSET SIZE next i // that was alot but now to get to the textures; basically the same thing as above xmath trueTextureCount "textureCount - 1" for j = 0 < textureCount string filename = filenamebase if j == trueTextureCount math OFFSET = OFFSETS_TEXTURE[j] get SIZE asize xmath TRUESIZE "SIZE - OFFSET" string filename += j string filename += ".tmx" log filename OFFSET TRUESIZE break endif math OFFSET = OFFSETS_TEXTURE[j] math j + 1 math SIZE = OFFSETS_TEXTURE[j] math SIZE - OFFSET math j - 1 string filename += j string filename += ".tmx" log filename OFFSET SIZE next j