Jump to content

Home

Module Reskinning Tutorial


Darth InSidious

Recommended Posts

Everything You Never Wanted To Know About Module Reskinning And Have Been Forced To Find Out

 

By Darth InSidious

 

EDIT: Downloadable copy available here

 

I. Tools Required

 

1. KotOR Tool – essential for all KotOR modding.

2. GFF Editor OR K-GFF – to edit the module files. (Note that for this tutorial I shall be using a standard Bioware GFF Editor; however, if you wish to use cameras in your mod, you may wish to use tk102’s K-GFF, as the standard GFF editor will screw them up.)

3. Picture editor – PSP, Photoshop, the Gimp or something else. For this tutorial, I shall be using the Gimp, v2.0.

4. HEX Editor – For this tutorial, I shall be using xvi_32 by Christian Maas.

5. stoffe -mkb-‘s ErfEdit v02a8.

6. A legal copy of Star Wars: Knights of the Old Republic for PC

7. Notepad or a similar basic text editor.

8. One human(oid) brain, still encased in body, preferably living.

 

I.I – Skills Required

 

-Some understanding of KotOR Tool.

-Some understanding of module/GFF Editing and the files involved.

-Some understanding of skinning.

-Some knowledge of HEX Editing.

 

II. Introduction

 

Ever wanted your new module to be a little less same-y? Ever wanted to re-skin a module for your mod, but keep the original looking the same? Well, now you can!

 

This is an area which has been somehwat overlooked in the past, I feel, partly because it hasn't been in much demand. However, now such demand is increasing, and there aren't that many people who know exactly what to do. So I present to you a tutorial on this subject :)

 

Note that while I've gone into sometimes rather too-great detail for most people, this is NOT an all-singing, all-dancing tutorial. This tutorial does not cover reskinning, HEX-Editing, using KotOR Tool, or module editing.

 

It DOES cover module reskinning, and what to do to make that reskin apply only to your new module.l

 

III: Preparations, And Extracting Files

 

III.I – Preliminary Groundwork

To start with, I recommend creating a new folder. Call it anything you like – as an example, ‘New Module Project’. It’s best to choose something clear, so you can remember what’s in this folder later on.

 

Open the folder, and create a new folder inside it. I would call this one ‘Module’, for clarity.

 

III.II – Module File Extraction

Now, open up KotOR Tool, and select ‘KotOR I’.

 

Go to RIMs-->Modules, and select the name of your chosen module – for this tutorial, kas_m23ab.rim . Extract both kas_m23ab.rim and kas_m23ab_s.rim into the folder ‘Module’ that you created in your ‘New Module Project’.

 

III.III – Lightmaps, Layouts And Visibility

Close the RIMs-->Modules tree, and open BIFs.

 

Take a deep breath. Yes, there are a lot of options, but don’t panic!

 

Click on layouts.bif, and select ‘Layouts’, then scroll down until you find m23ab.lyt .

 

Click ‘Extract file’, and save it to the ‘New Module Project’ folder.

 

Now, close layouts.bif and open lightmaps7.bif and scroll down until you find the files which have names beginning ‘m23ab’ – these are the lightmaps for our module. Extract all of the files beginning ‘m23ab’, from m23ab_01a_lm0 to m23ab_01a_lm6 to the ‘New Module Project’ folder.

 

Now, close the TGA Images tab, and open the Extra Texture Info tab.

 

Again, scroll down until you reach m23ab_01a_lm0, and extract all seven files, from m23ab_01a_lm0.txi to m23ab_01a_lm6.txi, and then close the tab.

 

Now, open the vis tab, and select and extract m23ab.vis.

 

Now close lightmaps7.bif .

 

III.IV – Textures And Models And Walkmesh, Oh My!

 

This next bit is a little more complex, so follow these instructions carefully.

 

Open models.bif-->Aurora Model, and scroll down until you find m23ab_01a.mdl .

 

Double-click on m23ab.mdl, so that the Model Extraction Options box comes up.

 

Change the export path to your ‘New Module Project’ folder, and click OK.

 

(Note: Ensure that the ‘number of consecutive models to extract’ box is set to 1.).

 

When the notification that the extraction is complete comes up, click ‘OK’, and open the folder, and delete the file named m23ab_01a-ascii.mdl.

 

Now, in KotOR Tool, highlight m23ab_01a.mdl again, and click the ‘Extract File’ button. Extract it to your ‘New Module Project’ folder, and close the Aurora Model tab.

 

 

Open the Aurora Model Extension tab, and scroll down until you find the file named m23ab_01a.mdx . This file you should extract to the ‘New Module Project’ folder, and then close the Aurora Model Extension tab.

 

Lastly, open the Walkmesh tab, and scroll down until you find a file named m23ab_01a.wok . Extract this file to the ‘New Module Project’ folder, and close BIFs.

 

Congratulations! You have now extracted everything that is used by the game in creating this module.

 

IV. – Reskinning and Lightmapping.

 

Now, using KotOR Tool, open ERFs, and select TexturePacks. For this mod, we will use Texture Pack A, so select swpc_tex_tpa.erf . Open the subtree marked ‘L’, and scroll down to the files marked LSI.

 

Extract the following files and their TXI files (Note: To extract the TXI files, check the box marked ‘Export Selection to TXI file’, and highlight everything in the white text box):

 

LSI_lite02.tpc

LSI_lite03.tpc

LSI_trim01.tpc

LSI_trim05.tpc

LSI_wall02.tpc

LSI_wall03.tpc

LSI_wall04.tpc

LSI_wall05.tpc

LSI_wall06.tpc

LSI_wall11.tpc

LSI_grate01.tpc

 

All these will extract as .tga files.

 

Close KotOR Tool.

 

Now, open in the GIMP lka_bark01.tga and LSI_wall11.tga . You will probably notice that lka_bark01 is much bigger than LSI_wall11. This doesn’t matter. Copy LSI_wall11, and past it on top of lka_bark01. You will probably have to past it several times to make it cover the entire texture, but never mind. Once you’re done, save it, and close both files.

 

Now, reskin the rest of the files named ‘lka’, (Note: Some editing of the changed textures may be required- do so at your own discretion ;) ) and save them.

 

Delete all the files beginning ‘LSI’, and rename the ‘lka’ files to begin ‘lz1’, or some similarly unique identifier. Do not change the rest of the filename – only the first three letters.

 

Now, open the file named m23ab_01a_lm0.tga with the GIMP. This file is a lightmap, a type of file we know very little about. I do not recommend anything more than very basic editing of the type I will show you now.

 

Go to Layer-->Colours-->Hue-Saturation.

 

Move the slider next to the word ‘Hue’ all the way to one end. You will see the colours on the image change with it. Now, move the ‘lightness’ slider until the number next to it reads as ’30’. Finally, move the ‘Saturation’ slider back until the number next to it reads ‘-30’. Save and close the file, and repeat this process for the other lightmap (m23ab_01a_lm0-m23ab_01a_lm6) files.

 

Close the GIMP, and rename the lightmap files so that the name is changed from ‘m23ab’ to ‘m65aa’, or some similarly unique identifier.

 

While you’re at it, open the .lyt file with notepad, and change any references to ‘m23ab’ to ‘m65aa’. Close it, and then rename the file to ‘m65aa.lyt’. Do exactly the same with the .vis file. Also, rename the WOK file to m65aa.wok .

 

Optional: Creating A Mini-Map

 

It won’t crash your game if you don’t include one, but it is a useful thing to add in, and is a nice touch to add in ;)

 

Open up KotOR Tool, and open ERFs. Select swpc_tex_gui.erf , and scroll down to ‘L’. Open ‘L’, and scroll down again until you find a file named lbl_mapm23ab.tpc. Double-click it so that the image viewer window comes up, and click ‘write file’. Select to write it to your ‘New Module Project’ folder, and save it as lbl_mapm65aa.tga .

 

Close KotOR Tool, and open the new file in the GIMP. Using the Hue-Saturation tool, change the Hue to -180, and the Saturation to -50. Now, paint over the now-orange bar where the door is in the module in blue, with the paintbrush set to Normal, and the Opacity at 100%. I recommend a 3 pixel fuzzy tip.

 

Save and close the file, close the GIMP, and place the file in your override. Et Voila, one mini-map.

 

 

V. HEX-Editing And The Model Files

 

These things having been completed, open up your model file (m23ab.mdl) with your HEX Editor. You should be familiar with this device if you have ever done much work with lightsabre models.

 

On one side, you will see box after box of numbers. Ignore this. On the other, there will be what appears to be a random selection of characters, as well as (hopefully) ‘m23ab_01a’ without the quotes. You need to ensure that this side is selected, and so shows up in white.

 

Now, from the top menu bar, click ‘Search’, and then ‘Find’. Set it to search down, and search for a text string. Then, in the box provided for the search term, type ‘23ab’. Now click OK.

 

It will now highlight the ‘2’ of that first instance of ‘m23ab’. Now, type ‘65aa’. You will see the ‘23ab’ change to ‘65aa’. Now press ‘F3’ to find the next instance, and do the same thing to it. Keep doing this, until a box comes up saying ‘string not found’.

 

Now scroll back up to the top of the file. Open the ‘Find’ box again, and now change the search term from ‘23ab’ to ‘lka’. Now, replace all the instances of ‘lka’ with ‘lz1’. When this is done, save the file, and close the HEX Editor.

 

Now, rename the file to ‘m65aa_01a.mdl’. Also rename the .mdx file to ‘m65aa_01a.mdx’.

 

You have now created a completely new module, complete with textures, lightmaps, walkmesh etc.

 

Now all you have to do is implement it.

 

VI. Module File Editing.

 

Now, open the folder named ‘Module’, and open the file named ‘m23ab.are’ with your GFF Editor or K-GFF.

 

Scroll down until you find a CExoLocString marked ‘Name’. Set the STRREF to -1 and the Language to whichever language this mod is for (0 is English, and I believe that the others are listed in Darth333’s Recruitable Character tutorial). Type in a name – say, for example ‘Sith Military Hut’. This is what will show up above the map in-game, if you choose to create one.

 

Next, scroll down to ‘Rooms’, and open the sub-tab. Change the CExoString marked ‘Name’ from m23ab_01a to m65aa_01a. Finally change the ‘Tag’ entry to ‘m65aa’ without the quotes.

 

Now save and close the .are file, and rename it to m65aa.are .

 

Next, open the file named ‘module.ifo’. Find the List marked Mod_Area_List, and opening the struct within, change the Area_Name CResRef to m65aa. Find the CResRef called Mod_Entry_Area, and change its value to m65aa.

 

Now find the CExoLocString marked ‘Mod_Name’ and change the value in this to ‘m65aa’. Now save and close the file. Do NOT rename it.

 

Now, rename m23ab.git and m23ab.pth to m65aa.git and m65aa.pth respectively.

 

Now, open ErfEdit, and go to File-->New. Save the file as ‘m65aa’, and ensure the file type you have chosen is .mod .

 

Click the button with an open folder and a text file coming out of it, and select to open resources from the ‘New Module Project\Module’ folder. Select *all* the files inside, and click ‘Open’. Now, go to File-->Save. Now close ErfEdit.

 

Finally, copy m65aa.mod to your SWKotOR\modules\ folder, and take the files from the New Module Project folder (but NOT the ‘Module’ folder), and put them in your SWKotOR\Override\ folder. Now load the game, and type ‘warp m65aa’ into the console without quotes, and hit enter. This should take you to your new module.

 

So there you have it – you have now created your very own custom module file! Congratulations, and good luck :)

 

And the finished product should look something like:

finishedtut.jpg

Link to comment
Share on other sites

Nice tut. I just went trough this process on a new module I'm working on. It was a large area with a whopping 32 area models to edit. I mostly re-assigned textures from other modules to get the look I was going for.

 

Thanks for the lightmap skinning tip. I was able to change Nar Shaddaa from night to day. Which gets me closer to putting together a landing pad for my new module.

Link to comment
Share on other sites

  • 4 weeks later...

Hey DeathDisco,

 

Can you outline how you did this for TSL? I also want to change NAR Shaddaa to daytime. I can do it in kotor, but there are some differences in TSL (different file locations, differences in the .lyt, etc...) When I tried it in TSL, it didn't crash, but it didn't load properly either. The walkthrough says to change all references to 301NAR(or whatever module) in the .lyt file. What about the file dependency 301NAR.3dmax. and what about the door hooks. Also, in the model files, there are references to what I think are lightmaps, but they don't start with NAR. They start with 01NAR_lm.... Should I change these too? There are definately differences, and I can't figure it out. Thanks in advance.

Link to comment
Share on other sites

The walkthrough says to change all references to 301NAR(or whatever module) in the .lyt file. What about the file dependency 301NAR.3dmax. and what about the door hooks.

 

I'm assuming this a custom module with edited models.

I re-named all the model references, even under the doorhook section. I left the file dependency part as is. You also need to do the same with the .vis file and update the .are file under "rooms".

 

Also, in the model files, there are references to what I think are lightmaps, but they don't start with NAR. They start with 01NAR_lm.... Should I change these too?

 

Yes, I lightened the lightmaps the way DarthInsidious posted and hex-edited the models to point to the new textures. The 3 in 301NAR*_lm*(these are the lightmap texture references) is on the previous line: screenshot. Be aware some references "wrap around" in a hex-editor.

 

The main issue I had was the sky box model. I tried to change it to a different one in the .lyt file but nothing would show up(blank grey sky). I'm assuming the coordinate values are in line with what the coordinates are in the .git file but every set of values I tried ended up with the same result.

 

I didn't want to have to re-skin the original skybox but I had to anyway, sort-of. The texture is dark to simulate night time and the skybox is rotated at an angle in relation to its' aurora base. It also has "cardboard cut outs" of building faces that sit within the "cube" of the skybox.

 

Screenshot1

Screenshot2

 

The model uses two textures. One for the ceiling of the "cube", one for the walls of the "cube" and the same one(3 texture references in the model) for the "cardboard cut outs".

What I did was point the ceiling and wall textures to different files and lightened and renamed the original texture to use for the building faces.

 

Here's how my landing pad ended up:

 

Screenshot1

Screenshot2

Screenshot3

Screenshot4

 

It's not perfect but I'm satified with the results. In the first screenshot in the uper left corner you can see where two walls of the "cube" meet. It's more of a dusk/building in shadows than broad daylight but you could probably lighten the lightmaps further.

 

UPDATE:

Comcast is ditching personal web pages if/when links go dead, copy & paste these links into your browser:

www.angelfire.com/80s/deathdisco/images/hex.jpg
www.angelfire.com/80s/deathdisco/images/sky.jpg
www.angelfire.com/80s/deathdisco/images/sky1.jpg
www.angelfire.com/80s/deathdisco/images/lpad1.jpg
www.angelfire.com/80s/deathdisco/images/lpad2.jpg
www.angelfire.com/80s/deathdisco/images/lpad3.jpg
www.angelfire.com/80s/deathdisco/images/lpad4.jpg

Angelfire does not allow hotlinking.

Link to comment
Share on other sites

  • 2 years later...

You're being way to general to expect any decent sort of answer.

 

Can you go through the steps you took?

 

Did you follow the tutorial properly?

 

Is it possible you could have missed a step?

 

Could you have missed a file(s) out, or edit one (or more) incorrectly?

 

You should try and be as detailed as possible if you want us to help you, Seikan. :)

Link to comment
Share on other sites

so, well, first: yes I follow all the steps, but maybe on a bigger module that's different.. i should replace any reference to the original module?

that's maybe because there are more rooms, etc maybe i have misse some thing that change...

 

Open models.bif-->Aurora Model, and scroll down until you find m23ab_01a.mdl

 

should i extrat the others mdl without the 01a.mdl?

 

Lastly, open the Walkmesh tab, and scroll down until you find a file named m23ab_01a.wok . Extract this file to the ‘New Module Project’ folder, and close BIFs.

the others woks too?

 

Now, close layouts.bif and open lightmaps7.bif and scroll down until you find the files which have names beginning ‘m23ab’ – these are the lightmaps for our module. Extract all of the files beginning ‘m23ab’, from m23ab_01a_lm0 to m23ab_01a_lm6 to the ‘New Module Project’ folder.

 

and the other lightmaps?

 

Again, scroll down until you reach m23ab_01a_lm0, and extract all seven files, from m23ab_01a_lm0.txi to m23ab_01a_lm6.txi, and then close the tab.

 

the same...

Link to comment
Share on other sites

yes, the mdx,

the lightmaps m39aa_01a_lm0 to m39aa_01a_lm6

the walkmesh m39aa_01a.wok

and the files m39aa_01a_lm0.txi to m39aa_01a_lm6

 

IV. – Reskinning and Lightmapping.

 

Now, using KotOR Tool, open ERFs, and select TexturePacks. For this mod, we will use Texture Pack A, so select swpc_tex_tpa.erf . Open the subtree marked ‘L’, and scroll down to the files marked LSI.

 

Extract the following files and their TXI files (Note: To extract the TXI files, check the box marked ‘Export Selection to TXI file’, and highlight everything in the white text box):

 

LSI_lite02.tpc

LSI_lite03.tpc

LSI_trim01.tpc

LSI_trim05.tpc

LSI_wall02.tpc

LSI_wall03.tpc

LSI_wall04.tpc

LSI_wall05.tpc

LSI_wall06.tpc

LSI_wall11.tpc

LSI_grate01.tpc

 

All these will extract as .tga files.

 

I have reskined the textures keeping the same images just adding some details... and not using the textures he said...

Link to comment
Share on other sites

I think I see the problem

 

should i extrat the others mdl without the 01a.mdl?

Yes, you need all the mdls(and woks, mdx, lightmaps, etc) with the begining of the module you are reskinning. IE- m23ab_01a through 11b, also note the m23ab is an example, you need the ones for your module.

Link to comment
Share on other sites

  • 2 years later...

I think there is a fult in this thread. I was discussing it with Fallen Guardien (if thats who im thinking of) and i posted that my area didn't work. It didn't load. The screen went black and i couldntt move, interact or see. When i checked maps it said the map wher i warped from. So, he said i needed to extract ALL of the .mdx's and mdl's. I asked him if he tested his theory. He said YES. So should i extract, and hex edit ALL?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...