Flow754's Peg Assembler

Until now, it was impossible to make new peg files without going through a lot of hex editing. You could in fact only modify old texture files using SR3's Texture Utilities by @scanti. Back in the day, this caused no problems because loading new textures wouln't work anyways, but now that there's the modding patch, this tool will enable you to create texture files for all kinds of mods (e.g. UI, Clothes, Tattoos etc.).

Features:
- Creates SR4 texture files from scratch
- Assembles up to 8 dds files *outdated*
- Supports DXT1, DXT3, DXT5 and A8R8G8B8 dds files

Version 1.1:
-Fixed packaging of non-square textures

Version 2.0:
-Added an actual user interface
-Added support for animated textures
-Raised the maximum amount of bitmaps from 8 to 65535

Version 2.1:
-Fixed a bug related to memory allocation

Version 2.2:
-Fixed another bug related to memory allocation

Version 2.3:
-Fixed a bug that prevented the tool from opening on some computers
(tested on windows 7; please contact me if it still doesn't work for you)

Tutorial:

First of all, drag and drop your image files into the application's window. Make sure your textures' names end with ".tga.dds". You can adjust an arbitrary bitmap's position by selecting it and clicking up/down. This will also affect the order in which the frames are played if you create an animated texture.

interface.png



Then, enter the name you want to give your peg files and specify the output URL.
If you want to create an animated texture, click the checkbox and adjust the framerate. If you check this option, the game will no longer treat your images as separate textures, but as frames of a single animated texture.

Example of an animated icon ingame: http://i.imgur.com/RnV7bTL.gif

Special thanks:

Knobby, for giving me all the information I needed to create this tool.
Scanti, for making the SR3 Texture Utilities.
 

Attachments

  • pegAssembler_byFlow754_v2.3.rar
    86 MB · Views: 1,970
Last edited:
I just released version 2.0! This major update comes with a stylish interface as well as some new functionality. I'd really love to see you guys go nuts with animated textures, so don't bother to ask me any questions regarding the tool.
 
Hi. I want to make animated logo on my shirt but what should I do? I have _d.tga, _n.tga and _p.tga (the last one is the logo which I want to animate). I know I have to create frames ( _p1.tga, _p2.tga, _p3.tga, ...) but what with _d.tga and _n.tga?
 
Hi. I want to make animated logo on my shirt but what should I do? I have _d.tga, _n.tga and _p.tga (the last one is the logo which I want to animate). I know I have to create frames ( _p1.tga, _p2.tga, _p3.tga, ...) but what with _d.tga and _n.tga?
Ladies and gentlemen, behold!
A step-by-step guide to creating animated textures:
0) Open "pegAssembler_byFlow754.exe" and drag and drop your *.dds files into the tool window.
1) Give your new peg files a name, check "Animated Texture" and adjust the framerate. Optionally you can also specify an output URL.
2) The *.dds you want to animate has to be placed at the very top of the hierarchy. This will also be the first frame of your animation. All subsequent frames have to be put below your starting frame in the correct order from top to bottom. Place all *.dds files you don't want to include in your animation below your last frame. (So, in your case, *_d.tga.dds and *_n.tga.dds should be the last and second to last image in your hierarchy.)
pegAssembler.PNG

3) Click "Create". Now you should have two new files in your output directory. A *.cpeg_pc and its corresponding *.gpeg_pc file.
4) Open your *.cpeg_pc file with a hex editor and go to its 45th byte, ergo position 0x2C.
hex.PNG

As you can see, in my case, its value is 0x05. This byte represents the amount of frames that belong to the animation of my first *.dds image. By default this value will always be the number of total images in the peg. Since there are two images in this peg that I want to exclude from the animation, I'll change this value to a decimal number of 3, or 0x03 in hexadecimal notation.
hex2.PNG

5) Save the changes you've made to your *.cpeg_pc file, repack your STR2s with your new *.cpeg_pc and *.gpeg_pc file and update your ASMs.
6) Put all your STR2s and ASMs into your SRIV root directory.

Hope this helps!
 
Last edited:
Back
Top