Tuesday, December 6, 2011

WWE 12 - How to Inject Textures into the Paint Tool – Part Two

In this part of the tutorial we are going to be creating textures to inject into the paint tool file. You will need the uncompressed image file you created in part one of the tutorial i.e. 001E.pac. Lets get started: 

1.     Rename 001E.pac to 001E.tga. The format of the image is a tga file but is a special format which is only viewable in optpix image studio. Open the 001E.tga file in Optpix and you should have the following:

2.     We are going to use the alpha channel from this file when creating our custom texture so click on layer – extract alpha channel. You should get file called bap_1, this is the file we are going to use in creating our alpha channel.  



3.     To quickly explain how the alpha channel works: White is Opaque, Black is completely transparent and grey is in between.  

We are going to create an alpha channel which is completely opaque, so click on each of the squares which is not white and set the value to 255,255,255 for the red green and blue. This will change the colour of the square to white. You can do this by either manually typing the values in or by using the colour chart.  

4.     You should have an bap_1 file which looks like this:



Don’t close this file, you will need it shortly.


5.     Now you need to create your custom texture that you wish to inject into the game. You can use any graphics editor to create the file but the dimensions of the file must be 128x128. Optpix supports a few file formats but I usually save my custom texture as jpg.  

6.     Open your custom texture in Optpix. Now you need to reduce the number of colours in the image. In optpix, click image – colour reduction. On the output tab, select 256 colours.  



7.     Optpix will create a second image which has been downsampled to 256 colours. Click on the title bar of the new image to select it.  

8.     Now we need add an alpha channel to this image. Click on image – compose alpha channel. This will give you a dialog box which should have bap_1 listed. Select bap_1 and click ok.  



9.     The file now needs to be saved as a tga file to be injected into the game. Click file, save as and select tga as the file type. You are now ready to inject the texture back into the T002 file.  

10.  Open the T002 file in X-Packer using the “File- open - xbox360/ps3 pach” command.

Click inject next to one of the bpe files and select the tga file you created in optpix. Something you should note, the image files sometimes lose colour information when injecting over certain files in T002 archive. You’ll have to try replacing different files to see which works. In my experience, files ranging from 0036 downwards in the T002 file works best.   

11.  The T002 file with your custom textures will now need to be injected into the ed49.pac file. So in X-Packer open the ed49.pac file again using the “File- open - xbox360/ps3 pac” command. On the T002 row, click inject file and inject your new T002 file.  

12.  You can now replace the ed49.pac file and your arc files in the game with your new modified files. 

13.   Start the game and go into paint tool mode. Create a new image and select the WWE icon to insert a WWE image into the paint tool file. Scroll until you reach your custom texture and insert it. Save the file and enjoy your new custom texture.  



14. If you want to share these custom textures with a retail xbox user, all you need to do is send them your paint tool file. They will need to rehash and resign the file.

If you want to go back to using the original WWE logo’s in the game, insert your original WWE 12 disc into the console and everything will be back to the way it was. That’s it for now, post any questions below.  

As always if you find the tutorial useful, please consider donating.

7 comments:

  1. changed the extension to tga, but optpix still isnt reading it help please

    ReplyDelete
  2. you wouldnt happen to know where the TV SHOW logos are located would you? I am trying to make the Royal Rumble into a paint tool.

    ReplyDelete
  3. I'm sorry, I wrote you e-mail first (on the 6th of March) but I didn't get an answer. I found some bugs in your great X-Packer tool and suggest fixes:
    1). Symptoms: in some cases export of .dds file out of xbox360 .Texture2D fails telling that texture is not found in .xxx. But texture IS there and it can be checked by hex editor.
    Suggestions:
    It looks like binary search function IndexOfBytes(System.Byte[] array, System.Byte[] pattern, int startIndex, int count)
    contains something like this:
    int num = Array.FindIndex(array, startIndex, count, delegate (byte b) {
    fidx = (b == pattern[fidx]) ? (fidx + 1) : 0;
    return fidx == pattern.Length;
    The problem is that it searches forward and can't return to previous bytes after sequence of equal data. It means we can't find {0 1 2} in {0 0 1 2}. Suggest using this:
    int IndexOfBytes(System.Byte[] array, System.Byte[] pattern, int startIndex, int count)
    {
    if (pattern.Length>count)
    return -1;
    for (int i=startIndex;i<startIndex+count-pattern.Length;i++)
    {
    bool found = true;
    for (int j = 0; j < pattern.Length; j++)
    {
    if (array[i + j] != pattern[j])
    {
    found = false;
    break;
    }
    }
    if (found)
    {
    return i;
    }
    }
    return -1;
    }
    It works.

    2). Symptoms: while importing 128x128 .dds into xbox360 .Texture2D message tells that it's OK, but neither .xxx nor .Texture2D are changed.
    Suggestions:
    It looks like function importTexture2dTexture_xbox(string gridName, int RowIndex)
    contains a check for texture width:
    string str7 = view["Width", num4].Value.ToString();
    string str8 = view["Height", num4].Value.ToString();
    byte[] data = new byte[num3];
    int num7 = 0;
    if ((num3 != 0) && !(str7 == "128"))
    {
    goto Label_02E1;
    I don't know why it is needed but when I removed the check for texture size:
    if (num3 != 0)
    {
    goto Label_02E1;
    everything started working correctly (I checked in hex editor, by exporting and on a console). 128x128 textures are used in xbox360 version of MK for pictures in character select menu.

    3). It's not a bug, more likely a question or a wish. While extracting xbox MK textures I found absense of 512x256.dds and 256x128xDxt1.dds. Of course, I solved out this by creating them with Paint.NET out of 512x512.dds and 256x256xDxt1.dds but this way of keeping different empty fixed-size textures instead of generating them dynamically seems strange.

    I hope my comments will help)

    ReplyDelete
  4. @gauri, thanks for the comment. I am assuming you are referring to the mortal kombat functionality of x-packer.

    All the other functionality works based on headers of the files but I couldn't understand the headers of the xxx files so wrote functions to search for byte patterns.

    I will look at the improvements you suggested. Thanks

    ReplyDelete
  5. something weird happens when I replace the in-game ED49 with my edited one. All the original files return! how is this even possible?? I replace Mysterio's logo and Cenas and then once I add the custom ED49 over the original one, the files I changed are not there. Instead, the orignal files are there. How is that even possible?

    ReplyDelete
  6. Can this tutorial work on SV 2011 too? Can you give me a link or maybe tell me how to? I've searched everywhere But I can't..

    ReplyDelete
  7. Can this tutorial work on SV 2011 too? Can you give me a link or maybe tell me how to? I've searched everywhere But I can't..

    ReplyDelete