PDA

View Full Version : How to get item


LordRevan999
01-22-2008, 02:40 AM
I have made a new reskined armor of bendakstarkiller.I have used his utc file to change his appearance to the reskined armor I made.Now my question is how do I make that hutt(which ever is his name in the arena)give bendak's armor to pc when bendak dies I know there was mod like this but can you still tell me how can I do this stuff.

Stream
01-22-2008, 02:51 AM
Hey there, compile this script and attach it to the Hutt's dialog sometime after defeating Bendak, either when you collect the credits of when you talk to him to do the next fight. - It's been a while since I've played this part of the game and I can't remember when you fight Bendak.


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

CreateItemOnObject("Tag_Of_Armour", oPC);

}

--Stream

LordRevan999
01-22-2008, 02:59 AM
And how do I compile a script.And from where can attach the script with hutt's dialog.

Stream
01-22-2008, 06:10 AM
There are many ways to compile a script, I personally use TSL Patcher as I use it to edit 2da and journal files, this thread explains how to compile scripts and the tools you need http://www.lucasforums.com/showthread.php?t=143681.

As for attaching the script to a dialog, use DLG Editor and look at the nodes, when you find the right one just enter the script name, without the extension, into the 'script that fires when spoken' field.

--Stream

LordRevan999
01-23-2008, 10:50 AM
Alright I read the tutorial and I like to use the kotor tool method of scripting,but as always problems come,I opened the text editor from kotor tool and then chose script for K1.But now at the bottom right corner a list box is present and there are functions so how do I find that which function would give me a script similar to the one deadly stream posted above.

Stream
01-23-2008, 11:34 AM
If you scroll down you'll see the CreateObject function if you double click it, it will add that function into the script but you don't actually have to do that, just copy what I put above and paste it into the text editor, all you have to do is add the tag of the armour into the script and compile it.

--Stream

LordRevan999
01-23-2008, 11:44 AM
I have compiled it and now how do I attach that to the nodes or whatever you were saying.And another question is there a site or link where I can find all the scripts like the one above.

By the way I just tried the other method of creating the script by clicking on the CreateObject Function It gives me something like this: "CreateObject("So if I want to use this method what should I write next to the "(".

Marius Fett
01-23-2008, 11:51 AM
To attatch it to a dialog node open the dlg file in DLGEditor.

Find the node you want it attatched to click it and enter the script name in the Script that fires when spoken field.

LordRevan999
01-23-2008, 11:56 AM
Can you give me a pic of what you are telling I can't just seem to understand that nodes stuff.
P.S=What is a node?

Stream
01-23-2008, 01:42 PM
Here's two images of DLG Editor in action, one is for KoTOR and the others for TSL.

In both cases the Red text is what the NPC says and the Blue is the PC.

KoTOR
http://www.deadlystream.com/Images/KT1.jpg (http://www.deadlystream.com/Images/K1.jpg)

TSL
http://www.deadlystream.com/Images/KT2.jpg (http://www.deadlystream.com/Images/K2.jpg)

Click on the images to view the bigger image.

--Stream

Marius Fett
01-23-2008, 02:01 PM
Whoever wrote that dlg file spelt taught wrong :lol:

Stream
01-23-2008, 02:26 PM
That was me and you're right, well spotted mate - I haven't got around to double checking yet but I'm not looking forward to it, I have a bad habit of not looking at the screen when I'm writing, no matter how hard I try I can't get out of it.

--Stream

Marius Fett
01-23-2008, 02:55 PM
Keen eyes... :D

LordRevan999
01-24-2008, 04:35 AM
I have opened dlgeditor but how and where can I find my dlg file so I can open it.

Stream
01-24-2008, 05:21 AM
You have to extract them with KoTOR Tool first, for K1 they're in the s_rim file of the module and for TSL they're in erf>modules>modulename.

--Stream

LordRevan999
01-24-2008, 07:39 AM
I found the dialog I want to edit but the line of ajurr the hutt already has a script's name in the script that fires when spoken.So what should I do.And I also want to edit that line to add some words how do I do that.

Stream
01-24-2008, 09:23 AM
So you can have both scripts running on the same node, use this code for your script;

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

CreateItemOnObject("Tag_Of_Armour", oPC);

ExecuteScript("Original_Script_Here", OBJECT_SELF);

}

And attach that to the node - now both your script and the original will fire from the node.

As for changing the text, delete whatever is in the StrRef field and replace it with -1, now the text area below it will be empty and you can type whatever you'd like in there.

--Stream

LordRevan999
01-24-2008, 04:56 PM
I did what you said but that string ref part is not working.I change it to -1 and then write what I want then I save it and close dialog editor and then when I open it again or check in the game it is not there but the old original line is present.

Stream
01-25-2008, 02:42 AM
Sorry I forgot about this part, once you've changed it you have to click on another node before saving or closing do the changes don't take effect.

--Stream

LordRevan999
01-25-2008, 06:05 AM
OK worked thanks by the way where can I find other scripts as there are many I think.

Stream
01-25-2008, 10:32 AM
What kind of scripts are you looking for? The best way is to take a look at the source scripts in the KoTOR Tool bif sections. Another good place is to look through nwscript as it has all the script functions, if you take a look through there you'll see that the script above is 135 in nwscript.

--Stream

LordRevan999
01-25-2008, 10:54 AM
Um,what is nwscript?

Stream
01-25-2008, 11:37 AM
You'll find it in the source scripts section of KoTOR Tool or with any script complier.

--Stream