Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Buffy The Vampire Slayer (XBOX) pak file

Featured Replies

  • Author
  • Localization

medievil, posted Sat Apr 28, 2018 5:04 am (34442)


Acewell wrote:
here is Noesis python script to open the mtx texture samples :D
tex_BuffytheVampireSlayer_Xbox_mtx.zip
supports dxt1, dxt5 and rgba8888, top level mip only

try as I may, I can not get python to install noesis...needs javabridge and it will not compile/install... have 32bit java 8 (And sdk) and 64bit java 10 (And sdk, no 32bit variant to install) and no matter what I get "Failed to find the Java Development Kit. Please download and install the Oracle JDK 1.6 or later")
RuntimeError: Failed to find the Java Development Kit. Please download and install the Oracle JDK 1.6 or later


***EDIT***
Ok fixed that error, had to edit the script, it was looking in the wrong registry key \\software\JavaSoft\Java Development Kit should have been looking in \\software\JavaSoft\JDK
  • Replies 92
  • Views 10
  • Created
  • Last Reply

Top Posters In This Topic

  • Author
  • Localization

Acewell, posted Sat Apr 28, 2018 5:19 am (34443)


nothing to install/compile, download Noesis and extract it some place then move the python
script to Noesis\plugins\python folder, then you can launch Noesis and open mtx files. :)

http://richwhitehouse.com/index.php?con ... project=91

this has nothing to do with Java by the way, i've no idea what you got going on there. :)
  • Author
  • Localization

medievil, posted Sat Apr 28, 2018 5:31 am (34444)


Acewell wrote:
nothing to install/compile, download Noesis and extract it some place then move the python
script to Noesis\plugins\python folder, then you can launch Noesis and open mtx files. :)

http://richwhitehouse.com/index.php?con ... project=91

this has nothing to do with Java by the way, i've no idea what you got going on there. :)



alrighty... not the same noesis for python I found through google...lol
at least I got it all lined out....python installed, and working..lol
was wondering what data mining had to do with it..lol
http://noesis-python.readthedocs.io/en/latest/

Is it possible with noesis to batch convert a whole folder (since they are individual textures) and save them as dds files?if so then the whole texture thing will be solved cause I can then groupe them into their proper multitex files with the mtx packer bms script.. that will be a step closer to getting this to run on the INDY slayer PC engine (next step, extract the audio from the RPE files, convert them to standard wave and repack them into RPE)

***EDIT***
Nevermind, just found the batch option, works fast!!
  • Author
  • Localization

medievil, posted Sat Apr 28, 2018 1:05 pm (34457)


found a bug, either in the buffy pak bms or the main quickbms if you skip or overwrite same files(cause the pak files contain duplicates, apparently on xbox they just load the pak file in memory for the level) you will eventually error out:
- error in src\extra\xalloc.c line 618: xdbg_malloc()

Error: memory allocation problem
File exists
  • Author
  • Localization

medievil, posted Sat Apr 28, 2018 3:16 pm (34461)


ok... new issue....music files are not right at all...no header, see this near the top
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000160  1C 00 57 00 4D 00 46 00 53 00 44 00 4B 00 56 00  ..W.M.F.S.D.K.V.
00000170  65 00 72 00 73 00 69 00 6F 00 6E 00 00 00 00 00  e.r.s.i.o.n.....
00000180  1A 00 37 00 2E 00 30 00 31 00 2E 00 30 00 30 00  ..7...0.1...0.0.
00000190  2E 00 33 00 30 00 35 00 35 00 00 00 1A 00 57 00  ..3.0.5.5.....W.
000001A0  4D 00 46 00 53 00 44 00 4B 00 4E 00 65 00 65 00  M.F.S.D.K.N.e.e.
000001B0  64 00 65 00 64 00 00 00 00 00 16 00 30 00 2E 00  d.e.d.......0...
000001C0  30 00 2E 00 30 00 2E 00 30 00 30 00 30 00 30 00  0...0...0.0.0.0.
000001D0  00 00 40 52 D1 86 1D 31 D0 11 A3 A4 00 A0 C9 03  ..@RN?.1?.??.?E.
000001E0  48 F6 96 00 00 00 00 00 00 00 41 52 D1 86 1D 31  Ho-.......ARN?.1
000001F0  D0 11 A3 A4 00 A0 C9 03 48 F6 01 00 00 00 02 00  ?.??.?E.Ho......
00000200  17 00 57 00 69 00 6E 00 64 00 6F 00 77 00 73 00  ..W.i.n.d.o.w.s.
00000210  20 00 4D 00 65 00 64 00 69 00 61 00 20 00 41 00   .M.e.d.i.a. .A.
00000220  75 00 64 00 69 00 6F 00 20 00 56 00 38 00 00 00  u.d.i.o. .V.8...
00000230  19 00 31 00 32 00 38 00 20 00 6B 00 62 00 70 00  ..1.2.8. .k.b.p.
00000240  73 00 2C 00 20 00 34 00 38 00 20 00 6B 00 48 00  s.,. .4.8. .k.H.
00000250  7A 00 2C 00 20 00 73 00 74 00 65 00 72 00 65 00  z.,. .s.t.e.r.e.
00000260  6F 00 00 00 02 00 61 01 36 26 B2 75 8E 66 CF 11  o.....a.6&?uZfI.
00000270  A6 D9 00 AA 00 62 CE 6C C7 76 27 00 00 00 00 00  ?U.?.bIlCv'.....
00000280  1B D2 00 FD 04 5D 4E 46 B3 42 9D 8C BC A6 F6     .O.y.]NF?B.???o

gonna have to figure them out....
  • Author
  • Localization

medievil, posted Sat Apr 28, 2018 3:22 pm (34462)


well nevermind they play fine in vlc, wouldn't play in GAP

so wma plays fine, xbadpcm wav have to be converted to regular wav
  • Author
  • Localization

medievil, posted Sat Apr 28, 2018 5:06 pm (34465)


ummm..so all you have to do is change one byte in the xbox adpcm wav.. byte 14 from 69 to 11 and they play in vlc but MPC, WMP and groove all do not (with WMP Maleware byte even sees it as an exploit..lol)
  • Author
  • Localization

medievil, posted Sat Apr 28, 2018 6:59 pm (34469)


ok huuuuge issue... @ Acewell
The script to reimport into mtx was one you posted (Worked on) over on the xantex forum (I posted it as code earlier in the thread) does seem to work...it will not create an mtx file from the dds files (Stripped header/extension or not)

here is a pc indy mtx, for a refresher...I know it has been a while since you worked on that script...looks like sections with pointers to where the texture is located, probably a counter up top showing how many are in the file...but not being familiar with all of this I get lost easily...any breakdown of how to create the file is most appreciated!

https://www.dropbox.com/s/0lm83hevypmu9 ... y.mtx?dl=0
  • Author
  • Localization

Acewell, posted Sun Apr 29, 2018 12:05 am (34477)


medievil wrote:
The script to reimport into mtx was one you posted over on the Xentax forum does seem to work...

yep, it "does seem to work" based on the direct feedback from the guys posting there. :)
the purpose of reimport is not to create, but to find and replace data with modified data.
are you following the reimport instructions correctly? i test all scripts before posting them.
  • Author
  • Localization

medievil, posted Sun Apr 29, 2018 12:51 am (34478)


Acewell wrote:
medievil wrote:
The script to reimport into mtx was one you posted over on the Xentax forum does seem to work...

yep, it "does seem to work" based on the direct feedback from the guys posting there. :)
the purpose of reimport is not to create, but to find and replace data with modified data.
are you following the reimport instructions correctly? i test all scripts before posting them.


yea figured that out, problem is the xbox buffy doesn't have the textures all in one mtx, so no base multitex to reimport them to
... I just assumed when I ran across the script that it created not substituted...already been looking into it, that multitex header is ummm confusing... current plan is to sub in some random stuff so I can find the pointer to the file start in each sub header...
  • Author
  • Localization

medievil, posted Sun Apr 29, 2018 1:05 am (34479)


ok
what I know so far (not much..lol)
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

000000A0  64 15 00 00 01 00 00 00 FF FF FF FF FF FF FF FF  d.......yyyyyyyy
000000B0  FF FF FF FF 8B 79 47 3C 01 00 00 00 63 61 75 73  yyyy000000C0  74 30 31 00 47 F0 40 40 40 F0 34 34 34 F0 2A 2A  t01.G?@@@?444?**
000000D0  2A F0 24 24 24 F0 26 26 26 F0 2E 2E 63 61 75 73  *?$$$?&&&?..caus
000000E0  74 30 31 00 4D F0 4F 4F 4F F0 42 42 42 F0 39 39  t01.M?OOO?BBB?99
000000F0  39 F0 32 32 32 F0 32 32 32 F0 4A 4A 20 00 00 00  9?222?222?JJ ...
00000100  20 00 00 00 00 00 00 00 20 00 00 00 08 08 08 08   ....... .......
00000110  05 00 00 00 FF FF FF FF 00 00 00 00 88 25 00 00  ....yyyy....?%..

this is actually the second sub header...the first two in the last group of 4 (88 25 Standard hex byte swap location is 2588) are the start pointer for the actual file, I can move there in the hex editor and see the next file start
The first two (64 15) are the header start is is consistent across all the subheaders except the very first one, BUT on other mtx files, the numbers are different
  • Author
  • Localization

medievil, posted Sun Apr 29, 2018 1:22 am (34480)


Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

000000A0  78 15 00 00 01 00 00 00 FF FF FF FF FF FF FF FF  x.......yyyyyyyy
000000B0  FF FF FF FF D5 8B 1E 3B 01 00 00 00 61 63 69 64  yyyyO<.;....acid
000000C0  73 70 69 74 30 32 00 00 00 00 00 00 00 00 00 00  spit02..........
000000D0  00 00 00 00 00 00 00 00 00 00 00 00 61 63 69 64  ............acid
000000E0  73 70 69 74 30 32 00 00 00 00 00 00 00 00 00 00  spit02..........
000000F0  00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00  ............@...
00000100  40 00 00 00 00 00 00 00 20 00 00 00 08 08 08 08  @....... .......
00000110  06 00 00 00 FF FF FF FF 05 00 00 00 1C BB 00 00  ....yyyy.....>..


second subheader from a different mtx.... location pointer is consistant.....and seems that the first subheader is consistant across mtx files, it starts with 80

Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000020  80 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF  ?.......yyyyyyyy
00000030  FF FF FF FF E0 8B 1E 3B 01 00 00 00 61 63 69 64  yyyya<.;....acid
00000040  73 70 69 74 30 31 00 00 00 00 00 00 00 00 00 00  spit01..........
00000050  00 00 00 00 00 00 00 00 00 00 00 00 61 63 69 64  ............acid
00000060  73 70 69 74 30 31 00 00 00 00 00 00 00 00 00 00  spit01..........
00000070  00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00  ............@...
00000080  40 00 00 00 00 00 00 00 20 00 00 00 08 08 08 08  @....... .......
00000090  06 00 00 00 FF FF FF FF 05 00 00 00 A4 A5 00 00  ....yyyy....??..
1st header on this mtx
  • Author
  • Localization

medievil, posted Sun Apr 29, 2018 1:36 am (34481)


ok And I have found texture size
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000020  80 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF  ?.......yyyyyyyy
00000030  FF FF FF FF 8C 2F 99 3C 00 00 00 56 65 5F 73 72  yyyy?/T<...Ve_sr
00000040  6C 6B 5F 74 78 72 5F 61 72 63 68 00 B8 6D 91 95  lk_txr_arch.?m'
00000050  67 8E 92 68 8B 8F 6D 8D 91 59 7A 80 65 5F 73 72  gZ'h<.m.'Yz?e_sr
00000060  6C 6B 5F 74 78 72 5F 61 72 63 68 00 A7 B2 7F A7  lk_txr_arch.?.
00000070  B2 66 91 9D 66 8D 9C 68 90 9B 66 8C 00 02 00 00  ?f'.f.?h.>f?....
00000080  00 01 00 00 00 00 00 00 20 00 00 00 08 08 08 08  ........ .......
00000090  08 00 00 00 FF FF FF FF 01 00 00 00 A4 31 00 00  ....yyyy....?1..

here at location 7d and 81 are the width/height if you look at the other headers posted it is consistent they all have size numbers there.. in this case it is 512x256(00 02 00 00 is 512) (00 01 00 00 = 256) in the previous post at 7c and 80 you have (40 00 00 00 = 64)
  • Author
  • Localization

medievil, posted Sun Apr 29, 2018 1:53 am (34482)


ok, also not evident from whats posted, but the 4th byte in each sub header is the file number if you look at each one I posted that is the second subheader, you see 01(first subheader is 00)
not found dxt format though no 41 or 45 (2 most common)
  • Author
  • Localization

medievil, posted Sun Apr 29, 2018 2:20 am (34483)


hmmm all the actual texture files also begin with 4 bytes not sure what they mean, they are consistent for that mtx... for instance one i just checked is 01 00 00 00 another 00 01 00 00 and still another 00 02 00 00
  • Author
  • Localization

medievil, posted Sun Apr 29, 2018 3:01 pm (34491)


seems my header examples are off a little bit, the actual start is with the file number and it ends with the 4 bytes for textures size..
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

000000A0  xx xx xx xx 01 00 00 00 FF FF FF FF FF FF FF FF      ....yyyyyyyy
000000B0  FF FF FF FF 8B 79 47 3C 01 00 00 00 63 61 75 73  yyyy000000C0  74 30 31 00 47 F0 40 40 40 F0 34 34 34 F0 2A 2A  t01.G?@@@?444?**
000000D0  2A F0 24 24 24 F0 26 26 26 F0 2E 2E 63 61 75 73  *?$$$?&&&?..caus
000000E0  74 30 31 00 4D F0 4F 4F 4F F0 42 42 42 F0 39 39  t01.M?OOO?BBB?99
000000F0  39 F0 32 32 32 F0 32 32 32 F0 4A 4A 20 00 00 00  9?222?222?JJ ...
00000100  20 00 00 00 00 00 00 00 20 00 00 00 08 08 08 08   ....... .......
00000110  05 00 00 00 FF FF FF FF 00 00 00 00 88 25 00 00  ....yyyy....?%..
00000120  64 15 00 00 xx xx xx xx xx xx xx xx xx xx xx xx  d...
so the subheader here starts at 0a4 and ends at 0123
  • Author
  • Localization

medievil, posted Mon Apr 30, 2018 4:12 am (34516)


grrrr, pulling my hair out, my test header is not working correctly and I can't figure out why
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  4D 55 4C 54 49 54 45 58 06 00 02 00 01 00 00 00  MULTITEX........
00000010  00 00 00 00 01 00 00 00 80 01 00 00 18 00 00 00  ........?.......
00000020  80 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF  ?.......yyyyyyyy
00000030  FF FF FF FF 2D BE 08 3E 00 00 00 00 7A 6F 6D 62  yyyy-?.>....zomb
00000040  69 65 77 69 70 65 00 00 00 00 00 00 00 00 00 00  iewipe..........
00000050  00 00 00 00 00 00 00 00 00 00 00 00 7A 6F 6D 62  ............zomb
00000060  69 65 77 69 70 65 00 00 00 00 00 00 00 00 00 00  iewipe..........
00000070  00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00  ............@...
00000080  00 01 00 00 00 00 00 00 20 00 00 00 08 08 08 08  ........ .......
00000090  05 00 00 00 FF FF FF FF 01 00 00 00 A4 02 00 00  ....yyyy....?...
000000A0  B0 56 00 00 02 00 00 00 00 00 00 00 00 00 00 00  ?V...............


it should go to 02a4(start of the headerless dds file) but starts @ 00a4
  • Author
  • Localization

medievil, posted Mon Apr 30, 2018 5:33 am (34517)


modified the mtx script for extracting images from the Indy MTX multitex files... it didn't take into account DXTC it made them all dxt1(which is wrong), but the byte selecting it IS there, just needs to be altered. In the sub headers immediately after the group of four FF's, is a single byte that is either 01 or 05 (Dxt1 or dxt5).. modified code takes the byte, adds 0x30 and then places it correctly in the DDS header
Code:
# IJET *.mtx (multi texture format)
# quickbms script by WRS, xentax.com
#Modified by Medievil to add DXT compression method

idstring "MULTITEX"
get SIX short
get TWO short
get ONE long
get ZERO long

get TEXCOUNT long
get TEXHEADSIZE long
get TWFOUR long      # head size
get TEXHEADSIZE long # 128

get FNAME basename

for t = 0 < TEXCOUNT
  get INDEX long
   getdstring UNKNOWN 16
   get UNKNOWN short     # 256/ flags?
   get UNKNOWN short
  getdstring TEXNAME1 32
  getdstring TEXNAME2 32 # not 64 because of repeated data
  get TWIDTH long
  get THEIGHT long
   get UNKNOWN long
  get BPP long
   get UNKNOWN long
  get MINIMAPS long
   get UNKNOWN long
   get DXT BYTE
 get UNKNOWN THREEByte
  get TEXPOS long
  get TEXTSIZE long
next t
  # POS is a pointer to minimap info

  savepos POS
  goto TEXPOS

  # write 128-byte dds header
  log MEMORY_FILE 0 0
  putvarchr MEMORY_FILE 127 0

  # setup dds header
 math DXT = 0x30
  putvarchr MEMORY_FILE 0 0x20534444 long  #dwMagic (DDS )
  putvarchr MEMORY_FILE 4 0x7C long        #dwSize (128)
  putvarchr MEMORY_FILE 8 0x21007 long     #dwFlags (prob. wrong)

  putvarchr MEMORY_FILE 12 THEIGHT long    #dwHeight
  putvarchr MEMORY_FILE 16 TWIDTH long     #dwWidth
  putvarchr MEMORY_FILE 28 MINIMAPS long   #dwMiniMapCount

  putvarchr MEMORY_FILE 76 32 long         #dwSize
  putvarchr MEMORY_FILE 80 4 long          #dwFlags
  putvarchr MEMORY_FILE 84 0x00545844 long #dwFourCC
  putvarchr MEMORY_FILE 87 Dxt byte (DXT1 or 5  depending on byte read)
  putvarchr MEMORY_FILE 108 4198408 long   #dwCaps1

  append
  for i = 0 < MINIMAPS
    get DATASIZE long  # minimap size
    savepos POS2
    log MEMORY_FILE POS2 DATASIZE  # save minimap
    math POS2 = DATASIZE
    goto POS2
  next i
  append

  get DSIZE asize MEMORY_FILE
  string FILENAME p= "%s/%s.dds" FNAME TEXNAME1
  log FILENAME 0 DSIZE MEMORY_FILE

  goto POS
next t
  • Author
  • Localization

medievil, posted Tue May 01, 2018 12:20 am (34546)


hmmm I know what was wrong now....I think I have all the info to recreate the multitex file, probably be easier to work with the pak extracted mtx files rather than the dds though...they have less header to remove but still hold all the important stuff (size WxH, DXT1 or 5, number of mipmaps, etc...)....just have to figure out how to write a routine to do it....BMS scripting 101 now in session..lol

Hmm anyone know if it is possible with BMS to load a txt file with parameters in it from within the script?? Pr even better prompt for input from the user?..would make it a lot easier since I could predetermine # of textures and their file sizes so I could know how much space to give the subheader area. Obviously 2 textures means 2 sub headers then the files.... 31 textures will need a lot more space before the files start
  • Author
  • Localization

medievil, posted Tue May 01, 2018 5:27 am (34555)


ok, here are my thoughts on creating a script...
1) first thing I get the texture name and store in in a variable (since it will be the name of the opened file currently being read I can use basename)
2) I have to get the height/width/mipmaps and DXTC store them in variables(easy enough since I know the locations in a dds or the pak extracted single texture mtx's)
3)at this point I can start creating the file, Place MULTITEX in the first 8 bytes and finish the rest of the main header texture count will has to be increased by 1 as each file is read and the subheader added(basic set it as zero and do a math var =01 before the next whatever in the for loop to read each file) subheader size is easy, it increases by 80 bytes for each header I can actually wait until the end to write it(Math Subhead = textcount * 80 and place it at the correct byte location)
4) start the subheader... start with placing the text count long(variable that gets increased by 1 each time) at the first subheader location, place my string of 16 FF's, 8 bytes of filler, then place the filename without extension(32 bytes to fill with it, so the remaining will be 00's, issue will be determining how many), do it again cause the name is doubled, place width, height, bitdepth always 32bit so a 0x20000000),0x08080808, mipmaps long, 0xFFFFFFFF, DXTC (depending on which I use, dds I have to sub 30, the mtx the the pak extracter made, I have to subtract 40) either 0x05000000 or 0x01000000 and next the offset for the stored location of the actual texture info (subheader total size ..number of textures* 80 24(the multitex header size)) it will have to be done after all the textures have been processed before the final file is written, unless there is a way to return the number of files to be processed. Each subheader will have to know and have it's texture data size (next entry below)added for the next subheader's offset...
and finally the hard part..maybe??? IF asize works like I think and returns the size of the current file being read I can simply subtract 80 for dds or 30 for mtx and place it in the final subheader location, if not I will have to figure a different way... and at this point the only way I know save the texture data is to do a nested loop and save it to a memory file and keep appending the rest of the texture data to add to the main memory file at the very end after all the subheaders are made...
if all thst works like I hope, rinse and repeat for all the texture files for that multitex and finally save it

I think my logic is sound (if long winded..lol)
  • Author
  • Localization

medievil, posted Wed May 02, 2018 5:18 am (34588)


ok gotta good start its now simply a matter of finishing the subheader/text data writes should finish it tomorrow evening after work...here it is so far, everything is working correctly and yes...a mess at the moment, clean up AFTER it works..lol
Code:



#create multitex header
set DSIZE 00
set Ttotal ? ? #user prompt for total number of textures for THIS multitex

xMath toffset "Ttotal *  0x80" # generate offset based on 80 byte subheaders multiplied by total number of textures
math Toffset = 0x24 #add multitex header size
Print "%Ttotal%" #debug to make sure it was correct
print "%TOffset%" #debug to make sure it was correct
log memory_file 0 0
putvarchr MEMORY_FILE 35 0
#setup header
Putvarchr memory_file 0 0x000000020002000658455449544c554d longlong #multitex
putvarchr memory_file 16 0x00 long
putvarchr memory_file 20 Ttotal long
putvarchr memory_file 24 Toffset long
putvarchr memory_file 28 0x00000018 long #multitex header offset
putvarchr memory_file 32 0x0000 short

#get info from mtx labled single texture (can't use dds currently, once this is completed I just have to change the gets to dds format)
# bpp is alway 32 for these textures as well so it wasn't needed to be obtained.
getdstring Textname 32 #texture name
get TWIDTH long #texture width
get THEIGHT long #texture height
get NULL long #not needed, usually zeros, could contain BPP flag as 01 or 08 (not sure)
get NULL long #same as above
get FSIZE asize long #file size
math FSIZE -= 0x40 #file size minus the header to get texture data size
xmath DSIZE "DSIZE FSIZE" #as files are read need to keep up with next entry point to write next file, could also do toffset fsize right after I write the texture data and store it in a var to elimitae a step cause I still have to take dsize and figure in the data start offset anyway
get Null long #n/a
get NULL Long #n/a
get fourcc long #dxtc
Get null long #n/a
Txtpos = 0x40 #position in file where texture data begins
print "%txtpos%" #debug check

print "Dsize %DSIZE%" #debug check
IF fourcc = 0x10
set fourcc = 0x40
else
endif
math fourcc -= 0x40 # multitex needs either 01 or 05 (In this case dxt10 would need 10 dxt3 =3, etc), texture file has 41 and 45
print " 4CC %fourcc%" #debug check
 # Write subheaders as they are read then jump to texture offset and write text data






**EDIT**
Updated cause I found a condition that had the dxt as 10 and in the indy mtx under the same name it has 00 in the dxt position so I set it to 40 so it will end up 00...will see how it goes
  • Author
  • Localization

medievil, posted Thu May 03, 2018 3:32 am (34622)


ok roadblock alert!!!
not sure I understand something...
is there any way or function for the memory file position to advance as data is added? if you add a 32 byte line will it advance 32 bytes? or can I say PutVarChr 10 Offset data long??? trying to figure out a way to write the subheaders by using offsets cause each subheader will be 80 bytes from the previous first @ 24, second @ a4...etc..
  • Author
  • Localization

medievil, posted Thu May 03, 2018 4:51 am (34625)


ok forget the above, found a long way around but it works current code, up to writing the texture to the memory file now, have to read about it, not sure if I should do one byt at a time or the whole thing at once(if thats even possible)
Code:
Print "total number of textures"
set Ttotal ? ? #user prompt for total number of textures for THIS multitex
set textnum 0x00
set offset1 0x00
xMath toffset "Ttotal *  0x80" # generate offset based on 80 byte subheaders multiplied by total number of textures
math Toffset = 0x24 #add multitex header size
Print "%Ttotal%" #debug to make sure it was correct
print "%TOffset%" #debug to make sure it was correct
log memory_file2 0 0
#putvarchr MEMORY_FILE2 toffset 0
#setup header
Putvarchr memory_file2 0 0x544c554d long
Putvarchr memory_file2 4 0x58455449 long
Putvarchr memory_file2 8 0x00020006  long
Putvarchr memory_file2 12 0x00000002 long #multitex
putvarchr memory_file2 16 0x00000000 long
putvarchr memory_file2 20 Ttotal long
putvarchr memory_file2 24 Toffset long
putvarchr memory_file2 28 0x00000018 long #multitex header offset
putvarchr memory_file2 32 0x00000000 long
# 34 - 37 are the texture file number(long) in each subheader,, first is 00, second 01, etc...
#get info from mtx labled single texture (can't use dds currently)
# bpp is alway 32 for these textures as well so it wasn't needed to be obtained.



get Textname long #texture name

get textname2 long
get textname3 long
get textname4 long
get Textname5 long #texture name

get textname6 long
get textname7 long
get textname8 long
get TWIDTH long #texture width
get THEIGHT long #texture height
get NULL long #not needed, usually zeros, could contain BPP flag as 01 or 08 (not sure)
get NULL long #same as above
get FSIZE asize long #file size
math FSIZE -= 0x40 #file size minus the header to get texture data size
xmath DSIZE "DSIZE FSIZE" #as files are read need to keep up with next entry point to write next file,
get Null long #n/a
get NULL long #n/a
get fourcc long #dxtc
Get null long #n/a
Txtpos = 0x40 #position in file where texture data begins
print "%txtpos%" #debug check

print "Dsize %DSIZE%" #debug check
IF fourcc = 0x10
set fourcc = 0x40
else
endif
math fourcc -= 0x40 # multitex needs either 01 or 05 (In this case dxt10 would need 10 dxt3 =3, etc), texture file has 41 and 45
print " 4CC %fourcc%" #debug check

#create 36 byte multitxt header
xmath offset "offset offset"







 # Write subheaders as they are read then jump to texture offset and write text data

set offset2 36
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textnum long #text number count
math textnum 0x01
print "Textnum %textnum%"
set offset2  40
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0xffffffff long
set offset2  44
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0xffffffff long
set offset2  48
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0xffffffff long
set offset2  52
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0x3c47798a long #header stuff

set offset2 56
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0x00000001 long #more header stuff

set offset2 60
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname long #texture name 1st instance
set offset2 64
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname2 long #texture name 1st instance
set offset2 68
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname3  long #texture name 1st instance
set offset2 72
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname4  long #texture name 1st instance
set offset2 76
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname5 long #texture name 1st instance
set offset2 80
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname6 long #texture name 1st instance
set offset2 84
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname7  long #texture name 1st instance
set offset2 88
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname8  long #texture name 1st instance
set offset2 92
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname  long #texture name 2nd instance
set offset2 96
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname2  long #texture name 2nd instance
set offset2 100
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname3  long #texture name 2nd instance
set offset2 104
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname4  long #texture name 2nd instance
set offset2 108
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname5  long #texture name 2nd instance
set offset2 112
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname6  long #texture name 2nd instance
set offset2 116
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname7  long #texture name 2nd instance
set offset2 120
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 textname8  long #texture name 2nd instance


set offset2 124
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 Twidth long
set offset2 128
xmath offset3 "offset2 offset1"
Putvarchr memory_file2 offset3 Theight long
set offset2 132
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0x00000000 long
set offset2 136
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0x00000020 long #header stuff
set offset2 140
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0x08080808 long
set offset2 144
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0x00000005 long
set offset2 148
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0xffffffff long
set offset2 152
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 fourcc byte
set offset2 153
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 0x000000 threebyte
set offset2 156
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 Toffset long
set offset2 160
xmath offset3 "offset2 offset1"
putvarchr memory_file2 offset3 DSIZE long
print "offset %offset3%"
 xmath offset1 "offset1 128"
print "offset %offset1%"

print "txtpos %txtpos%"
print "pos %pos%"
set name ? ?
 log NAME 0 0xa4 MEMORY_FILE2

goto txtpos
  • Author
  • Localization

medievil, posted Thu May 03, 2018 7:25 am (34627)


it works... header I created with the script above!!
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  4D 55 4C 54 49 54 45 58 06 00 02 00 02 00 00 00  MULTITEX........
00000010  00 00 00 00 01 00 00 00 A4 00 00 00 18 00 00 00  ........?.......
00000020  00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF  ........yyyyyyyy
00000030  FF FF FF FF 8A 79 47 3C 01 00 00 00 63 6F 72 64  yyyySyG<....cord
00000040  5F 62 6F 64 79 00 00 00 00 00 00 00 00 00 00 00  _body...........
00000050  00 00 00 00 00 00 00 00 00 00 00 00 63 6F 72 64  ............cord
00000060  5F 62 6F 64 79 00 00 00 00 00 00 00 00 00 00 00  _body...........
00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00  ................
00000080  00 01 00 00 00 00 00 00 20 00 00 00 08 08 08 08  ........ .......
00000090  05 00 00 00 FF FF FF FF 01 00 00 00 A4 00 00 00  ....yyyy....?...
000000A0  36 AC 00 00                                      6?..
  • Author
  • Localization

PRP1986, posted Thu May 03, 2018 9:43 am (34630)


I've been following this (in awe as I struggle to understand scripting lol) - good work!!
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.