succesfull modded MK9 textures help creating QUICKBMS SCRIPT
Posted: Tue Aug 09, 2011 9:59 pm
okay the things i posted earlier i deleted
so heres what im going try to do now
i want to make a bms script for the texture2d files and convert them to .dds dxt5 files
texture2d files from CHAR files can be obtained useing the tools from gildor ,Unreal Package Extractor
when you extract a CHAR file you will get a map with the same name as the CHAR file you extracted
in there is a map called textures this is where the .texture2d files are located
looking at the texture2d files i figured how the are put together and what pixel format it uses namely .dds dxt5 with mipmaps
i already edited succesfully the textures and replaced them back into the texture2d but all useing a hex editor,so i want to make this absolete by making a script for quickbms and i know that with the latest version you can also use the same script as a reimporter.
now im going to tell here how the texture2d are put together and how i was able to edit them in photoshop
first there are 4 major textures for characters which are _diff.texture2d _normalHQA.textur2d _spec.texture2d and _pmsk.texture2d and characters also have damage textures which are called DMG_diff.texture2d DMG_normalHQA.textur2d DMG_spec.texture2d and DMG_pmsk.texture2d plus more textures like for hair or weapons stuff like that,but i edited the _diff.texture2d in photoshop so i could change the colors like for skarlet and made her blue in stead of red
so im going to use the _diff.texture2d as an example (the other texture2d files are put togheter in the same way so)
first 100 bytes of a _diff.texture2d file
everything is in endian big and everything is 4 bytes long
so when we go to 0xCA in a hex editor you will the number of textureblocks 00 00 00 0B
then you will get a NULL 00 00 00 00
then you will get 00 10 00 00 2 times which is the size of the first texture block
after that you get 00 D3 FB 84 which is an offset specific for the CHAR_file but not relevant if i want to just convert the texture2d to a dds dxt5
after the offset begins the textureblock which is 00 10 00 00 long in hex
so jumping 00 10 00 00 further with the hex editor you will get
first 4 bytes after the first textureblock is 00 00 04 00=1024 which is the height of the texture
2nd 4bytes is also 00 00 04 00=1024 which is the width of the texture
then you will get a NULL 00 00 00 00
and then you will get filesize for the 2nd textureblock within the texture2d 2 times again 00 04 00 00
and then again an offset before the 2nd textureblock begins 00 E3 FB 9C which is again specific for the CHAR file
so this will go on 11 times 00 00 00 0B
what i did is i took out all the the textureblocks and placed them togehter in the same order put a dds dxt5 header above it.
the dds header and texture for the texture2d can easily be obtainted for the correct width and height.
i used umodel (also from gildor) for the char_...xxx files and when useing (for ps3) the commands -nomesh -noanim -ps3 -export you will also get a map called texture2d in there are the textures only in .tga just convert the .tga to .dds dxt5 and then we already have the dds header in the correct size(witdh and height)
it opens in photoshop (dds plugin) loaded it without mipmaps,edited it saved it again as a dds dxt5 with generate mipmaps and put it back again with hex
editor
the sizes of the textureblocks will be the same as the mipmaps ,1st was 00 10 00 00 so selected first 00 10 00 00 hex (1048576 bytes) (-.dds header))of the dds and swapped it in the texture2d then the next 00 04 00 00 and so on
the .texture2d is actually the same as a .dds dxt5 format with mipmaps only the texture2d puts the mipmaps seperatly in with width,height and size2x (and a offset specific for within the char...xxx file)
so now that i explained how its put together,i want to make a bms script for making the texture2d into a dds and edit it,and then use the reimport option of quickbms to reimport
ive been trying to make scripts but with no luck,i find it hard to understand,i know it can be made i saw the topic of chroxx and uncharted2 that he made a script for making a file of uncharted2 into a .dds file.
viewtopic.php?f=18&t=6901&p=56077&hilit=quickbms#p56077
so any help here is much appreciated
here are the textures and the diff texture i used in the example
http://www.megaupload.com/?d=7FU4XFL6
so heres what im going try to do now
i want to make a bms script for the texture2d files and convert them to .dds dxt5 files
texture2d files from CHAR files can be obtained useing the tools from gildor ,Unreal Package Extractor
when you extract a CHAR file you will get a map with the same name as the CHAR file you extracted
in there is a map called textures this is where the .texture2d files are located
looking at the texture2d files i figured how the are put together and what pixel format it uses namely .dds dxt5 with mipmaps
i already edited succesfully the textures and replaced them back into the texture2d but all useing a hex editor,so i want to make this absolete by making a script for quickbms and i know that with the latest version you can also use the same script as a reimporter.
now im going to tell here how the texture2d are put together and how i was able to edit them in photoshop
first there are 4 major textures for characters which are _diff.texture2d _normalHQA.textur2d _spec.texture2d and _pmsk.texture2d and characters also have damage textures which are called DMG_diff.texture2d DMG_normalHQA.textur2d DMG_spec.texture2d and DMG_pmsk.texture2d plus more textures like for hair or weapons stuff like that,but i edited the _diff.texture2d in photoshop so i could change the colors like for skarlet and made her blue in stead of red
so im going to use the _diff.texture2d as an example (the other texture2d files are put togheter in the same way so)
first 100 bytes of a _diff.texture2d file
Code: Select all
00 00 06 18 00 00 00 00 00 00 04 13 00 00 00 00 00 00 00 04 00 00 00 00 00 00 04 00 00 00 06 19 00 00 00 00 00 00 04 13 00 00 00 00 00 00 00 04 00 00 00 00 00 00 04 00 00 00 02 F4 00 00 00 00 00 00 00 FB 00 00 00 00 00 00 00 01 00 00 00 00 07 00 00 04 D2 00 00 00 00 00 00 04 13 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 FF 00 00 05 05 00 00 00 00 00 00 00 CD 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 04 67 00 00 00 00 00 00 00 FB 00 00 00 00 00 00 00 01 00 00 00 00 02 00 00 05 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D3 FB 60 00 00 00 00 00 00 00 00 00 00 00 00 00 D3 FB 70 00 00 00 0B 00 00 00 00 00 10 00 00 00 10 00 00 00 D3 FB 84 00 00 00 00 00 00 00 00 49 4A C7 39 BF BF 1D 3D 00 00 00 00 00 00 00 00 10 84 24 21 5E 5E 5E 5E 00 00
so when we go to 0xCA in a hex editor you will the number of textureblocks 00 00 00 0B
then you will get a NULL 00 00 00 00
then you will get 00 10 00 00 2 times which is the size of the first texture block
after that you get 00 D3 FB 84 which is an offset specific for the CHAR_file but not relevant if i want to just convert the texture2d to a dds dxt5
after the offset begins the textureblock which is 00 10 00 00 long in hex
so jumping 00 10 00 00 further with the hex editor you will get
Code: Select all
00 00 04 00 00 00 04 00 00 00 00 00 00 04 00 00 00 04 00 00 00 E3 FB 9C
2nd 4bytes is also 00 00 04 00=1024 which is the width of the texture
then you will get a NULL 00 00 00 00
and then you will get filesize for the 2nd textureblock within the texture2d 2 times again 00 04 00 00
and then again an offset before the 2nd textureblock begins 00 E3 FB 9C which is again specific for the CHAR file
so this will go on 11 times 00 00 00 0B
what i did is i took out all the the textureblocks and placed them togehter in the same order put a dds dxt5 header above it.
the dds header and texture for the texture2d can easily be obtainted for the correct width and height.
i used umodel (also from gildor) for the char_...xxx files and when useing (for ps3) the commands -nomesh -noanim -ps3 -export you will also get a map called texture2d in there are the textures only in .tga just convert the .tga to .dds dxt5 and then we already have the dds header in the correct size(witdh and height)
it opens in photoshop (dds plugin) loaded it without mipmaps,edited it saved it again as a dds dxt5 with generate mipmaps and put it back again with hex
editor
the sizes of the textureblocks will be the same as the mipmaps ,1st was 00 10 00 00 so selected first 00 10 00 00 hex (1048576 bytes) (-.dds header))of the dds and swapped it in the texture2d then the next 00 04 00 00 and so on
the .texture2d is actually the same as a .dds dxt5 format with mipmaps only the texture2d puts the mipmaps seperatly in with width,height and size2x (and a offset specific for within the char...xxx file)
so now that i explained how its put together,i want to make a bms script for making the texture2d into a dds and edit it,and then use the reimport option of quickbms to reimport
ive been trying to make scripts but with no luck,i find it hard to understand,i know it can be made i saw the topic of chroxx and uncharted2 that he made a script for making a file of uncharted2 into a .dds file.
viewtopic.php?f=18&t=6901&p=56077&hilit=quickbms#p56077
so any help here is much appreciated
here are the textures and the diff texture i used in the example
http://www.megaupload.com/?d=7FU4XFL6