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.

Talking new character?

Page: 1 of 1
 MiladyRevan
10-15-2007, 10:34 AM
#1
Okay, I know I found a thread here somewhere about this, but I lost it, and I didn't understand much of it anyway.

I'd like to make a female twi'lek in KOTOR 1 with my own made appearance, as well as new clothes. I managed to re-color a green female twi'lek, both head and body, but I think all green female twi'leks in the game now will have the new appearance. How do I make an entire new character withouth messing the others up?

Also, I'd like to have her on Manaan, and be able to start a conversation with her, and she would be speaking in the twi'lek-language. But how do I get her to Manaan? How do I make her start a conversation with me (with additional lip-movements and body-gestures, like shrugs)? How do I make her speak twi'lek-language, and how do I make her walk away and dissappear when I'm done talking with her?

Sorry for all the questions, but I'm new about modding.
Please help me!
 spyblade
10-16-2007, 11:34 AM
#2
I think that you can add your character by adding a new line in the appearance.2da and heads.2da files. You will also need to hex edit the .mdl files. Darkkender has a good tutorial on how to modify the 2da files here (http://www.lucasforums.com/showthread.php?t=149992) . Darth333 made a good tutorial (http://www.lucasforums.com/showthread.php?t=131944) on how to make a new recruitable npc. I know you are not trying to recruit the character, but it gives some basics on putting your character in the game. As far as running away - I'm not sure how to script that. But if you browse the stickies at the top, one of them might be what you need.
 MiladyRevan
10-16-2007, 1:36 PM
#3
No, it didn't help much, I'm afraid. Seems like they are doing one thing and I'm trying to do another. It would be best if someone told me exactly how to do it all.
 MiladyRevan
10-19-2007, 3:54 AM
#4
Is there no-one who can help me? :(
 stoffe
10-19-2007, 8:08 AM
#5
I'd like to make a female twi'lek in KOTOR 1 with my own made appearance, as well as new clothes. I managed to re-color a green female twi'lek, both head and body, but I think all green female twi'leks in the game now will have the new appearance. How do I make an entire new character withouth messing the others up?

To do this you need to add a new head and appearance type to the game for your new twi'lek appearance. You do this by adding a new lines to the heads.2da and appearance.2da files. The easiest way is to copy the existing lines for the green female twi'lek and make your own changes based on that.

First look up the green twi'lek appearance type line in appearance.2da, it's on line 47. Then look into the normalhead column of this line and you'll see the value 61. This is the line number in the heads.2da file, defining what head this appearance type uses. Many humanoid appearance types have separated head and body models, and the twi'lek model is among these. (You can see this in the modeltype column, if the value here is set to B it means a loose head from heads.2da is used, while the value F signifies that the head and body model are not separate).

So, open heads.2da and go to line 61. Copy this line and paste it in at the end of the file as a new line. Update the value in the (Row Label) column to the next number in sequence. Look in the head column of your new line, the text here is the name of a model file that contains the 3d model for the head. Change the value here from "twilek_f" to "LRtwilek" (or something else unique, preferable with the same number of characters as the old name for reasons we'll get to in a bit).

Then find line 47 in appearance.2da, copy it and paste it in at the end of the file. Change the value in the (Row Label) column to the next number in sequence and change the value in the label column to something unique that makes it easy to identify your new line. Change the value in the normalhead column to the line number of your new line you just added to heads.2da, and change the value in the texa column from N_TwilekFA to N_TwilekLR. The texa column contains the name of the texture file that contains the skin of the body model when they aren't wearing anything in their body inventory slot. Save the modified 2DA files in your override folder.

Now the model and texture files referred to above have to be created. A model file is actually two files, one with a .MDL extension and one with the same name but a .MDX extension. You can find them under the Aurora Model and Aurora Model Extension sections respectively inside the models.bif data file with KotorTool. So, find and extract the files twilek_f.mdl and twilek_f.mdx, and rename these files to LRtwilek.mdl and LRtwilek.mdx respectively. These files contain the head model for your new twi'lek.

Finally, open the twilek_f.mdl file with a hex editor and replace all instances of the string twilek_f with LRtwilek, and save changes. This will make the model use your new skin texture instead of the standard green twi'lek one.

The textures should now be named like they were called in the 2DA lines above as well. Name your reskinned head texture LRtwilek01.tga, and your reskinned body textureN_TwilekLR01.tga, and save them in the override folder.

Your new twilek appearance type should now be available. Make sure you've enabled KotorTool to use 2DA files located in the override folder (Tools menu --> Options --> Other --> Look in Game's override... checkbox), and then open the .UTC template for your twi'lek character and change the Appearance field to the new one you just added.


Also, I'd like to have her on Manaan, and be able to start a conversation with her, and she would be speaking in the twi'lek-language. But how do I get her to Manaan? How do I make her start a conversation with me (with additional lip-movements and body-gestures, like shrugs)? How do I make her speak twi'lek-language, and how do I make her walk away and dissappear when I'm done talking with her?

I believe the dialog part of this has already been answered in another thread. To spawn the NPC on manaan you have two options. You can either place the character in the area directly, or you can use a script to spawn it into the game world. Either method you choose, you'll need to get the in-game coordinates for the location in the game world where the character should appear. You can use the "whereami" console command for this. Move your character to the location you want the twi'lek to stand, activate the console (press the [SHIFT] [ґ] [+] keys on the keyboard to activate the console) and type "whereami" and press return. Write down the X, Y coordinate numbers that appear on screen. (You can see that the console has been activated when you get a yellow [b]> character in the upper left corner of the screen where what you type is shown.)


[b]The scripting route - create a script like this...

// Utility function to make spawning NPCs a bit quicker.
object ST_Spawn(string sResRef, float x, float y, float Angle = 0.0) {
return CreateObject(OBJECT_TYPE_CREATURE, sResRef, Location(Vector(x, y, 0.0), Angle));
}

// The main function, this is run when the script is fired.
void main () {
// Spawn NPC from the template LRtwilek.utc at the in-game
// coordinates X = 10.2, Y = 20.4
ST_Spawn("LRtwilek", 10.2, 20.4);
}

In this script, change LRtwilek to the name of the UTC file that holds your NPC (without the .utc extension), 10.2 to the X coordinate value and 20.4 to the Y coordinate value in the game world she should be standing. Use Kotortool's Text editor to compile the script, and put the resulting .NCS file in the override folder.

Then you need some place to run this script from. Depending on which area of Manaan she should appear in there are a few options for this, you can either modify the area's OnEnter script to fire this one, or modify a dialog in the area to run the script. The latter is preferable and much easier if possible, but requires that there is some dialog or cutscene the player has to go through in that area before they reach the place where they should meet the twi'lek.

The placing route - To place a creature directly in the area you'll need to use a RIM file editor to extract the file with a .GIT extension from the RIM file for the module you want the character to appear in. Open this .GIT file with k-gff and expand the Creature List node in the treeview. There are hopefully at least one [STRUCT] field listed here.

Right-click on one of the STRUCT fields and pick Copy STRUCT in the context popup menu. Then right-click on the Creature List node again and pick Paste STRUCT in the popup menu. A new struct node should appear at the bottom of the list in the Creature List. Open this, and you should find a number of data fields inside. Change the value of the TemplateResRef field to the name of the UTC file containing your twilek character (without the .utc extension), change the XPosition field to the X coordinate value, and the YPosition field to the Y coordinate value in the game world she should be standing. Click on another node, and then save changes to the GIT file. Put this GIT file back into the RIM file you extracted it from (make an unaltered backup copy of the RIM file first!). This should make the NPC appear in the area if you haven't been to that area already in your current game. (If you've already visited it the area is stored in the save game and not the game's data files).


To make the character start conversation when she sees the player you can make a new OnPerception event script for her. This script could look like:

// Main function, this runs when the script is triggered.
void main() {
// Get object reference to the NPC I just spotted.
object oSeen = GetLastPerceived();

// If the character I see is the player character...
// AND I haven't already done this...
if (GetLastPerceptionSeen() && (oSeen == GetFirstPC()) && !GetLocalBoolean(OBJECT_SELF, 50)) {
// Set that I've done this...
SetLocalBoolean(OBJECT_SELF, 50, TRUE);

// Stop doing anything I'm currently doing.
ClearAllActions();

// Start conversation in dialogname.dlg with the player.
ActionStartConversation(oSeen, "dialogname", FALSE, 0, TRUE);

// Move closer to the player so we don't have to shout across the area.
ActionForceMoveToObject(oSeen);
}
// Not seeing the player, or this has already been done. Do standard AI instead.
else {
ExecuteScript("k_ai_master", OBJECT_SELF, 1002);
}
}


Replace dialogname in the script with the name of the DLG file containing the conversation of the twi'lek.

Name the script something unique (max 16 characters, a-z, 0-9 _ only!) and compile it and put the resulting NCS file in the override folder. Next open the UTC file containing your twi'lek NPC and go to the Scripts tab. In the OnNotice box, type in the name of the .NCS file you just created (without the .ncs extension), and save changes.
 MiladyRevan
10-19-2007, 10:45 AM
#6
Your new twilek appearance type should now be available. Make sure you've enabled KotorTool to use 2DA files located in the override folder (Tools menu --> Options --> Other --> Look in Game's override... checkbox), and then open the .UTC template for your twi'lek character and change the Appearance field to the new one you just added.

I've done everything exactly as you said this far, but she doesn't show up in the BIFs>templates>Blueprint, Character. I got the appearance.2da file, the heads.2da file, the LRtwilek.mdx-file, the LRtwilek.mdl-file, the LRtwilek01.tga-file, and the N_TwilekLR01.tga-file in the Override. I cannot see any missing file, and I've restarted KT twice to see if she shows up. Am I looking at the wrong place, or is it the n_twilekf.utc-file I should open?
 stoffe
10-19-2007, 11:35 AM
#7
I've done everything exactly as you said this far, but she doesn't show up in the BIFs>templates>Blueprint, Character. I got the appearance.2da file, the heads.2da file, the LRtwilek.mdx-file, the LRtwilek.mdl-file, the LRtwilek01.tga-file, and the N_TwilekLR01.tga-file in the Override. I cannot see any missing file, and I've restarted KT twice to see if she shows up. Am I looking at the wrong place, or is it the n_twilekf.utc-file I should open?

You should modify the appearance value in the UTC file for your twi'lek NPC, though your own files/templates will not show up in the treeview in KotorTool. Only the standard game data files will be listed there.

You'll have to open it via the File Menu --> Open GFF File... instead.
 MiladyRevan
10-19-2007, 1:35 PM
#8
I understand now, but it doesn't work. I can't open any of my files with GFF. I get a sign were it stands "An exception error of the type System.OutOfMemoryException occured." What's that supposed to mean?
 tk102
10-20-2007, 1:37 PM
#9
MiladyRevan, though I can't answer as to why KotOR Tool is throwing an exception error, I can offer an alternative route to editing the .utc file. You can use a GFF editor such as KGFF to edit the individual fields, including Appearance. The tool is available from http://www.starwarsknights.com/tools.php)
 MiladyRevan
10-20-2007, 4:24 PM
#10
I already got that one too, but it doesn't work either, on anything. I copied it to the Kotor Tool folder, like the Readme said, and renamed it, but it still doesn't work. If I double-click on in, nothing comes up, and when I tries to use it with the KT, the ExceptionError comes up.

It should be working on Windows XP, right?
 tk102
10-20-2007, 4:44 PM
#11
Try launching KGFF directly without opening KotOR Tool at all.
 MiladyRevan
10-21-2007, 4:03 AM
#12
Still doesn't work.
 tk102
10-21-2007, 4:51 AM
#13
It's hard to help when you're vague, know what I mean?
 MiladyRevan
10-21-2007, 9:25 AM
#14
Sorry, I know, but nothing is different from my previous posts;

Everytime I tries to open a file with the GFF in Kotor Tool, I get the ExceptionError, and when I tries only KGFF or GFFEditor without KT, nothing happens. When I double-click on the GFFEditor or the KGFF icons, they starts to load, but then stops and nothing more happens. I've tried to open them with the menues, but it's the same there.

I managed to find a sign that says "The publisher could not be verified. Do you want to run this program?" when I tries to open the KGFF, but when I click on Run nothing happens.

I don't know what more to say? I don't know what more I can do?
 RedHawke
10-21-2007, 12:40 PM
#15
Milady do you have Admin permissions on your comp?

If not then that might be causing your issues. But this is just a guess on my part. ;)
 MiladyRevan
10-21-2007, 1:09 PM
#16
Yup, I certain of it. But to be absolutely sure of it (there might have been some change or something I've been unaware of) can you tell me how I check it?
 tk102
10-21-2007, 1:17 PM
#17
Two things I can think of that would cause KGFF to close unexpectedly.

1. Do you have a diacritcal mark (an accent or umlat) in your username when you log into Windows? (eg. svцsh) There is a known bug in PerlApp, the pseudo-compiler I used to distribute KGFF that doesn't work nicely with diacritics. The workaround sadly is to launch using an account without one. (Activestate says this will be fixed soon.)

2. If #1 isn't the problem, try searching your C:\Windows folder for kgff.ini and delete it. Then try launching the program again. Sometimes the most-recently-used list gets corrupted and screws up the launch sequence. Deleting the .ini file will cure that.
 MiladyRevan
10-21-2007, 2:28 PM
#18
I changed my username several times, and tried a few other things (taking away password, inactivate other accounts) but still no success. And I couldn't find the kgff.ini file, so I suppose I don't even have one. Maby that's the problem?
 tk102
10-21-2007, 3:09 PM
#19
Well KGFF is but a single GFF editor out there. And rather than spending time trying make it work, you can try using ths one
http://nwn.bioware.com/developers/gff_download.html)

This is the original GFFEditor.exe that KotOR Tool was designed to work with.

Note that this GFF editor does not support all the fields used in KotOR. It will work fine for editing a .utc file, but do not attempt to use it for editing a .git file or you will find your camera angles are screwed up.
 MiladyRevan
10-21-2007, 3:52 PM
#20
*Sigh* This one works, but when I tries to load the file, a error sign shows up that says "Could not open file. The header is invalid."

I tried to open a direct .utc file, and it worked, but it can't load the .2da file.
 stoffe
10-21-2007, 5:43 PM
#21
*Sigh* This one works, but when I tries to load the file, a error sign shows up that says "Could not open file. The header is invalid."

I tried to open a direct .utc file, and it worked, but it can't load the .2da file.

You can't edit 2DA files with a GFF editor, those are different file types. The easiest way to edit 2DA files is with KotorTool's built-in 2DA editor, or Kristy Kistic's 2DA editor utility (http://www.lucasforums.com/showthread.php?t=174367).

When you have added your line to the appearance.2da file, put the line number of that row in the Appearance_Type field in the UTC file with the GFF editor.
 MiladyRevan
10-22-2007, 5:46 AM
#22
But there is no .utc file. I only got the appearance.2da file, the heads.2da file, the LRtwilek.mdx file, the LRtwilek.mdl file, the LRtwilek01.tga file, and the N_TwilekLR01.tga file, but no .utc file.
 stoffe
10-22-2007, 6:53 AM
#23
But there is no .utc file. I only got the appearance.2da file, the heads.2da file, the LRtwilek.mdx file, the LRtwilek.mdl file, the LRtwilek01.tga file, and the N_TwilekLR01.tga file, but no .utc file.

Then you need to make an UTC file. :) UTC files are creature templates that contain the specifics of NPCs in game (such as name, stats, inventory, which appearance they use, if they're hostile or not etc). The easiest way of doing this is opening one of the existing character templates (n_twilekf.utc) in the templates.bif file with KotorTool and modifying it to your liking.

When you've set everything up as you want it, press the save button and save the UTC template under a unique name (LRtwilek.utc perhaps?) in the override folder. For simplicity you should set the tag and template resref fields to the same as the intended filename (without the .utc extension). before you save.

The name of this file is what you use in either your spawn script or the area's .GIT file when you place the NPC in the game world.
Page: 1 of 1