PDA

View Full Version : Starting Lightsaber


GrayJedi
04-10-2006, 01:01 AM
KOTOR 1
I was wondering how you change the original lightsaber hilt you get on Dantooine with your first saber, to Malak's long saber hilt.

LiquidZoo
04-10-2006, 03:19 AM
To do this, you would have to change every hilt for the starting colors (blue, yellow, green) to Malak's hilt. Shouldn't be too hard to do if that's what you want.

On the other hand, if you want one, and only one, for your PC; the best way to do that would be with a script. I personally like that idea, as it lends more of a personal touch. I have a mod that I am still completing that spawns a custom npc when you become a jedi and through dialog with that npc, he/she (one each depending on your light/dark tendency) gives you 2 sabers, at least one of which is restricted to the PC.

It all depends on which route you want to go. I'd be happy to help you out with scripting or file modification if you want to try this yourself. I'm by no means a guru, but I can help where I can.

GrayJedi
04-10-2006, 05:34 AM
Yes modifying all three initial hilts for (blue, yellow, green) is my idea. However I am not sure which .ncs file to edit under danm13_s.rim. Or perhaps I am looking in the wrong area?

LiquidZoo
04-10-2006, 11:56 AM
You will need to extract w_lghtsbr_006.mdl and w_lghtsbr_006.mdx from bifs > items.bif

You will also need 1 of each color you want to replace from erfs > texturepacks > swpc_tex_tpa.erf > W Look for w_lsabre Make sure you get both the tga and txi file.

You would need to rename each of the tga and txi files you got to be something like w_lsabreblu01.tga. Then you need to open the mdl file in a hex editor (you can get one here (http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm))

On the right hand side, you will need to search for 2 things. The first is w_Lghtsbr (you will see one right away, Ctrl+F to search through). Find all instances of that string and change the 006 to 001. Next you will need to search for w_lsabre (searches are case sensitive) and replace the red01 with blu01. This will make This particular model use that blue crystal. Save this in your override as w_lghtsbr_001.mdl and copy the mdx file there as well, changing the number from 006 to 001. Repeat this process for 003 (green) and 004 (yellow). From there, when you have them in your override folder, it should replace all 3 of those hilts in-game with the longer Malak model.

darthmaster50
04-10-2006, 06:46 PM
Edit tga files/txi files. Then rename file and model textures. Then edit script that gives you the saber.

GrayJedi
04-12-2006, 03:07 PM
On the other hand, if you want one, and only one, for your PC; the best way to do that would be with a script. I personally like that idea, as it lends more of a personal touch.
Okay LiquidZoo now that I know how to replace the existing three hilts how can we make this personal lightsaber an entirely unique item (the 2nd method you suggested) with scripting. For default purposes let's say it has Malak's hilt with a blue blade. Anyone else willing to add suggestions is welcome as well.

LiquidZoo
04-12-2006, 07:51 PM
Depends on where you would like to get this saber. If you want to get it on Dantooine when you first become a jedi, that's easy. Otherwise you will need to do some extra work (still not hard).

Ok, this time we want to extract a uti file for the saber, an inventory icon, and a crystal uti and tga file.

For the crystal uti and saber uti, Let's first extract the saber. For this, you want to go BIFs > templates.bif > Blueprint, Item > g_w_lghtsbr01.uti (since you said you wanted it to be blue. We will also be using the model file you made above (001), but we will be changing it slightly. More on that in a moment.

For the crystal, you will want to extract one of the crystal uti files. This is not 100% necessary unless (highly recommended) you want the saber to be upgradable. They are in the same location as the saber uti files as g_w_sbrcrstl01-19.uti Extract whichever one you want, it doesn't matter at this point.

Next, we will extract the inventory icons. For this, you will go to ERFs > TexturePacks > swpc_tex_gui.erf > I Inside there, select a saber icon and a crystal icon. The crystal icon (iw_sbrcrstl_001-021.tpc) doesn't matter as much, more based on looks than anything else. For the saber icon, I like to use iw_lghtsbr_006.tpc

Ok, now that we have all of those files, let's go about changing them. Open the mdl file just as you did earlier in a hex editor. Find all instances of the w_Lghtsbr_001 and change it to a different number. I recommend a high number, but it depends on what numbers are already used by other mods you may have installed. For the purpose of this demonstration, we'll change it to 099. Make sure you get all of them.

Next, find the 4 instances of w_lsabreblu01 and change it to 02. After that is done, save the model file as w_lghtsbr_099.mdl Copy the mdx file and rename it as the same thing. Copy and rename your w_lsabreblu01.tga and .txi files to 02.

The next thing we'll do is rename your saber crystal uti file to 99 as well, then open it with a GFF Editor (the one in KT will do fine) and change the Model Variation to 99, you will also need to change the Template ResRef and Tag to the 99 number. While you're at it, on the description tab give your crystal a unique name and description. Helps keep it separate from the others. Save that as g_w_sbrcrstl99.uti and open up your saber uti file.

Make the same changes to this file as you did to the crystal (model variation, template resref, and tag to 99) On the description tab, give your saber a unique name. Then on the properties tab, scroll down to the bottom and double click the star that's there to add a new property. You will want to add the following: In the Property dropdown, go to Feat Required then on the Subtype go to Force Sensitive. This is a unique feat that only your PC has. You can add other properties to it if you wish. Save the file as g_w_lghtsbr99.uti.

Next, rename your saber crystal tga and lightsaber tga files to 99 as well (iw_lghtsbr_099.tga)

Now we have the following files:

iw_lghtsbr_099.tga
iw_sbrcrstl_099.tga
g_w_sbrcrstl99.uti
g_w_lghtsbr99.uti
w_lghtsbr_099.mdl
w_lghtsbr_099.mdx
w_lsabreblu02.tga
w_lsabreblu02.txi

Now we have to make your saber upgradable. To do this, open the upcrystals.2da file using KT (if you already have one in your override, use that; otherwise extract it from BIFs > 2DA.bif > 2d Array > upcrystals.2da) Scroll down to the star at the bottom and in the Row Label column, enter the next sequential number (81 in my case, 7 in the default file). In the label column, enter something to describe your crystal. Make sure it's unique (could be BLUE_02 or something). In the template column, enter in the template of your crystal (g_w_sbrcrstl99). Because we didn't create a short or double version for this saber, those columns MUST have **** in them. In the longmdlvar column, enter the name of your saber uti (g_w_lghtsbr99) Save that file in your override and copy the rest of the files in there.

Now for the fun part, you need to decide where you want your saber to appear. I will use the Dantooine option I spoke of earlier. You will want a script such as this:

void main()
{
object oPC=GetFirstPC();

object oItem=CreateItemOnObject ("g_w_lghtsbr99", oPC);

ExecuteScript("k_pdan_makejedi", oPC);
}

Save this as whatever you want (saber_spawn.nss or whatever, if you save it in notepad, make sure you put quotations around the filename or else it will save it as a txt file). Next you will need to compile that script, there are many good tutorials in the Scripting Help forum here, so I won't get into that part.

Now you will want to attach that script to a dialog. I use dan13_dorak.dlg because it's a 1 time script (also the only time k_pdan_makejedi is fired). You can find that in RIMs > Modules > damn13_s.rim > Dialog Open that up and scroll through until you see the option (Continue) [End Dialog]. If you click on that, you will notice that k_pdan_makejedi is fired at that time. Well, we want our script to fire there instead (as it will call the makejedi script) so type the scripts name without extension in the 'Script that fires when spoken' box (in DLGEditor 2.2.4 anyway). Then put your compiled script and that dialog into your Override folder and fire up the game. You will notice that you get the item just as you become a jedi.

If you need any help with any part of this, or are lost (have a 102 fever atm, so I might not be making a whole lot of sense), please just ask.

GrayJedi
04-12-2006, 11:56 PM
Impressive! Most Impressive!

Your instructions are so good that I saved them in doc file. However I was able to create the new saber without making a new script. i just edited the zhar script before going to make your saber and I used all the .tga, .utc files you mentioned. I am going to try it your way now and see. I also used the 007 extension for the new saber. I use XVI32 for scripting edits.