The title might be a little misleading. What I mean by new area is actually the existing area, only with new placable items and/or creature. An example of this kind of "new area" is the Survival Battle mod (downloadable at my small website, see my sig). It uses the existing Mystery Box area but now it no longer has the rakatan riddle guy. Replacing him, I put the computer terminal instead that spawns the darkjedis.
This guide will not be too deep. Instead I am just hoping that this small guide can help the new modders to access more than changing items and appearances.
******NOTE******
If some of these links are not working, try typing them manually on the address bar. Some of them may not work if you click on them but will work if you type it up.
****************
First of all, you need these following tools:
1. GFFEditor by Roboius downloadable at
http://nwvault.ign.com/Files/other/data/1054162676171.shtml)
2. Kotor Tools by Fred Tetra
http://home.comcast.net/~armada/kotor_tool.zip)
3. ERF Editor
http://nwn.bioware.com/developers/erf_download.html)
I will not go through the little details on how to use these programs as they are quite straight forward.
A new area is actually a module. The most basic area/module must consists of at least three files. These files are however combined into a single .mod file (or .rim files. KotOR recognizes both). Take a look at this file for example:
http://webpages.charter.net/alvintamsir/misc/lastbattle.mod) Open it up using the ERF Editor. As you can see, the lastbattle.mod file actually consists of three different files, namely: module.ifo, m45ad.git, and m45ad.are.
Now try and copy the lastbattle.mod file into your MODULES directory, NOT the override directory. Now go into the game and load any game. The use the cheat and type "warp lastbattle". As you can see, you will be teleported into the last battle room. However, Malak and the captive jedis are not there. Instead of malak, Bastila is now standing there.
I will go step by step now to explain it further. First of all, whenever you load an area or module, the game will search the MODULES directory for a file under such name. In this case it was looking for a file named lastbattle.mod. Once the game finds it, the first file that it looks in the module is always the file "module.ifo". It contains the basic settings of that particual mod. Using the ERF editor, extract the three files into a new directory (do not put these files into the Override directory as they may crash the game). Use GFF Editor to take a look at the "module.ifo" file.
module.ifo
I will not go through all the various data fields in this file, instead I will just point out the important ones.
Mod_Tag = this has to be the same as the name of the file (excluding the .mod extension)
Mod_Entry_Area = determines which area file should be loaded if a player enters this area (i.e. typing "warp lastbattle" in the cheat). This will bring to the next file which is the area file.
Area files have the extensions .are. In this example, the file is "m45ad.are". Let's go back to the module.ifo file. Remember what was the value in the field "Mod_Entry_Area"? Exactly, it was m45ad. So basically it was referring that the game should load this "m45ad.are" file once the module is loaded. Some of the important fields in this file is the OnExit, OnEnter, and OnHeartbeat. You can put the name of scripts here that will be executed during certain times. You can disregard about this for now. I will not cover this in detail in this post.
Now the last file is rather important, the "m45ad.git" file. This .git file basically states what are the objects that are present in the area file. So, basically it can be tought as this: the "m45ad.are" contains the info regarding the area such as lighting, day night cycle, etc; while the "m45ad.git" contains the dynamics items such as creature, containers, and other items.
m45ad.git
Open this file using the GFFEditor. The fields in this file are pretty much self explanatory.
Creature List - Lists the creature, including NPC, monsters, and enemies.
Door List - Lists all the doors
Encounter List - Lists the random encounter creature. and example would be those tigers that you found on Danttoine on the open lands.
Placable List - Lists containers, items, decorative items, computer panels, workbench and many others. These items may or may not be interacted by the PCs depending on the items itself.
Trigger List - Lists the various scripting triggers. An example would be "When you pass a certain area, initiate the script for a certain dialog".
Waypoint List - I do not recommend you to touch anything here as it may messes up the pathing AI of enemies and party members too.
An example, take a look at the Creature List. Under there, there is a subtree "0", which has another subtree "TemplateResRef". Before edited, the value should be "sta45_darthmalak". This refers to the creature blueprint of Malak. However, as you can see, I changed it into "p_bastilla". that is why you see her instead. X,Y, and Z Position are the position in which the creature will be put. One easy way to know the location of a certain spot is to load the game, and type "whereami" in the cheat console. It should give you back the coordinate of that spot.
As you can see in out example file, Placable lists and the Door lists are all empty. I deleted them. Now you can compare it with this file:
http://webpages.charter.net/alvintamsir/misc/sta_m45ad.mod)
This is the unmodified version of the same room. You can see how there are so many items under the Placable lists. Those are the captive jedis. Just compare and contrast the two files, you should be able to figure out more things. You can find the list of a lot of placable items and npc characters using kotor tools. They are found in the BIFs --> Templates. .utC files are Character blueprint files while .utP files are placable items.
Once you have edited these files, you can compile them back into a single .mod file using the ERF Editor. Place this new file into the MODULES directory and use the warp command. Remember that the name of the file mod file has to match the Mod_Tag field in the module.ifo file.
If you want to see the various existing areas in the game, use Kotor Tools and open the RIMs --> Modules. It has all the different areas that are found in the game. These modules may also contains .utc files and .utp files.
Once you mastered these, you can move on to learn scripting. I will try to make the small guide also for that if I have time.
That's about it. Hope it helps some of you guys. And as always, correct me if there is anything wrong. I am not an expert programmer nor modder myself. ;) If you have any question, I will gladly try my best to help.