Required tools:
UPK Explorer (duh!)
ffdec/JPEXS Free Flash Decompiler (first app I found for this purpose)

When editing the BCChar or FEChar UPK to change the skin name in Object names and in a property in the RAddContentCharacterSelect class Object, you'll find a Thumb[CharacterName_OptionalSkinName] Package, with an identically named SwfMovie Object and a suffixed "_l1" Texture2D Object inside. Rename these as well, and click "Export .swf" so we can edit it.

Open the exported SWF file in ffdec. In its Resources you'll find an ExporterInfo tag in the "others" folder, and the name of the package and SwfMovie object in it as the swfName string. Click the Edit button and change the string here too. Don't forget to click "Save" where the "Edit" button was when you're done.




Then, you'll find a DefineExternalImage tag in the "images" folder. It should be a red square. To edit it, right click the tag in the Resources or the tab on the right itself, and click "Raw edit" in the context menu. You'll find here the name of the Texture2D object as the fileName string, but this time with a .tga extension. Edit this too, leaving the extension as is.



Now you can click "Save as..." and save the file... as a ScaleForm GFx file, not SWF! Yes, the recompiling works differently based on what you export the file as, and despite UPK Explorer calling it a SWF file, it's a GFx file.

Now that you've saved the GFx file, go back to UPK Explorer and click "Import .swf", and point it to the GFx file. The explorer open window will automatically filter SWF extension files, so change the filter to "All FIles (*.*)" or rename the GFx file and change its extension to ".swf" after having saved it as ".gfx file.

After you've saved the renamed changes in a copy of the UPK, open that result again, go to the Export textures tab, and extract the texture icon we talked about before, the "Thumb[CharacterName_OptionalSkinName]_l1."

Go to your working folder set by "Set working folder" in UPK Editor and move that exported DDS from Exports/PF_DXT5 to Imports/PF_DXT5, edit the .dds file to be whatever icon you want with whatever .dds image editing file you use, and save it in DXT5 format, with no mipmaps. Go back to the package in UPK Explorer and inject the newly edited texture from Imports/PF_DXT5 in the "Inject textures" tab.

And you should be done!
0 comments