Jump to content

Home

Help with appearance.2da and editing .utc files


Ulan_Yandu

Recommended Posts

I am trying to understand the relationship between lines in appearance.2da, portraits.2da, heads.2da to the .utc file for a character. As a reference, I am trying to add RedHawke's Recruit RedHawke mod to an already edited appearance file. I added a line at the end of the appearance file which I copied from the mod's appearance.2da using the excel 2da plugin. I changed the row number from 509 to 545. I used the same process when editing heads.2da and portraits.2da. When I go and try to recruit the character, she looks like Ayala Secura, which is the mod that is on line 509 in my modded appearance file. I used KOTOR tool to open p_redhwke.utc and it gives me this error message:

 

One or more drop down menus could not be set.

This occurs when the file's index value for a menu exceeds the number of items on the menu itself.

Menus with this error have been colored to make them more visible and will need to have a valid menu item selected.

 

So, as I understand it so far, p_redhwke.utc is looking to line 509 for the appearance of the character. I want to know if I can use some tool to change where the .utc file looks for the appearance, head, and portrait if that is possible? Is there any way to get KOTOR Tool to use my appearance.2da rather than the one that comes with the game? It only gives me the default options for appearance and portrait choices.

 

Also, I tried to use the View GFF Files as Text function from the File menu on KOTOR tool to change the appearance_Type Value to 545 on line 0018, but I think it corrupts the file after that since when I try to open the file again, it gives me an unhandled memory exception. Then, it won't open the file anymore and I have to copy it over from the mod.

 

Sorry about the long post, but I was trying to explain the problem as best I could. Any help would be greatly appreciated.

Link to comment
Share on other sites

Hello there. :)

 

First off, without having that mod, I can't very well address what's going on in the UTC files and such.. I can however offer some help without it, and we'll see if that works at all. If not, we'll see what else we can do after. ;)

 

Now.. first a basic Kotor Tool concept. When it loads and opens up the tree view, the files there are DEFAULT files it finds within the game's resources. To "use" the ones in your override folder, simply load them --don't bother looking for them in the tree at all.

 

For example, to load YOUR appearance.2da you just click the 2da button to bring up an (empty) 2da editor. Then on that window, select File > Load 2DA v2.b file... (the first choice) and then navigate to your KOTOR\Override folder (for either game). Be sure you're loading the file for the right game if you have both installed.

 

Now just edit as needed, and then use File > Save As 2DA v2.b... Make sure again that you're in the proper override folder and save it as appearance.2da

 

This is generally true for all files when working with Kotor Tool. If you grab it from the tree view, it's a default, unmodified file. If you specifically load it from your own override folders, it's something that's already been changed.

 

Now then... Hope that part helps some. Let's address your question about the relationship of those 3 specific files.

 

Appearance.2da has two colums called normalhead and backuphead for every row. In those fields, you simply tell it which row label to look up in heads.2da

 

So say your "new" head is row 110 in your modified heads.2da. Just change the normalhead colum in the correct row of appearance.2da to read 110.

 

I'm not positive what the backuphead deal is for. It's been a long time.. might have had something to do with cutscenes or something, but again I'm not really sure. I do think though you can usually either just enter the same number there or use **** (make sure it's four stars) and it should work fine. If the mod you're trying to incorporate though uses two different ones, then just look them both up and use the NEW number you'll be making those lines in YOUR heads.2da file

 

In other words, if the mod uses 107 and 108, but your heads.2da file already goes to 109, then you'd want to use 110 and 111, and also then add lines 107 and 108 from the heads.2da from his mod to your file, changing the numbers to 110 and 111.

 

Eesh... hope that made some sense. Having a little trouble explaining it with just text here. One of those "simple once you see it, but kinda tricky to explain" deals. ;)

 

Anyways... that's the only relationship for heads.2da All fields in the heads.2da file simply pick a model, then point to textures for light, and various dark transitions.

 

Now portraits.2da has 3 colums of importance here:

appearancenumber, appearance_s, and appearance_m

 

These basically correspond to the game's use of 'small' 'medium' and 'large' designations for the 3 choices of starting class. I don't remember offhand which is which, but these just differentiated between soldier, scout, and scoundrel in Kotor I and between sentinel, consular, and guardian in Kotor 2.

 

That's not really terribly important either way, but what IS important is that any new portrait line needs to use the proper numbers in the 3 colums we mentioned. So to get the portraits to work, you'd just add the new portrait line from the mod to the end of your portraits.2da file (changing the row label number to be one more than you had before), and then set those fields to the row(s) used for the character in appearance.2da

 

NPCs usually just get one appearance.2da line, so you put that row label in the appearancenumber field and **** in the appearance_s and appearance_l fields.

 

For a player, you should have 3 rows in appearance.2da, so you usually want the middle one in appearancenumber, then down 1 for appearance_s and up one for appearance_l.

 

And that's the only relationship with portraits.2da.

 

So... if you have new lines added (and re-numbered) in all 3 files, and you make sure the correct colums show the NEW row numbers in those files and then save them all in override, you should be good to go.

 

Hope that's helpful... If not, we'll see what else we can figure out. :)

 

-Kitt

Link to comment
Share on other sites

Appearance.2da has two colums called normalhead and backuphead for every row. In those fields, you simply tell it which row label to look up in heads.2da

 

Unless I'm mistaken the normalhead column refers to a line number in heads.2da and not the row label. Though since the row label usually is set to the same as the line number it shouldn't matter in this case (unless you are using some mods which adds lines with row labels out of sequence). :)

 

I'm not positive what the backuphead deal is for. It's been a long time.. might have had something to do with cutscenes or something, but again I'm not really sure.

 

The backuphead column is used for when the player is also using this appearance type, to provide an alternative head model to use so you won't run into your long-lost identical twin in the game. :)

 

If you don't want to provide an alternative head for those cases you can put the same heads.2da line number in both columns. If you set it to **** NPC characters using this appearance type will be headless in-game if the player also has chosen this appearance.

 

Now portraits.2da has 3 colums of importance here:

appearancenumber, appearance_s, and appearance_m

(snip)

NPCs usually just get one appearance.2da line, so you put that row label in the appearancenumber field and **** in the appearance_s and appearance_l fields.

 

It's probably better to point all three columns to the same appearance.2da line number if you don't have unique appearance types for the three main classes for this appearance. That way the same appearance type will be used regardless of which class the player picks.

 

For non-party NPCs and monsters the portraits.2da file isn't used at all AFAIK, since it's only used to enable the player to pick an appearance at character creation, and give party members their portrait images. So if you add an NPC-only appearance you don't need any new lines in this 2DA file.

Link to comment
Share on other sites

Unless I'm mistaken the normalhead column refers to a line number in heads.2da and not the row label. Though since the row label usually is set to the same as the line number it shouldn't matter in this case (unless you are using some mods which adds lines with row labels out of sequence). :)

 

Well, all I can tell ya is that if I load appearance.2da and heads.2da, if there's a number in the normalhead colum, looking it up in heads.2da under row label, it always matches. Were it by line number, those numbers would all be off by one, since the first row is always 0 (zero), which would be line 1.

 

Er.. hope I'm making sense there. LOL

 

And I'd never create any 2da file where the row labels aren't in order and sequential. Gods that'd be a disaster in no time, besides just being ridiculously fugly IMO. ;)

 

The backuphead column is used for when the player is also using this appearance type, to provide an alternative head model to use so you won't run into your long-lost identical twin in the game. :)

 

Ah yes. Now you've said it, I remember. Thanks for reminding me. :)

 

If you don't want to provide an alternative head for those cases you can put the same heads.2da line number in both columns. If you set it to **** NPC characters using this appearance type will be headless in-game if the player also has chosen this appearance.

 

Now this part I didn't remember, but then, I never used any of the various "Play as so-and-so" mods that let you be one of the NPCs, so I never saw anyone's head dissapear. Good to know though, since by default, there's a LOT of places where the **** is used. Actually, come to think of it, about half the file even uses those for normalhead, and the vast majority do so for backup. At least now I'll know why if I ever do use such a mod and suddenly have headless folks running around, and how to fix it. ;)

 

It's probably better to point all three columns to the same appearance.2da line number if you don't have unique appearance types for the three main classes for this appearance. That way the same appearance type will be used regardless of which class the player picks.

 

True, though if I understood the doccumentation properly, once you've specified a number for the first field, the **** in the other two should effectively do the same thing.

 

I won't swear that it works, just that's the way they made it sound when reading the doccumentation available on the 2da files, and I've seen them use that method quite a few times in the "stock" files, so eh. Your way is probably better though, since there's no chance at all of it not working as intended. :)

 

For non-party NPCs and monsters the portraits.2da file isn't used at all AFAIK, since it's only used to enable the player to pick an appearance at character creation, and give party members their portrait images. So if you add an NPC-only appearance you don't need any new lines in this 2DA file.

 

Oh, yeah. I meant party member NPCs. You're quite right --they and your "personal" character are the only critters of any sort who get portrait file attention. The original post was talking about a recruitable NPC mod, so I didn't even think to specify I meant NPCs you can put in the party. My bad. :)

 

Anyways, thanks for the clarifications Stoffe. I was pretty on-target, even if my wording was a little wierd, but I do appreciate the little nudges here and there when I'm a little off the path. Helps my brain remember... remember... hehe.. Now I feel Like Revan. This place.. it seems... familiar... ;D

 

-Kitt

Link to comment
Share on other sites

Well, all I can tell ya is that if I load appearance.2da and heads.2da, if there's a number in the normalhead colum, looking it up in heads.2da under row label, it always matches. Were it by line number, those numbers would all be off by one, since the first row is always 0 (zero), which would be line 1.

 

Line numbers also start as 0 (it's a programming convention where indexing often starts at 0 instead of 1 for some reason) so it's the same either way. :)

 

You may be correct that it uses row labels though, I don't remember for sure in this case. To add to the confusion the developers treat different 2DA's differently. Some are referred to by line numbers (placeables.2da, feat.2da, spells.2da are notable example) and ignore the row label, while some (visualeffects.2da for example) use the row label and the line numbers doesn't matter.

 

It's fairly easy to test though if you want to be sure: just change the row label of an existing appearance row. If a character using that appearance in-game still looks the same then the row label is ignored and it goes by line numbers. If it crashes then the row label is used. :)

 

And I'd never create any 2da file where the row labels aren't in order and sequential. Gods that'd be a disaster in no time, besides just being ridiculously fugly IMO. ;)

 

An example of a standard 2DA file where the row label does not match the line numbers is visualeffects.2da. Another example where the row label isn't even a number is plot.2da. Though in most cases the row label and line numbers tend to match. :)

 

 

I won't swear that it works, just that's the way they made it sound when reading the doccumentation available on the 2da files, and I've seen them use that method quite a few times in the "stock" files, so eh.

 

Only player selectable appearances need to have all columns set in order to be able to use that appearance no matter what starting class you pick. Party members only have a single appearance which isn't connected to their class so they only need the "standard" appearance set. The L and S columns are just used at character creation.

Link to comment
Share on other sites

Line numbers also start as 0 (it's a programming convention where indexing often starts at 0 instead of 1 for some reason) so it's the same either way. :)

 

Ok, but now you're just being evil. If you ask any typical non-programmer what number the first line of a file is, they're gonna say "one".

 

Granted, *I* get where you're coming from, since I've done my tour in the trenches with some old C++ and various forms of basic.. and so I know all too well how everything pretty much MUST begin at zero (else you'll be smashing your head on the keyboard for hours trying to figure out why it won't work), but eh. Semantics, as I said. ;)

 

 

You may be correct that it uses row labels though, I don't rememer for sure in this case. To add to the confusion the developers treat different 2DA's differently. Some are referred to by line number alone (placeables.2da, feat.2da, spells.2da are notable example) and ignore the row label, while some (visualeffects.2da for example) ignore line number and use the row label.

 

Well show me a product that was made by a "team" of several different programmers which *always* follows *exactly* the same conventions through the entire project and I'll give you a cookie. :p

 

In all honesty, I don't think I've done any modding in KotOR that used any of the files with "weird" row labels though, hence my assumption that most of them dealt with them directly rather than trying to reference a line number that you probably don't even remember. ;P

 

It's fairly easy to test though if you want to be sure: just change the row label of an existing appearance row. If a character using that appearance in-game still looks the same then the row label is ignored and it goes by line numbers. If it crashes then the row label is used. :)

 

ROFL! Ah... ye olde 'KEY-RASH! Whoops.. that wasn't it' method. We meet again! ;D

 

Heh.. yeah.. All too familiar with that method. It's a lot of fun if you actually expect it to happen, but man.. those days when you just can't for the life of you figure out what's causing the error (and it's usually a misplaced end brace or semi colon or something equally retarded burried in 12,000 lines of mind-numbing code) it'll drive you completely nuts. :D

 

 

An example of a standard 2DA file where the row label does not match the line numbers is visualeffects.2da. Another example where the row label isn't even a number is plot.2da. Though in most cases the row label and line numbers tend to match. :)

 

Had a look at those. visualeffects I can understand. They've essentially done the same thing I used to do ages and ages back in simple basic programs. They've used the row label here more like address blocks. You reseve them in groups of X and then group things within those reservations, so you can't do a traditional start at zero and then ++ each line there. Though looking at that as well as plot.2da, I tend to suspect it goes back again to that 'left hand vs right hand' concept, where had there been better communication, there would STILL have been a colum before the others which would simply be a sequential numbering -for simple continuity if nothing else.

 

At least.. were *I* the head developer, there would have been. I like things tidy. :D

 

Only player selectable appearances need to have all columns set in order to be able to use that appearance no matter what starting class you pick. Party members only have a single appearance which isn't connected to their class so they only need the "standard" appearance set. The L and S columns are just used at character creation.

 

Ayup.

 

Actually, you'd need the 3 selections in any situation where you had a choice of *starting* class, but since there's nowhere else besides character creation where that's an option, there we have it.

 

Now if you made a recruitable NPC mod which allowed you to choose the initial class of that NPC... different story. ;)

 

-Kitt

Link to comment
Share on other sites

Now that I have all the connections strait between the 3 .2da files, I got the appearance of the character Red Hawke to show up right in the game. Now, the problem is I can't get the recruit part to work. I talk to the character and get to the part where you choose who to replace. I choose who to replace and nothing happens. The original character doesn't get replaced. This is probably a problem in out of the replace or recruit scripts. The author didn't include the source scripts so I can't tell. I don't know if you guys can help me with this part. Perhaps I should try to contact the person who made the mod.

Link to comment
Share on other sites

You simply need to edit all the NPC's utc files to point to the new appearance line.

 

You were on the right track in the first post Ulan_Yandu, though I have never used KT's Gff editor I have always used this one...

 

EwaldTheUnimaginative's GFF/Erf editor ;)

 

Though admittedly I am using an older version of the above program.

 

You could also try tk102's KGff Editor available here. :D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...