Now that the issues with OpenIV and ped export/import have been fixed, you can edit default ped models. Doing much more than basic model editing is kind of complicated, and requires 3D modeling knowledge.
However, there is one very useful thing you can do without knowing 3D modeling: combining different ped meshes.
What is a ped mesh? It's a component like head_002 or uppr_001. For example, for skinny cops, the long sleeve shirt is one mesh, and the leather jacket is another. By combining them, you can have cops with only short sleeves and jackets; cops with state trooper pants; state troopers with a regular cop's long sleeve shirt (instead of their weird one); etc.
So how does this work? To start with, you need OpenIV. OpenIV can export .wdd files to its own format, called openFormats. Crucially, openFormats are text-based. To export a model to openFormats, first navigate to componentpeds.img (click the arrow next to GTA IV or EFLC, under pc\models\cdimages).
Then, right click it, and select "Export to openFormats (.odd)".
Make a new folder somewhere, and select it. Then, hit "OK".
Open the .odd file in your favorite text editor.
Each gtaDrawable section represents one mesh. It doesn't contain the actual mesh; all it does is to tell OpenIV about the mesh when you import this back in at the end, so OpenIV can set up the .wdd properly. Let's look at one section of it:
gtaDrawable lowr_001_u
{
shadinggroup
{
Shaders 2
{
gta_ped.sps LOWR_DIFF_001_A_UNI LOWR_NORMAL_001 35.00000000 0.20000000 1.00000000;0.00000000;0.00000000 LOWR_SPEC_001 1.00000000
gta_default.sps LOWR_DIFF_001_A_UNI
}
}
skel
{
skel m_y_cop.skel
}
lodgroup
{
mesh
{
high 1 m_y_cop\lowr_001_u_high.mesh 0 9999.00000000
med 1 m_y_cop\lowr_001_u_med.mesh 0 9999.00000000
low none 9999.00000000
vlow none 9999.00000000
center 0.00081600 0.07059900 -0.52030600
radius 0.54099200
aabb.min -0.23394000 -0.14672600 -1.00492300
aabb.max 0.23622800 0.28086400 -0.02737300
}
}
}
Seems complicated, right? We don't actually need to worry about most of it. Let's go through line-by-line:
gtaDrawable lowr_001_u
This is the mesh name. The lowr_001_u tells OpenIV what mesh it's dealing with. The lowr means that this is a lower-body mesh (i.e., a pair of pants). The 001 is the number of the mesh. The rule for these is that they have to be unique within a given type, and range from 000 to 00n, where there are n+1 meshes of that type (i.e., there is lowr_000_u and lowr_001_u; uppr_000_u through _003_u; etc.) Worry about this at the end. I don't know what the _u is; since we're not making our own meshes, just keep it _u if it started as _u (which seems to be clothes), _r if it started as _r (seems to be heads), etc. All you would ever need to change is the number; the lowr_ and _u should stay the same.
gta_ped.sps LOWR_DIFF_001_A_UNI LOWR_NORMAL_001 35.00000000 0.20000000 1.00000000;0.00000000;0.00000000 LOWR_SPEC_001 1.00000000 gta_default.sps LOWR_DIFF_001_A_UNI
Ignore the numbers. All you need to care about is the LOWR_*_001_* parts. Those represent textures for the model. Now, GTA seems to select ped textures its own way; read my tutorial on ped textures for details. This probably just controls OpenIV's preview of the ped. Even so, you may as well update it when you have to. Again, all you'd change is the number in there.
skel m_y_cop.skel
This defines the skeleton that this mesh maps to. You want it to be the same as the name of the odd file, but .skel instead of .odd.
high 1 m_y_cop\lowr_001_u_high.mesh 0 9999.00000000 med 1 m_y_cop\lowr_001_u_med.mesh 0 9999.00000000
This is the key part of the section. It tells OpenIV where to find the mesh file. In your folder, you should have seen a subfolder called m_y_cop (or whatever). That has a lot of .mesh files inside. The m_y_cop\lowr_001_u_high.mesh is actually literally a filepath for the mesh. OK, this explanation of the file format is done. The next post will have a tutorial to do stuff with these files. How do we do stuff with this format? Some stuff should be clear. For example, let's say we want to get rid of the raincoat (uppr_003_u). We just delete that section in the odd. That's all. (in this case, we'd also delete lowr_001_u, because it's the pants that go with the raincoat, but that's a special thing about m_y_cop). Note also that if we instead had deleted uppr_002_u, we'd have to renumber uppr_003 to uppr_002. How do we renumber? We need to change the number in the header and in the textures section. Don't change it in the meshes section. This is key: under no circumstances should you modify the path to the mesh. Now, let's do something cool: adding the white cop head. This is easier than most additions, because the textures for the head are already in m_y_cop.wtd. Here's how we do it: First, export m_y_cop.wdd (the GTA IV rendition, not the EFLC one. If you have EFLC, you can find this rendition in pc/models/cdimages/componentpeds.img; the EFLC-specific one is in the TBOGT and TLAD directories, and while this would work, the textures aren't already there, so it's harder). Next, we need the mesh for the white head. Fortunately, as Custo discovered, TLAD's m_y_prisonguard.wdd is just a modified version of IV's cops. In particular, it has all 3 heads (though it doesn't have a raincoat or short sleeves). So, we want to export that to the same folder we exported m_y_cop.wdd to. Next. open both of the .odd files in a text editor. Find the section called "gtaDrawable head_002_r" in m_y_prisonguard.odd. Copy it into m_y_cop.odd, just before the final closing brace (but after the second-to-last brace). Since it has the right number, all we need to do is change the skeleton. Change it from m_y_prisonguard.skel to m_y_cop.skel. Save the file. We're now done with the openFormats (see how easy that was?) Now, all that's left is importing it back in. OpenIV can do this too. Go to componentpeds.img, and click the "Edit Mode" button up top. Under "New", select "Import openFormats". Browse to m_y_cop.odd, hit OK, and wait for it to finish. Now, double click m_y_cop.wdd to preview it (this specific feature is why I first started using OpenIV above SparkIV). Select head_002_r, and check that it looks OK. If it doesn't, you made a mistake somewhere (you didback up, right?) It probably does, though. If it does, you're done! Launch GTA and see the white cops now patrolling Liberty City! For more advanced mesh combinations, there are additional steps. First, you need to renumber the mesh you add so it doesn't conflict (or, if you remove a mesh, renumber the other meshes so they have the proper range). Other than that, the biggest issue you're likely to face is textures. GTA doesn't seem to care about the texture you assign in the openFormat. Instead, it matches textures to meshes the following way:
uppr_001_a_uni
reads as
*meshname*_*letter*_*race*
(letter acts like the mesh number). If you read my "Ped Texture Discoveries", you saw more detail on this. What does it mean for you?
Well, let's say you delete a mesh, renumber, but don't fix textures. What you get is the texture for, say, the long-sleeved shirt being applied to the jacket. This can look really weird, and is definitely not what you want. So, what you have to do is delete the textures for the mesh you removed, and renumber the higher textures. To rename a texture in OpenIV, make sure you're in Edit Mode, open the wtd, and double click the specific texture. Enter your new name. To delete a texture, highlight it and hit "Delete" on your keyboard. Obviously, you have to delete or rename a texture before you can give another texture its name.
Also, if you have added a mesh, you need to add textures for it. What you want to do is drag the appropriate textures from OpenIV to some folder (click the name on the left of the wtd browser, and drag to Windows Explorer). They'll show up as PNGs. Renumber the textures by changing the number in the file name. Then, open the wtd for the model you're changing, and drag the PNGs to the window. Hit "OK" for mipmap generation, and you're done.
Any questions? Comments? Other ped modelling information? Post below!
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.