Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Making new heads (modeling)

Page: 1 of 1
 Trex
10-16-2008, 6:36 PM
#1
Original Thread (http://www.lucasforums.com/showthread.php?t=193025)

Okay, here we go. First ever tutorial. Mods feel free to move it to the tutorial section if they like.

BTW : This does not contain typos. It contains 'English spelling.':xp:

Tutorial – Modeling a new head

What you’ll need :
- KOTOR tool (see here http://www.starwarsknights.com/tools.php)
- GMax with NWmax plugin. (gmax : http://www.turbosquid.com/gmax), NWmax : http://nwmax.dladventures.com/)
- Photoshop or Gimp (You'll have to buy PS, but gimp is here : http://www.gimp.org/)
- Mdlops (here again : http://www.starwarsknights.com/tools.php)
- Taina’s replacer tool (Request it in this thread : http://www.lucasforums.com/showthread.php?t=167699). Someone will sort you out)

Edit: Now you can download Taina's Replacer from here. (http://knightsoftheoldrepublic.filefront.com/file/Tainas_Replacer_for_KotOR_and_TSL;95792)

SS
- Kgff editor (This page again : http://www.starwarsknights.com/tools.php)
- Notepad & pen are handy

Part 1 – Getting ready/extracting everything you need

Note that I here describe the long way of doing it to help all first timers. Once you do this a few times, you probably won’t need to go through every stage.

First of all, just create a new folder on your desktop and call it ‘new head’, or something similar that you’ll remember. Inside this folder, create another one, and call it output.

Now, hopefully you’ll have a vague idea of what you want your head to look like, or even better a design. Since it’s kinda impossible to model a head from scratch, you’ll have to rack your brains and try to think of a character in KOTOR2 which looks sort of similar. For this example, I will take the ever popular Bastila.

All heads are divided into three parts ; the mdl, the mdx, and the tga. That’s two model files and one texture. To find these, first open KOTOR tool, and go to : KotorII > BIFs > templates > Blueprint, character. Here you will see a long list of all the various characters in the game. Look through the entire list until you find the character who’s head you wish to manipulate. In this case, it’s near the bottom of the list and named ‘p_bastila’.

(Another way of doing this bit is to extract the character template from the individual module. Go to : KOTOR II > RIMs > Modules > ‘whichever module’ > Blueprint, characters. This method may be better if you wish to convert the head of a more minor chapter. Replace ‘whichever module’ with wherever the person can be found. PER=pergaus/TEL=Telos and so on. )

Click on the template file, click ‘extract file’, and save it to the folder on your desktop.

Open kgff editor, and open the file you just extracted. At the very top, it should have a row named ‘Appearance_Type’, followed by a number. Make a note of the number, in this case 4. Close Kgff.

In KOTOR tool, go to : Kotor II > BIFs > 2da.bif > 2D array. Find the file ‘appearence.2da’, and double click. To the far left, you will see that each row is numbered. Find the row number you just made a note of, 4. Move along the row until you come to a column named ‘normal head’, and make a note of the number there. In Bastila’s case, 1. Close the file.

In KOTOR tool again, go to Kotor II > BIFs > 2da.bif > 2D array. This time find ‘heads.2da’ & double click. Find the row you just made a note of, 1. Under the ‘head’ column, find what’s written, in this case ‘P_BastillaH’. This is the name of all the files you want. Make a note of it.

In KOTOR tool, go : KotorII > BIFs > models.bif > Aurora model. Scroll through this exceptionally long list until you find ‘P_BastillaH’. Extract/save it to the folder on your desktop.

In KOTOR tool, go : KotorII > BIFs > models.bif > Aurora model extension. Find ‘P_BastilaH’ again, but with the mdx on the end. Save to desktop folder.

Finally, go : KotorII > ERFs > TexturePacks > swpc_tex_tpa.erf > P. Find ‘P_BastilaH’ and save to desktop folder. It may have a number, such as 04, but save it anyway.

That’s everything you need. Onto part 2.

Part 2 – Editing the head.

Open up Mdlops. Make sure Kotor2 is highlighted, as opposed to Kotor1, click select file, then open the head file ending with a mdl extension. Make sure extract animations is ticked. Make sure convert skin to trimesh isn’t. Click read and write model.
Watch the big black window until it says “Finished processing model”. You have just created a new file ending in ascii. Close Mdlops.
Now open up Gmax using the green NWmax icon. This won’t work if you just open it normally.

It should look something like this.

http://img385.imageshack.us/img385/6277/tutpic1ka5.jpg)

Click MDL loading in the left toolbar (red circle), and a little sub section should drop down. Click Browse (green circle), select the model file from your folder with the acsii extension. Just below, make sure ‘import Geom+anims’ is selected. Click the big import button. As the file imports, you might get a few errors. This is normal, just keep clicking OK.

http://img78.imageshack.us/img78/4310/tutpic2qc7.jpg)

It should look something like this. In order to modify the head, select the modify tab in the right toolbar (red circle). Click on the ‘select and move’ tool (green circle). Click somewhere on the actual head in any window. The right toolbar should change a bit.

Click ‘editable mesh’ (light blue circle). Now click Vertex (orange circle). Little blue dots should appear all over the place. Moving these blue dots (vertices) around are what creates a different shaped head. Important! : To move them, don’t just click and drag. Click and drag your mouse over it (or a few of them), they should turn red, then use the X, Y and Z axis that appear to shift them.

TIPS :
- The heads are actually divided into several sections. If you want to move a part of the head, but can’t see a blue dot by which to do it, unclick ‘vertex’ in the right toolbar, click on another section of the head, then click ‘vertex’ again.
- In the far bottom right are a set of eight useful buttons. The little hand, ‘pan’, will allow you to move the four views around. The magnifying glass is zoom, as is your mouse wheel if you have one. ‘Arc rotate’, looking a bit like a pie chart, will allow you to rotate the 3D view to get a better look.
- NEVER, EVER delete a little blue dot. The model will fail.
- Try not to overlap any of the lines connecting the blue dots. The model may still work, but things may go a little ‘weird’.
- You can save this project with Gmax anytime and come back to it, Just make sure you don’t move the desktop folder.

Part 3 - Compiling the head for use in game.

http://img185.imageshack.us/img185/7169/tutpic3bf0.jpg)

When you have the head in the shape you want, use the ‘select and move’ icon/cursor to click on the blue box under the model. This is a little complicated to explain, but you must click the side of the box, and an actual line, not between (red circle). When you get it right, the right toolbar should change to how it looks above (blue circle).

Click browse, and select the ‘Output’ folder inside your desktop folder. Now, click ‘Export model+anim’. If ‘sanity check fails’, just click yes and ignore it. Now this is the complicated bit :

1 – Go into the output folder and change ‘P_BastilaH’ to ‘P_BastilaH-ascii_new’. If it’s a different file name, add ‘ascii_new’ to the end.

2 – Highlight the original mdl and mdx files in your desktop folder, P_BastilaH.mdl & P_BastilaH.mdx. Copy and paste them into the output folder. Also copy and paste over the file with the ascii extension.

3 – Open Taina’s replacer tool. Click ‘open ASCII Models’.

4 – First, find and open ‘P_BastilaH-ascii’. In the second box, click and open ‘P_BastilaH-ascii_new’. The first time you do this, you might get an error. Just try it again. Should work the second time.

5 – There should be two columns full of boxes now, the left one full of ticks. Untick all of these apart from the ones that apply to the part of the head you altered. Leave all of them ticke dif you want. If you can find a general ‘head’ one, I find this is often all that needs to be selected. In this case, ‘head_g’.

6 – Click ‘start replacing’. Select the original mdl file, ie P_BastilaH.mdl, from ‘output’. On the next box, save as p_bastilah_new. Name it exactly like that, don’t use anything other than '_new'.

7 – Click ‘start replacing’ again. From the bottom drop down box, change ‘Files of type’ to mdx. Open p_bastilah.mdx. In the next box, save as ‘p_bastilah_new.mdx’. Save exactly like this, including manually typing in the mdx extension.

8 – Close the replacer tool. Go into your output folder. Find p_bastilah_new.mdl and p_bastilah_new.mdx. THESE ARE YOUR NEW HEAD! Put them somewhere safe and rename them something else if you fancy. Feel free now to delete everything else apart from P_BastilaH04.tga.

Part 4 – Texturing the head aka 'colouring in'.

Essentially what you've created so far is the physical head without the skin. The game will register it in a certain way, but it won't visually show up.
Open P_BastilaH04.tga in Photoshop or Gimp. You can probably see already sort of how this works. The flat picture folds around the frame of the model you just made, creating the skin. It should be obvious where the hair and skin is. Obviously, this part of the tutorial will vary on what exactly how you want the character to look, so I will instead go through some quick handy tips and commonly used functions. Since I use it, I will describe these in relation to photoshop.

4a – Recolouring hair. In photoshop, go to the left hand toolbar. The 'colour replacement tool' shares the same icon space as the brush and pencil tool. Once you select the tool, use the colour box lower down to select a shade of yellow. Click and drag the cursor over the hair and it should change to a shade of blonde. If you want to change the skin tone, same principal applies, just move the cursor over the skin area instead.
4b – In the right hand toolbar, there is what looks like a rubber stamp icon. This is the clone stamp. It can copy parts of an image onto another.
Another way to get, say, blonde hair would be to use it. Find an image of blonde hair online that you want to copy. Open it in photoshop. On the Internet image, hold the ALT button and click on the part of the image you want to copy. Let go of ALT.
On your skin image, normal click and drag over the area you want to replace.
For a much more thorough tutorial on photoshop functions, I highly recommend this thread : http://www.lucasforums.com/showthread.php?p=2515747#post2515747)

When you are done, place it with your mdl and mdx files from before and make sure they are all named the same, whatever you want to call them.

Part5 – Placing your head into the game.

If you want to use this as a new PC and for your own amusement, the easiest way to do this is to override on of the existing ones. In Kotor tool, go to Kotor II > BIFs > 2da.bif > heads.2da. The rows named PFH are the female player characters and the PMH the males. Name your three files the same as one of these, say PFHC01, then place them all in your game override directory. When starting a new game, your new head should come up as one of the options.
For a more thorough description of creating a new PC head, I highly recommend this tutorial : http://www.lucasforums.com/showthread.php?t=149992)

Think that's it. Any questions, feel free to PM me.
Page: 1 of 1