V.Step 2: Module Creation
Okay, now that we have gotten organized and are ready to move on, lets get to the fun stuff. Module Creation is probably one of the most simple things to do when you get the hang of it. Mostly, its just plugging in numbers and grouping stuff together, after you get used to it, it becomes quite an easy routine. Your modules are what the player plays in, or “Levels” that the player advances through. When you made your outline you mapped out all the planets/areas that your PC would travel to in his/her journey through your story.
Each planet you have made will have a set of modules, these modules can range from cutscenes, battlefields, walking around areas, towns, dungeons to enemy bases and strongholds. Unfortunately, due to the fact that we have not yet broken the format on just how to make our own models for modules, we have to use existing ones from Kotor/TSL. So when mapping these out, keep in mind that they are going to have to be the same modules as the ones in the original game. But you can easily change the normal modules in Kotor by adding a story to it, and even change the look of the module by textures. We will go more in depth on texture customization when we get to that step.
So for each planet you are going to make you are going to have to chose modules from existing ones and use them for your shell. First off, we are going to want to map out our first planet on the lines of modules. So get out a sheet of paper or open a text document. To follow along with you I am going to use my planet Yavin IV in my mod. Ok lets get to it. So first after you have made your heading you are going to want to list in order the modules that are included in this planet(including cutscenes).
You will want to give each module two names, one is the module name you want it should be a single name because we are going to need to reference it for the .lip files if you want lip syncing in your mod. The next name is the actual name for the module that you are using from the original game. After the name you are going to write a brief description of what happens in that module. So far it should look like this:
Yavin IV
yavin1-401DXN- Begin dialog with Adon. Fight way up to next level.
yavin2-402DXN- Fight way to entrance of Sith base.
yavin3-403DXN- Fight through Sith, slowly disable base. Find Ace. Find Dark Jedi at the radar dish. Escape.
cutscene1-853NIH- Admiral Krath tells Darth Cravon of the escape of Player and Ace.
This will help you to know what to include in your planet folder. And will also give you a check list to use when making the modules. Okay, on to the building.
a. The Skeleton
Okay, first thing we are going to do is open up the handy dandy Kotor Tool. Open the Kotor II directory in it, then expand the RIMs subdirectory. In here you will see a list of modules that you can use in for your “Skeleton”. The modules are named strangely but you can make an educated guess as to which one is which by the ending three letters. For example, 401DXN is obviously a module in Dxun. Expand the module you want to use, make sure it is the module without a s in it as we will be opening those later. For example, I will be expanding 401DXN.rim not 401DXN_s.rim. In here you will find 3 sub directories expand all three.
Export the contents into your Module subfolder in your module folder “Mod Directory/Planet/Module/module/. Ex: I will put mine in “TROTS/Yavin/yavin1/module”. Okay, so now you have extracted the actual module, with nothing in it, just the module, no characters,scripts,dialogs,placeables, yata, yata, yata. Basically, you have the shell of the module, or what I have been calling it, the “Skeleton”. This is the module you will use to get the coordinates for your characters and other things you want placed in there.
b. Placement Mapping
Okay, in this section we will be mapping out where we want our npcs to be placed to give us a visual aid like that of a GUI map editor. So the first thing we want to do is open Kotor Tool again. By now you should know that which main directory to chose, if you have TSL Kotor II, if you don't Kotor I. So anyways open it up and open the Kotor folder, expand the ERFs, then go to Texture Packs, you should see four subdirectories.
Expand the one that says swpc_tex_gui. Then open up subdirectory L. You should see a lot of little files. These are the maps of each module. Scroll down until you see the lbl_mapxxxxxx where x is your module name. For example, I will go to lbl_map401dxn. Now double click it to bring up the image viewer. With a pencil and paper, trace just the outline of the highlighted area. Now we have our map where we will decide to place things.
So now you have an empty overview map of your module. Now we are going to figure out where to place our npcs. Make your decision and put dots where each npc is going to go. No use a ruler to draw a straight line from each dot. At the end of the line you will put #n(# = the number of the npc, n = npc). So do that for each one and number them accordingly.
Then at the bottom in some free space, list the n's that you made 1 to whatever. And then put the name of the npc you will be using, for time saving we are going to name it what we are going to name the .utc file. For example (1n =charles.utc) charles is the name of the utc file i am using for my character i want to put in the position 1n. List down as we will be putting coordinates next to each one aso you will have to list down. Your paper should look like this:
http://img207.imageshack.us/img207/5762/example21hh2fb.jpg)
Okay, so now we know where we want our guys to be, its just a matter of finding out what the coordinates are. So now open up the good old Kotor Tool. And open the ERF Builder. For your filename put in test.mod and have it save in the modules directory of your SWKotOR2 directory. Select MOD for file type. Now click add, open up your mod directory. Remember when we exported those three files? The .are, .git, and .ifo? Well find those and add them to the erf. Then click build. If your test.mod is not already saved to the Modules directory put it there.
Open KSE, have it open one of your save files, this will be the one we use to test our modules as well as get info from them. Go to your items list, have KSE add the Whereami armband to your inventory, it should be easy to find on the item list because it is a custom item, and custom items are in red in KSE(thanks tk102) give it to your PC and commit changes. Now go into Kotor 2. Open the saved game, and type in the console “warp test” without the quotes. Now equip that armband. And go to the points you plotted on your map and get the coordinates of each spot, record the coordinates on the paper next to the npc they belong to(you don't have to record Orientation if you don't want to as it is not required). Once you get all of these, get out of the game.
c. Plugging In Coordinates
Now we have all the coordinates for your characters, now the tedious part is about to come. Open your ERF/GFF editor. And open the your module .git that you extracted to your module subdirectory. You'll see a section called Creature List. Expand it. Now, delete all those enteries EXCEPT 1. Copy that entry, and paste it on creature list one less as many times as characters you have in your module(1 less because you have one already there) so my creature list will have 5 entries. Expand the first one. You will see quite a few headers here, but you only need to worry about 4; X Position, Y Position, Z Position, and TemplateResRef. In the X Position you will enter the coordinates for the X position of the 1st npc that you have, you will put the Y Position in the Y Position and the Z in the Z. Now, for TemplateResRef, you will put the name of the .utc file of the character that is the first npc, just as we did when we listed them on our map. Do this in order for each one as you did on the map. When you finish, save the .git file. Now we are done plugging in those nasty coordinates. Few that was fun. Lucky for you the tough part is over.
Now go back to Kotor Tool. Open BIFs and go to templates.bif. Now go to Blueprint, Character just as we did for our party members. Under this you will find a list of npcs you should be able to tell who is who by the name of the file, but if you can't than just double click it and it will tell you under name. So find the one you want for your npc/npcs and double click it, you can change anything you want except for the scripts, you should leave those alone unless you know what you are doing. In the dialog section put the name of the file of the dialog you are going to have this npc use, we will go deeper into this in the next section where we will make the dialog.
Just put the filename in for now. Change the tag to be unique, and record it(you will need to know this for dialog editing). Hit save and save the npc in your Creatures section of your module directory, make sure you make the filename the SAME as the name you put in the .git file. If you ever want to change the npc after you have saved it, you can use the gff editor to open the file and just edit away.
d. Dialog
Dialogs are an important aspect of any mod, they give story to characters as well as build the pc's character. When making your own dialog, its best to map it out on paper before you put it on the computer, this will give you more of a prepared dialog. This is where things get fun. When creating a dialog try to remember to give the player lots of options, no one likes a one direction dialog. In this part of the tutorial I will show you how to make a brief dialog that will have basic entries and replies.
Open up DLGEdit that you downloaded. Click on File and New. You will see New Dialog in bold in the dialog tree. Click on New Dialog in the tree window. At the bottom you will see a few options to chose, these are for the customization of the dialog as a whole. The only one you are going to want to set is Skippable, this allows the player to skip through a line by clicking the mouse, an important thing to check each time that way if the player has heard the line before he can skip it.
Next, right click on New Dialog and select Add New Entry. You will see a blank entry under New Dialog in red show up. Select that. You will see many options here, more if you are doing it for TSL. There are many here but only a few that we will need to check for our basic dialog. Most of the options in the dialog structs are self-explanatory, for the ones that aren’t you most likely wont need them anyway. First you are going to go to the Speaker header, put the tag of the npc who is speaking here; this header determines who will be speaking the line, mainly for cutscenes and lipsyncing. After that, in the large box to the right, you will type the line that the npc will be saying. For testing purposes we will put in there “Hi. Is there something I can help you with?”. Leave the Listener header alone for now as that is only needed when an npc is talking to an npc, which is key in cutscenes.
On the left you will see a header called VO_ResRef, this is where you will put the name of your .mp3 file that contains the voice that is saying the line. (Note: Do not put .wav or .mp3 at the end of your voice file name when putting it in the header) Now it is time to add replies. Right click on the Entry and select Add New Reply. You will see the default reply struct under your Entry in blue. Select this and take note of the options under it.
Really, all you need to do here is put your text that the Player can reply with in the large box on the right as you did before; you can put the npc’s tag in the Listener header but it is unnecessary considering there is only one npc. For the tutorial we will put in “Hi. Who are you?”. Once you have done that right click the red Entry again and select Add New Reply. You will see the reply under your other one. Select it. Type in the text box, “Nothing for now, good bye.”.
You now have two replies the player can chose from. Since this is a basic dialog, there will only be two replies to chose from; in your more complicated dialogs it will be important to put as many replies as you can so the player has more options. The basic structure for replies is, one to two for Lightside on top and one to two for darkside on the bottom and one final one at the bottom if the player wants to end the dialog, which would consist of “Good Bye” or “Never Mind”. When the player is asking questions, there is a different structure, there is a list of questions with the good bye line at the bottom, and in each question after the NPC has answered if he has opened up room for another question, that question will be the first reply, the second will be something t to the affect of “I had other questions” which will lead the player to the first set of questions. Select the reply that has “Hi. Who are you?” in it. Right click it and Add New Entry.
Set the speaker, and type in the text box “I am Dak Starkisser, Nice to meet you”. Put the voice file name in the VO_ResRef and you are done with the dialog. Go to File, Save As, and save it as test.dlg and put it in the Dialogs section of your Module sub directory in your mod Directory, for example I will put it in SWKotOR\TROTS\Yavin\Dialogs. If you are not doing a mod and just a dialog, put it in your Override directory, if you haven’t already made one then make it.
You can replace the Entries and Replies with whatever you want, and when you make your own for real you will make many more entries and replies, remember to keep to a good reply and entry structure. Dialog is an important part that will make your mod great.
For your Mod, make sure that when you save the Dialog, you save it as the same name as you put it for the NPC’s Conversation header in the .utc file that you will include in the .erf.
e. Scripting
I know you are probably expecting me to go on about scripting so that you can be a scripting genius. Well, that isn’t going to happen, It would take a tutorial of MASSIVE size for me to explain all the elements of scripting and I have neither the time nor the brain capacity to type it all out. The best place to go for scripting help is Holowan Laboratories which I have placed a link to in the “Where to get help” section. I recommend Darth333, TK102, and RedHawk. There are many others too, just make a thread and everyone will be willing to help you, you will find it a very friendly environment.
f. Making the Erf File
Okay you have all the things you need now for a basic mod. You have your NPC which is mapped out and has its coordinates in the GIT file. The GIT, ARE, and module.ifo file should be in your Module section of your Modules sub directory, ex: mine will be in SWKotOR2\TROTS\Yavin\Module. Your NPC’s .utc file will be in the Characters section of your Modules sub directory (if you haven’t made an NPC yet do so according to the NPC Mapping section of the tutorial and put the name dialog you created in the Conversation header. So for example, my character’s .utc file will go in SWKotOR2\TROTS\Yavin\Characters folder. And your Dialog that you made should go in your Dialog folder of your Modules sub directory ex: mine will go in SWKotOR2\TROTS\Yavin\Dialog folder. Now you are ready to make the ERF file and test your mod.
So go to Kotor Tool, and in it select the ERF Tool. At the top you will notice an address bar. Click the “…” button next to this bar. A box should come up showing you your SWKotOR2 directory. Direct it to the Modules directory(not the one in your Mod Directory). In the save section type mymod.mod and click save. Next to the address bar you will see a small box, open the drop down menu and select MOD. (always remember when making a mod you have to save the erf as a .mod and select MOD from the drop down menu). Click Add. You will see another box come up, now add all the files you made, your GIT, ARE, module.ifo, dialog, and .utc files. Click build erf. Now it is time to test your mod.
g. Testing
Now you finally have your mod almost completed, now is the time to test. You may or may not have multiple modules that you have created but we will just be testing our tutorial module for now. So go into KOTOR\2 and open up a saved game. When in the game type “warp mymod” in the console, the console in KOTOR 2 is invisible so you will have to guess that you are doing it right. When in your mod go to your character that has the dialog, if you chose to do that, and click him. He should say “Hi, how may I help you” and you will be able to talk to him. If this does not happen, go back and recheck to see if you made an error, if something is not clear, consult Holowan Labs.
Congratulations! You have built a module that you can warp to in KOTOR, which is a big thing to do when making a mod and is the core of your storyline mod. Remember, when making a planet it is good to add as much content as possible, especially if your planet is a city. Add Merchants, Citizens with different dialogs, cantinas with “colorful people” and anything else you wish to add, all of which will be simple with KOTOR TOOL thanks to Fred Tetra. Now we will be putting the finishing touches on our mod, mostly for the actual modules you make.