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.

Module Reskinning Tutorial

Page: 1 of 1
 Darth InSidious
01-28-2007, 10:15 AM
#1
Everything You Never Wanted To Know About Module Reskinning And Have Been Forced To Find Out

By Darth InSidious

EDIT: Downloadable copy available here (http://www.box.net/public/ac7qx896u5)

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:
http://i15.photobucket.com/albums/a362/jimspriggs33/finishedtut.jpg)
 SithRevan
01-28-2007, 1:34 PM
#2
Nice tutorial DarthInSidious! You can barely tell that is a module on Kashyyyk. So really great job.:D
 Master Zionosis
01-28-2007, 1:43 PM
#3
Wow, brilliant, thanks DarthInSidious, you told me you were going to release a re texturing a module tutorial, thanks, this will surly help!
 stoffe
01-28-2007, 3:19 PM
#4
Very nice and detailed tutorial, thank you for sharing it. :) I've moved a copy of it into the Modeling/Skinning tutorial forum here (http://www.lucasforums.com/showthread.php?t=175101) as well to make it easier to find in the future.
 Darth InSidious
01-28-2007, 3:47 PM
#5
Thanks for moving it stoffe :)

@zionosis: I hope so :)

@SithRevan: Thanks :)
 deathdisco
01-29-2007, 1:41 AM
#6
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.
 Darth InSidious
01-29-2007, 9:04 AM
#7
No problem - look forward to seeing the mod's release :)
 darthriddick
01-31-2007, 2:36 PM
#8
this was realy REALLY helpfull.
i did a bit of reskining on taris, really fun.
i know have knowledge!!!!! XD
 dangen77
02-23-2007, 1:36 PM
#9
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.
 deathdisco
02-23-2007, 6:45 PM
#10
^^^
I'll post some info tonight.
 LORD SPARTAN
02-23-2007, 11:18 PM
#11
Wow this is too crazy, I wonder if that means I could edit those force fields of the break cells in the sith base on Taris and in the cut scene on the Leviathan
 deathdisco
02-24-2007, 1:49 AM
#12
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 (http://home.comcast.net/~deathdisco/images/hex.jpg). 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 (http://home.comcast.net/~deathdisco/images/sky.jpg)
Screenshot2 (http://home.comcast.net/~deathdisco/images/sky1.jpg)

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 (http://home.comcast.net/~deathdisco/images/lpad1.jpg)
Screenshot2 (http://home.comcast.net/~deathdisco/images/lpad2.jpg)
Screenshot3 (http://home.comcast.net/~deathdisco/images/lpad3.jpg)
Screenshot4 (http://home.comcast.net/~deathdisco/images/lpad4.jpg)

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.
 Seikan
04-05-2009, 2:58 PM
#13
I have try to reskin a new module with the naga sadow tomb, but the game crash when i try to warp to the map...
 Marius Fett
04-05-2009, 3:08 PM
#14
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. :)
 Seikan
04-05-2009, 4:07 PM
#15
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...
 Marius Fett
04-05-2009, 4:30 PM
#16
Did you extract the .mdx file for the area?
 Seikan
04-05-2009, 4:50 PM
#17
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...
 Marius Fett
04-05-2009, 4:57 PM
#18
Hmmz..

Did you get the .vis too, and edit that properly?

How about the .ifo and .are files?

Did you follow along exactly what DI said to do?

Btw, have you made sure your model is Binary, not ASCII?
 Seikan
04-05-2009, 5:27 PM
#19
yes i extraxt the mdp with tga images and the ascii and delete the ascii after, the vis, are, ifo, and thegit too
 HK-42
04-05-2009, 5:30 PM
#20
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.
 Seikan
04-05-2009, 7:22 PM
#21
i don't found what should i do with the vis... i don't remenber if i edit this file

edit: ok thanks =)


And should i rename the txi files too?
 Marius Fett
04-05-2009, 8:13 PM
#22
^Ah, right sorry. I thought you were using the same area as DI did. :p

Yeah, the .txi's names need to match the textures names.

Sorry for any confusion earlier.. ^_^
 Seikan
04-06-2009, 8:24 AM
#23
Sh***! the game crash again when i try to warp, in the middle of loading...
 UltimateHK47
11-20-2011, 6:20 PM
#24
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?
 Marius Fett
11-21-2011, 4:29 AM
#25
All the models for the area you're using, yes. I'd have thought that was self-explanatory. :giveup:
 Ferc Kast
11-21-2011, 11:08 AM
#26
All the models for the area you're using, yes. I'd have thought that was self-explanatory. :giveup:
Especially so with HK-42's post.

Anyways, I don't think I saw this tutorial before; But, it certainly answered a few questions for me.

Although, I do have one related question while this thread is still on the first page: If the reskinned module is taking the place of the starting module (i.e. replacing the Prologue Ebon Hawk, 001EBO, module in TSL), can I still put its custom model name as the tag, name, etc. in the .are & .ifo files (like this tutorial says to do) and expect it to work?
 UltimateHK47
12-04-2011, 4:36 PM
#27
Actually, you didn't need all the models. I just scuffed up the script xD
 Canderis
12-04-2011, 6:44 PM
#28
EsEspecially so with HK-42's post.

Anyways, I don't think I saw this tutorial before; But, it certainly answered a few questions for me.

Although, I do have one related question while this thread is still on the first page: If the reskinned module is taking the place of the starting module (i.e. replacing the Prologue Ebon Hawk, 001EBO, module in TSL), can I still put its custom model name as the tag, name, etc. in the .are & .ifo files (like this tutorial says to do) and expect it to work?
Yes.

Actually, you didn't need all the models. I just scuffed up the script xD
You got lucky then. You do need all the models.
 UltimateHK47
12-05-2011, 12:30 PM
#29
I know, im a lucky person! :)
Page: 1 of 1