View Full Version : [K1]Strange problem with lightsabers

02-26-2007, 05:41 AM
Ok, so I've been working on a mod for KotOR1 to make a new lightsaber similar to HotG and MotF. I used the files for a green lightsaber as a base since I decided to make the new lightsaber as close to the Viridian ones from TSL as possible, to go with HotG and MotF matching the Orange and Cyan 'sabers of TSL.

Now here's where it gets weird. My lightsaber works and displays the right color, but if I equip a green lightsaber afterwards, the green lightsaber displays the same color as my lightsaber.

This only happens when I replace my lightsaber with a green one or equip the green into my off-hand while my 'saber is in the main hand. It does not happen if I switch my 'saber to a blue one then a green one, and it does not happen if I unequip weapons entirely then equip the green one.

Is this a known problem? I didn't see anything about it when I was reading how to do the modeling/texturing of the lightsabers. How would I fix it?

Oh, and I did give the models/textures new file names and set the .uti's model variation accordingly in case anybody was wondering.

02-26-2007, 06:28 AM
Did you use mdlops to change the texture pointer of your model?

02-26-2007, 07:14 AM
I'm pretty sure I changed the texture pointer. I used stoffe's XVI32 Hex Editor to change w_lsabregren01 to w_lsabreverd01 4 times(8 for the double bladed) in the .mdl files of each.

If I'm wrong how would I change it? I'm having a hard time figuring out how this modeling stuff works.

02-26-2007, 08:26 AM
Using mdlops is a little more intuitive that hex-editing. It allows you to input what you want to replace and will go through and change the value in all the locations that you specify.

Here's a screenshot of the renamer function with a saber loaded:


The first entry is for the skin of the hilt, and the other four are for the blade.

Mdlops also has a replacer function that allows you to change the internal base-model name of your saber (or whatever). Even if you change the name of your model by choosing "rename", it's internal name remains the same unless you do this. Here's a screenshot:


Mdlops also has some basic tutorials included in the readme, so it shouldn't be hard to figure out. If you run into any trouble, post again, and I'll try to help.

Good luck!

02-26-2007, 10:46 AM
^^^ A Hex Editor is much faster and simpler to use to change the aurora base name.
You only need to change the first base name.

02-26-2007, 03:04 PM
Ok, thanks I'll try again with mdlops.

T7nowhere, what do you mean you only need to change the first base name? You mean only the first of the four I changed needed to ge changed and the rest could have stayed set to green?

02-26-2007, 03:21 PM
No, he's referring to the model base name ("w_Lghtsbr_251" in the second screenshot).

02-26-2007, 03:29 PM
oh, ok.

So I just type what the file will be called(only with the first letter after "w_" uppercase?) in the "New Name:" field and hit "Change Name," right?

I tried what you guys said and it still happens. I also noticed that the hilts are white instead of silver/metal, but I don't know if that's new or if I just didn't notice it before.

I also can't seem to open the .tga files for the inventory icons of the lightsabers without the whole background turning the same color as the 'glow' normally around the lightsaber in the icon. I'm using Adobe Photoshop CS2 if it helps.

02-26-2007, 04:42 PM
That's the same problem I've been having with Jackel's pink lightsaber mod. Hex-editing the base name seems to have fixed this.

02-26-2007, 04:49 PM
The first problem sounds like your sabers aren't associated with a skin. Did you do a reskin, or use the default? The name of the skin should be the the first entry in the first screenshot I posted.

The thing you're talking about with the inventory icons is normal. The rest of the icon is made transparent by an alpha channel when you view it in-game. Here's what the alpha looks like for the default saber:


02-26-2007, 05:17 PM
What I've been trying to do, but have been unsure about, is leave the hilt as the default and make a new blade color. As I understand it, the .tga that looks kind of like a cross-section of the lightsaber(ex: w_lsabregren01.tga) is the appropriate thing to recolor in this situation.

I used the directions in T7nowhere's post in this topic to get to where I am, only I started out with green lightsabers since they are closest to the color I want to make, and all the places that he said to call stuff w_lsabreturq02 I called it w_lsabreverd01 instead, since it was unused and a better descriptor for a viridian lightsaber.

And what do I do with that Alpha channel picture to make the icon normal again? Or is it still there and I just can't see it in Photoshop, but it would be normal once in the game again?
Tested and found out myself.

02-26-2007, 05:48 PM
OK, so if you're using the default saber model and skin, you shouldn't have to change the skin name.

Lets say your saber model is called w_lghtsbr_010.

You should have an mdl and mdx file for the model. If you open up the model in mdlops and choose "renamer", you should see:

lshandle01=w_lghtsbr_001 (no need to change the skin)

(Note that the plane #'s will not necessarily be the same.)

If you choose "replacer", it should say w_lghtsbr_010.

Aside from the mdl and mdx files (w_lghtsbr_010.mdl, w_lghtsbr_010.mdx in this case) , you'd need the texture for your blade colour, a txi file that modifies the texture, a uti for the actual saber, and a texture for the icon. You'd also need a texture and uti for the crystal, and an entry in "upcrystals.2da" for the saber.

If all of that is correct, once you drop the files in your override it should work.

02-26-2007, 05:52 PM
Ok, so then it was probably from unintentionally messing with the hilt skin. I'll try it out now.

That fixed the hilt's appearance. Now everything with my viridian lightsabers is appearing correctly. However I still have the problem where if I equip a green lightsaber after equiping the viridian one, the green one will look like the viridian one.

I know it isn't just my imagination though because when I equip a green in my main hand then the viridian in my off hand there is an obvious difference, but when I switch from viridian to green, or equip viridian in the main hand then green in the off hand they look exactly alike.

Is there anywhere else I could have made a mistake?

The files I have are ca_w_dblsbr001.uti, ca_w_lghtsbr01.uti, ca_w_sbrcrstl01.uti, ca_w_shortsbr01.uti, iw_dblsbr_010.tga, iw_lghtsbr_010.tga, iw_sbrcrstl_022.tga, iw_shortsbr_010.tga, suvam03a.utm, upcrystals.2da, w_dblsbr_010.mdl, w_dblsbr_010.mdx, w_lghtsbr_010.mdl, w_lghtsbr_010.mdx, w_lsabreverd01.tga, w_lsabreverd01.txi, w_shortsbr_010.mdl and w_shortsbr_010.mdx.

The model variation is set to 10 in all three lightsaber .uti files and 22 in the crystal .uti file. I've added all three appropriately to upcrystals.2da, changed every "w_lsabregren01" int the .mdl/.mdx files to "w_lsabreverd01" and included "blending additive
decal 1" in the .txi

02-26-2007, 11:49 PM
Where can I find the hilt skins with Kotor Tool? I noticed that the glitch only happens when the Viridian 'saber equiped before hand is the same type(single/short/double) as the green one equiped afterwards. I think it may come from sharing the skin of the hilt but not the skin for the blade.

So, I figure I'll just copy the hilt skin for each type of 'saber, rename the copies, and set the viridian lightsaber's models to use those.

No go, I found them and it didn't work. Any ideas left?

02-27-2007, 12:12 AM
Open your .mdl's in a hex editor. Search for these values(one for each type of model).
These are the base model name(green sabers).

w_Lghtsbr_003 (single)
w_Dblsbr_003 (double)
w_ShortSbr_003 (short)

These will be case-sensitive. If you find any of these entries, that would be your problem. They should be re-named:

w_Lghtsbr_010 (single)
w_Dblsbr_010 (double)
w_ShortSbr_010 (short)

If they point to the old green models and you have a green model present, it will look to the old green model file because of the base name.

02-27-2007, 12:19 AM
All of the in-game sabers use the same skin textures:

Under "W" in swpc_tex_tpa.erf.

I can't imagine that the skins have anything to do with the blade colour issue you're having though.

Honestly, what I would do is start from scratch with a fresh set of models. Extract the blue lightsaber this time (w_lghtsbr_001), and try to get that to work properly. Once that's done, then you can move on to the double and short.

Something that I've found to be useful when testing problems with mods is the KMM mod manager - it's a bit easier than adding and deleting things from override all the time. KSE also comes in very handy, although I'm guessing you're already using that.

This may sound like a stupid question, but are you deleting the sabers from your inventory and adding them back with KSE every time you make a change?

02-27-2007, 12:55 AM
I wouldn't use a blue saber to start with. The name used for the base model reference and the hilt texture is the same: w_Lghtsbr_01. IMO it's easier to use a different color saber since when you see w_Lghtsbr_01 you know it's the hilt texture reference.

EDIT: that should be w_Lghtsbr_001.

02-27-2007, 01:16 AM
If you use mdlops to do the re-naming, the model used is irrelevant really. There's not much chance of getting the two values confused. Anyway, the model name has an extra "0" - w_lghtsbr_001.

02-27-2007, 01:49 AM
deathdisco's idea worked, the lightsabers are now funtional. I still have to test if Suvam Tan will sell the crystal or not though, hopefully I have a save before his third inventory on my laptop.

And thanks for the tips about kmm and KSE, but I was already doing all that ;)

Some final testing tomorrow after class and I'll be done and ready to post it. I'm afraid I still have one last thing to ask involving this mod, but could somebody post a save I can download that isn't too far before Suvam Tan selling his third inventory of items? I've been testing the lightsabers from a quicksave that is literally before I opened the footlocker in my room on the Endar Spire, and I'm not positive that I still have a save in the right spot from when I played through on my laptop.

Or telling me what golbal(s) to set so the game thinks I'm to that point and what warp code to use to get there would work too.

And I'd like to say again, thank you everybody.

02-27-2007, 04:10 AM
Glad you got it working. :)

Model and texture both have the same name: w_Lghtsbr_001. I just typed in error. :xp: