Salk

[KotOR] Using a head model/texture

Recommended Posts

Hello!

In an attempt of diversifying the look of some denizens of the KotOR world, I wanted to use some heads (created, for instance, as replacement for Player heads) for specific NPCs.

From what I understand it is enough to add an entry to the heads.2da file and then there are three needed files: one .mdl, one .mdx and one .tga.

I have never worked with model editors and I was wondering how I can, for example, change a PMHC01 set to instead be used for an NPC. I am pretty sure it is not enough to rename the file to whatever I want because from what I understand from loading the .mdl file into MDLEDit the model's header still calls for PMHC01, even after I changed the texture's name using EDIT -> Textures. I see there is an HEX mode but I don't seem to be able to edit the content and even if I could, I may very well mess things up.

Any advice/tutorial that can be recommended for beginners?

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, Salk said:

I am pretty sure it is not enough to rename the file

Correct. The filename must match the Odyssey/AuroraBase name. Changing the filename alone is insufficient and will potentially lead to problems.

The old way used to be hex editing to change the names of both the Base and any textures. It may still be desirable to go that route due to issues both MDLEdit and MDLOps have with generating incorrect smoothing data. There are few free hex editors around, like HxD or Frhed for Windows, although it's not exactly a user-friendly approach.

Your other option is to decompile to an ASCII with either MDLEdit or MDLOps, edit in a text editor, then recompile back into a binary. While MDLEdit will let you edit texture names directly in the editor, it doesn't offer Base renaming, so editing the ASCII is your only option.

Once you have a custom head with a custom texture, you can add it to heads.2da, You will also need a new entry in appearance.2da that points to the head ID. You can edit the appropriate UTC to point to your new appearance.2da row ID.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Salk said:

Hello!

Hello, Salk! :cheers:

Quote

Any advice...

Well, I can direct you to an instructive tutorial by DP himself which is the gate-opener for my modding journey. You should definitely check this one out:

Spoiler

Edit: I have noticed that the information I provided bit off ahead of what you were asking but, in case you decided for an overhaul or at least continuing from this part-

Quote

Once you have a custom head with a custom texture, you can add it to heads.2da, You will also need a new entry in appearance.2da that points to the head ID. You can edit the appropriate UTC to point to your new appearance.2da row ID.

; seek no further. :cheers:

Edit2: Ah, now I get the point, @Salk!

So,

Quote

...loading the .mdl file into MDLEDit the model's header still calls for PMHC01...

if you want to change the header of PMHC01 to something like slk_npch, as seen in an image below:

Edit_Values.JPG.6be4b4b6bb0a08dce5f2077664c143a8.JPG

You can change the header to match the model/file name. You can pretty much using right-click with any mesh inside to match them with the custom texture you've made available. Let us know of the progress on your end.

Edited by ebmar
Information regarding 'header' editing has been added
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello again!

I have more or less managed to use MDLEdit to do what I wanted to, by converting the BIN to ASCII then use a simple text editor to rename the model to what I wanted and then reconverting from ASCII to BIN. Thanks for the extra help though, ebmar! Much appreciated.

I noticed (using plenty of the material found in the excellent Space Alex's K1 Enhancement Pack that I often get names mismatches logged under AR_ERROR. 

I believe it is harmless enough but I would like to investigate what it may mean.

Any advice?

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

If you are getting errors, you didn't change all of the instances of the Base name. Seeing as MDLEdit does actually allow you to edit the Base name, as @ebmar pointed out above (contrary to what I thought), then I would suggest you stick with using that. You're probably less likely to get yourself in trouble.

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Salk said:

I noticed (using plenty of the material found in the excellent Space Alex's K1 Enhancement Pack that I often get names mismatches logged under AR_ERROR.

Yup, many mismatched names were found in the old mods and in fact Obsidian's TSL did this on their vanilla pmbnm model which its header written as pmbmn.

Quote

I believe it is harmless enough...

In the earlier times I did ignore the situation and did not found any major problems beside the generated AR_ERROR.log. But in later practice I did make sure every model I get either from my end or from others end gets their naming right.

And yes, to reiterate DP's quote earlier-

Quote

You're probably less likely to get yourself in trouble.

:cheers:

Edited by ebmar
  • Like 1

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.