N-DReW25

Creating new NPC's via appearence.2da

Recommended Posts

So for an upcoming mod that I am making I need to make new Twi'lek's for the mod so it will obviously have an appearence.2da involved.

 

I have done some NPC's for example green female twi'lek Sith officers and orange male twi'lek Czerka and Sith Officers but I have found a cut blue male Twi'lek head texture that i'm interested in making it into an NPC

 

 

 

Problem is i'm having trouble making it with the texture I want. So I need someone to tell how to make a custom NPC with a custom texture like what I'm doing?

post-23972-0-89894100-1478166395_thumb.png

Share this post


Link to post
Share on other sites

Make a copy of the Twi'lek male head model, give it a unique new filename, then hex edit it and change the texture name (you must keep the same number of characters). Create a new row in heads.2da that references your new Twi'lek head. Then create a new appearance.2da row as you presumably have done previously, and specify your new heads.2da ID number in the normalhead column. Make sure when setting up TSL Patcher that you specify the heads.2da info first, so that the memory tokens can be set correctly.

Share this post


Link to post
Share on other sites

txi files aren't related to models, what you need is the .mdl and the .mdx file. Those are located in BIFs > models.bif > Aurora Model for the .mdl files and BIFs > models.bif > Aurora Model Extension for the .mdx file. To figure out which one of these is the Twi'lek head, open up heads.2da, find the Twi'lek head line and see which model it uses (it's the head column).

Share this post


Link to post
Share on other sites

Okay this is going horrible. I made it up to model.bif but there is no little plus button so I can't expand it but the model.bif for Kotor 2 TSL is working but this mod is for K1.

Share this post


Link to post
Share on other sites

If all you want is the existing K1 twilek_m03 texture variant, it already has an entry in K1's heads.2da. Just add a new appearance.2da row that uses a normalhead value of 67. If you want a new, custom, texture, then follow the below.

 

If you look in heads.2da, you'll see the model names in the heads column. The Twi'lek head models (in both games) are:

 

twilek_f twilek_f02 twilek_f03 twilek_f04

twilek_m twilek_m02 twilek_m03

 

With F designating female, and M male.

 

You'll need to extract the appropriate MDL and MDX from

 

BIFs -> models.bif -> Aurora Model

 

and

 

BIFs -> models.bif -> Aurora Model Extension

 

Note that you need to select the appropriate files and hit the Extract button, don't double click on them. That converts them to ASCII with MDLOps, but you want the original binary files.

 

Next you'll need to do some hex editing. I'm not going to provide a blow by blow account of how to do that here. The gist though is to choose a new model name and a new texture name with the same number of characters as the originals, rename the MDL/MDX files to your new filename, open the MDL in a hex editor and do a Find and Replace on the appropriate values. As is common with KOTOR models, these Twi'lek heads (with the exception of twilek_f/twilek_m) use the same name for both model and texture. So for example you could take twilek_m02 and replace all instances of that with something like twilek_m27 (whatever you want, as long as it is the same number of characters as the original). Create your texture with the same name. Then go through the 2DA editing process I outlined above to add your new entries.

 

Now you could say that this is the "proper" way to add custom head variants, and perhaps the only way for K1. But for TSL they added a new column to heads.2da called alttexture where you can specify an override texture. If you look at how they set up the vanilla Twi'lek heads, you can see that they just specified the first model (twilek_f/twilek_m) and then specified the variant texture (Twilek_f07, twilek_m04, etc.) in the alttexure column. So for TSL you can get away without hex editing.

  • Like 1

Share this post


Link to post
Share on other sites

If all you want is the existing K1 twilek_m03 texture variant, it already has an entry in K1's heads.2da. Just add a new appearance.2da row that uses a normalhead value of 67.

Thanks for that though I apologize for being annoying but could you retype that tutorial again but using the Sith Trooper Model as I will be doing a mod that adds in a new type of Sith Soldier.

Share this post


Link to post
Share on other sites

The Sith Soldier is a full body model, so its textures can be directly overriden via appearance.2da. Look at rows 28, 44, 261 in K1's appearance.2da and you'll see the 3 types all use the same model, they just specify different textures.

Share this post


Link to post
Share on other sites

The Sith Soldier is a full body model, so its textures can be directly overriden via appearance.2da. Look at rows 28, 44, 261 in K1's appearance.2da and you'll see the 3 types all use the same model, they just specify different textures.

So if I can make a new Sith Soldier with a new texture using just the appearance.2da what values would I have to switch to get the right texture which I'll presume would have to be N_SithSoldier04.tga. 

Share this post


Link to post
Share on other sites

The texture name can be whatever you want. There's no hex editing involved, so no character limitations. Just make a new appearance.2da row that duplicates one of the existing Sith Soldier rows and change the texture to whatever you named yours.

Share this post


Link to post
Share on other sites

The texture name can be whatever you want. There's no hex editing involved, so no character limitations. Just make a new appearance.2da row that duplicates one of the existing Sith Soldier rows and change the texture to whatever you named yours.

Okay you lost me there. I made the duplicate of the Sith Soldier 1 row and I have a new texture called N_SithSoldier04.tga, so what do I do to make the duplicate Sith Soldier 1 show the new Sith Soldier 4 texture.

Share this post


Link to post
Share on other sites

I guess you need to change the number "1" to "4" in references to the N_SithTrooper01 texture in your copied appearance.2da row.

Share this post


Link to post
Share on other sites

I guess you need to change the number "1" to "4" in references to the N_SithTrooper01 texture in your copied appearance.2da row.

By "References" are you referring to something in the appearance.2da because if you are I have no clue what your talking about. I have changed the label "Sith_Soldier_01" to "Sith_Soldier_04" and that didn't do anything.

 

I guess you need to change the number "1" to "4" in references to the N_SithTrooper01 texture in your copied appearance.2da row.

I am lost for what you meant at that point.

Share this post


Link to post
Share on other sites

I suggest you have a look at my post on 2da files. That should help you figure out how appearance.2da actually works so that you no longer have to blindly follow tutorials.

 

But to answer your question: You need to replace the texture used. Those are specified in the racetex and/or model*tex (where * is a letter from A to J) columns. So check the original Sith Soldier rows and in each texture field that has for example Sith_Soldier01 as the texture to be used, change it to Sith_Soldier04. That will tell your new apperance to use your new texture.

Share this post


Link to post
Share on other sites

I suggest you have a look at my post on 2da files. That should help you figure out how appearance.2da actually works so that you no longer have to blindly follow tutorials.

 

But to answer your question: You need to replace the texture used. Those are specified in the racetex and/or model*tex (where * is a letter from A to J) columns. So check the original Sith Soldier rows and in each texture field that has for example Sith_Soldier01 as the texture to be used, change it to Sith_Soldier04. That will tell your new apperance to use your new texture.

So I think I found what you mean but there is nothing in the texture feild. The first texture feild modela and texa have N_SithSoldier and the rest through to J have just ****. So do I still replace the **** with Sith_Soldier04

Share this post


Link to post
Share on other sites

You didn't use the proper texture name. Your texture's filename is "N_SithSoldier04" but you put "Sith_Soldier04" in the 2DA. You also only need to change the values in the racetex and texa columns.

 

I presume you are changing the appearance ID in the appropriate UTCs as well? You'll also need a save before entering the area you want to test in for the first time.

Share this post


Link to post
Share on other sites

You didn't use the proper texture name. Your texture's filename is "N_SithSoldier04" but you put "Sith_Soldier04" in the 2DA. You also only need to change the values in the racetex and texa columns.

 

I presume you are changing the appearance ID in the appropriate UTCs as well? You'll also need a save before entering the area you want to test in for the first time.

It Worked.Thanks so much to all of you and don't worry about the UTC bit I know what I'm doing with that.

Share this post


Link to post
Share on other sites

If all you want is the existing K1 twilek_m03 texture variant, it already has an entry in K1's heads.2da. Just add a new appearance.2da row that uses a normalhead value of 67. If you want a new, custom, texture, then follow the below.

 

If you look in heads.2da, you'll see the model names in the heads column. The Twi'lek head models (in both games) are:

 

twilek_f twilek_f02 twilek_f03 twilek_f04

twilek_m twilek_m02 twilek_m03

 

With F designating female, and M male.

 

You'll need to extract the appropriate MDL and MDX from

 

BIFs -> models.bif -> Aurora Model

 

and

 

BIFs -> models.bif -> Aurora Model Extension

 

Note that you need to select the appropriate files and hit the Extract button, don't double click on them. That converts them to ASCII with MDLOps, but you want the original binary files.

 

Next you'll need to do some hex editing. I'm not going to provide a blow by blow account of how to do that here. The gist though is to choose a new model name and a new texture name with the same number of characters as the originals, rename the MDL/MDX files to your new filename, open the MDL in a hex editor and do a Find and Replace on the appropriate values. As is common with KOTOR models, these Twi'lek heads (with the exception of twilek_f/twilek_m) use the same name for both model and texture. So for example you could take twilek_m02 and replace all instances of that with something like twilek_m27 (whatever you want, as long as it is the same number of characters as the original). Create your texture with the same name. Then go through the 2DA editing process I outlined above to add your new entries.

 

Now you could say that this is the "proper" way to add custom head variants, and perhaps the only way for K1. But for TSL they added a new column to heads.2da called alttexture where you can specify an override texture. If you look at how they set up the vanilla Twi'lek heads, you can see that they just specified the first model (twilek_f/twilek_m) and then specified the variant texture (Twilek_f07, twilek_m04, etc.) in the alttexure column. So for TSL you can get away without hex editing.

I know this is out of the blue but can I please have an explanation like this for custom unique textures for the Republic Soldier Body Model or just body models in general?

Share this post


Link to post
Share on other sites

Body models have their textures overridden by appearance.2da. You specify the base texture name in appearance.2da, then any colour variants get number suffixes which can be specified in the relevant UTI (for player armour/robes). Typically most NPCs just have one colour variant, so their texture just gets a "01" appended.

 

For example, in the case of Republic soldiers, there are four primary body models (I'm ignoring "lite" models here), N_RepOff, N_RepSold, N_RepOff_F, and N_RepSold_F which are male and female versions of soldiers and officers. The textures specified in appearance.2da are the same as the model names, however if you look at the actual texture filenames, you will see that they are N_RepOff01, N_RepSold01, N_RepOff_F01, and N_RepSold_F01, respectively. So all you need to do is follow the same pattern. For NPCs you are typically setting their appearance directly rather than using player armour, so just add a new appearance row and specify your custom texture, keeping in mind the naming convention I just outlined.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.