Vous êtes sur la page 1sur 16

Custom Module Tutorial

Well heres another tutorial! This one will teach you how to make a new module
using a pre-existing area.
Tools Youll Need
KotOR Tool- Youll use this to extract the original game files ready for
modification.
DOWNLOAD
K-GFF- This is a custom GFFEditor specially made for KotOR and TSL by tk102.
Youll use this to modify the files. Dont use any other GFFEditors as theyll
corrupt certain files.
DOWNLOAD
DLGEditor- Another tool by tk102, youll be using this to make a dialog for your
character later on.
DOWNLOAD
This tutorial like my others are written using K1. You can do this in K2 (TSL)
aswell as the steps are the same.
People say that making modules is hard. And for some it is. But once you know the
basics youre fine. This tutorial will cover the basics of what youll need to learn.
You will be making the following:

A new module using a Wookiee Hut on Kashyyyk.


A single NPC.
A custom dialog for your NPC.
A few basic scripts.
__________

First decide which module you want to use. For this tutorial well be using a
Wookiee Hut. You can use whichever module you want though if youve never
done this before Id recommend doing the same as me just to be sure.
Right, first we need to extract the files we need for the module.
Im using the module kas_m23ab.
Open KotOR Tool and go to RIMs>Modules.
Then scroll down to find the right module. Youll notice each module has two
subtrees, expand them both.
You should see this:

Expand the Dynamic Area Info tab and youll see the areas .git file, in this case
kas_m23ab.git. Click the Extract button on the right hand side of the KotOR Tool
window and save the file as a .git. Id recommend making a new folder for the
module.
Now expand the Module Info File tab and save module.ifo to your new folder.
Then expand Static Area Info and save the .are file. In my case its kasm_23ab.are.
Now expand Blueprint, Placeables and extract kas23ab_cont_01.utp, then expand
Blueprint, Sound and extract rndwookanimals.uts.
The other tabs contain the Characters etc for the original module which we of
course dont need.

And since we dont want the module linked to Kashyyyk we dont need the door
either.
Now we have all the files we need we can start to edit the files to make the module
the way we want it.
Well start by getting rid of the old Characters. Open K-GFF and go to File>Open.
Open the kas_m23ab.git file you just extracted. Then go to View>Fold All.
This way you havent got your screen cluttered. Now expand the main tree and you
should see this:

First expand the CreatureList node and delete one of the nodes in there
(REMEMBER TO LEAVE ONE THERE)
Then expand DoorList and delete the single node in there. Then delete the nodes in
the WayPoint list.
Then save the file overwriting the original.
Now we need to make our NPC. Open KotOR Tool again and go to
BIFs>Templates.bif>Blueprint, Character. As you can see there are a lot to choose
from. Im going to use a Duros so Ill find n_duros.utc, go down and double click
it. The creature editor will come up, like this:

In the First Name filed put what you want the NPCs name to be.
(The one that floats above their head.)
Give them a Last Name too if you want but Im leaving it as Duros.
Now we need to give our NPC a custom Tag and ResRef so in the Tag field type
what you want the NPCs tag to be. Best to keep it simple so Ill put my_npc then
click the advanced tab at the top of the Creature Editor and put the same thing in
the TemplateResRef field. It doesnt havr to be the same but I like to have them the
same because its easier to remember.

Now click the inventory button.


This will come up:

This is where you can choose the NPCs items etc.


I want to give my Duros a Vibrosword so Ill expand the Handheld Weapons 3 tab
and click the Vibrosword tab. Look at the list for the one I want and drag and drop
it into the NPCs right hand slot.
Have a play here and give your NCSs some items you want them to have.
After youre done with that click OK and youll be back in the Creature Editor.
Youll have noticed the tabs at the top saying things like Force Powers, Skills etc
so have a play with tham to give your NPC some feats and alter their class and
alignment and so on.
Dont make them too powerful though cos Im gonna be showing you how to

make the NPC attack you.


Once youre done playing with stats go to the Advanced tab and check the No
Permanent Death Box. This will make it so that the NPC will return to life next
time you enter the module.
Also change the Faction to Neutral.
You should now have something like this:

Now save your character as my_npc.utc or something. (Its easiest to use the Tag
and ResRef as the filename too).
Now we need to make a script that will make the NPC attack you. We will attach

this script to a dialog option later so you can chose whether or not it happens.
For this next part you can use Notepad or something like that but I like to use the
Text Editor in KotOR Tool.
So open KotOR Tool and open the text editor by clicking this icon at the top of the
window underneath the toolbar:

The text editor window will look like this:

Copy and paste this into the Text Editor:


void main()
{
ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_HOSTILE_1);
}

Save the file as attack.nss or something. (REMEMBER THE NSS EXTENSION

AND ITS PROBABLY WISE TO MAKE SURE IT SAVED PROPERLY TOO).


Ahem
At the top of the Text Editor click Script>Script is for KotOR I then click
Script>Compile and save over your nss, this will make a .ncs which is the file used
by the game.
You may want to make your NPC even more interesting and add a dialog option to
give you items or XP/LS/DS points.
Ill put a few scripts here so you can have a bash at it.
Make NPC Give You An Item:
void main()
{
int nQuantity = 1;
CreateItemOnObject("item_resref",
GetFirstPC(), nQuantity);
}
/Where

it says int nQuantity = 1; you can change the 1 to the quantity of the item
you want.
Replace the item_resref with the ResRef of your item. (LEAVE THE QUOTES
[] THERE)
Get XP Points:
void main()
{
GiveXPToCreature(GetFirstPC(), XXXXXXXXX);
}

Replace the XXXXXXXXX amount of XP you want.

Get LS Points:
void main()
{
AdjustAlignment(GetFirstPC(), ALIGNMENT_LIGHT_SIDE, XXX);
}

Replace XXX with the number of LS points you want from 1-100.
Get DS Points:
void main()
{
AdjustAlignment(GetFirstPC(), ALIGNMENT_DARK_SIDE, 100);
}

Replace XXX with the number of DS points you want from 1-100.

If you want to make some of your own scripts to make things more interesting and
have no scripting ability try Lilac Souls Script Generator.
It was designed for NWN but should still get you started.
DOWNLOAD
Now to make the dialog for our NPC. Open up DLGEditor and go to Mode>Toggle
Mode: KotOR I.
Then go to File>New, you should see some black writing on the screen saying New
Dialog, click it and this should show up:

Since our NPC is an organic being we set the Conversation Type to Human as
shown in the above picture.

Now, right click that New Dialog click Add New Entry, in a .dlg file the red entries
are the NPC and the blue replies are your PCs lines.
Once youve clicked add new entry a red line of writing saying (continue) [End
Dialog] will appear, click it and this will appear:

Click the box where I have drawn a smiley face and enter what you want the NPC
to say to the player.
Then click off the entry so the text appears. Now right click your entry and click
Add New Reply, blue text will appear, click it and add the text you want the PC to
be able to say in the same way as you did in the entry.
(You can add more than one reply per entry)
If you want a particular line to fire a script, (such as youve written here take this
item as the NPCs line) youll notice a box at the bottom of the screen that says
Script That Fires When Spoken.
Write the name of the script you want here (without the filename extension).
Ill quickly make a dialog now so you can get the idea of what it will look like.

By no means a sophisticated dialog as it took around 30 seconds to make.


Add a few reply options to each reply to make it more interesting.
Once your happy with your conversation go to File>Save and save your file.
Ill call mine my_dialog.dlg, remember the dlg extension!
Almost done now, just got to edit the character to use your new dialog and add the
NPC to the module.
Well edit the character first.
Open K-GFF again and open your characters .utc file.
Scroll down until you see the conversation field.
Type in the name of your dlg file like this:

Now just need to edit the NPC and pack everything into a .mod file.
Open KotOR and type warp kas_m23ab into the console, walk to where you
want your NPC to stand and type whereami into the console.

Here are the co-ordinates I got:

Open youre kas_m23ab.git in K-GFF and right click CreatureList, expand the
node you left there earlier and edit it to accommodate your NPC,
Click the TemplateResRef and alter the value to your NPCs in my case my_npc.
Now click your XPosition FLOAT and change the value to the Xco-ordinate you
got from the game, for me this is 14.57.
Do this for the YPosition and XPosition with their respective co-ordinates too.
For the XOrientation and YOrientation just leave them as they are, working out
orientation means using pi so its very confusing.
You should now have this:

(I KNOW I HAVE 0.00 IN THE ORIENTATION FIELDS BUT DONT YOU DO


THAT TOO)
Thats the NPC put in the module! If you made more than one NPC you can add
them in the same way.
Now just to pack our files into a .mod. Open KotOR Tool and open the ERF editor
with this icon:

This window will appear:

Click the [] button next to the box under Output file name and browse for a
location to save the .mod.
Call it what ever you want, Ill use mymodule.mod (REMEMBER THE .MOD)
Then back in the ERF editor window click the arrow under Output file type and
click MOD.
Now click the Add Files button and add all the files youve made/modified for the
module.
It should now look like this:

Now click build MOD and a pop up should appear saying ERF build complete.
Click ok and exit KotOR Tool.
Now put your new .mod file in the Modules folder in your KotOR Directory (NOT
OVERRIDE!)
Now start up the game and use the warpp cheat to warp to your new module.
I named my .mod mymodule.mod so I type warp mymodule if you named your
mod ablananthanalba.mod then type warp ablananthanalba
Try making a few small modules, adding a little more to them each time to get the
hang of it. Once you feel confident try something bigger!
There are loads of possibilities, new quests, new planets, and lots more, you can
combine the skills you learned here with your other modding skills like skinning
and modeling etc The possibilities are many!

Hope your module worked out ok!


PM me if you have any problems.
-DarthDingDong

Vous aimerez peut-être aussi