rnaj525 Posted June 18, 2011 Share Posted June 18, 2011 Hey all. What I'm trying to do is trigger an NPC to become hostile via dialog for the second Knights of the Old Republic game. For an example, being able to kill Jana Lorso by first clicking on her to talk to her, then selecting a dialog option that triggers her to become hostile, allowing you to kill her. Pretty much just like the Kill Yuka Laka and Kill Gorton mods for the first game, only for TSL. I know it's done through scripting, but I can't figure out exactly how to do it. I have Kotor Tool, so just walking me through it will be much appreciated. Also, if there is already a thread that explains how to do this, please post the link and lock this one. Thanks. Link to comment Share on other sites More sharing options...
Ferc Kast Posted June 18, 2011 Share Posted June 18, 2011 Well, this should the trick; You'll just need to attach it to the dialog, after changing the npc tag to Jana Lorso's. (I checked nwscript.nss & this script is compatible with both KotOR I & II.) void main() { object oNPC = GetObjectByTag("npc_tag"); int iFaction = STANDARD_FACTION_HOSTILE_1; ChangeToStandardFaction(oNPC, iFaction); } Link to comment Share on other sites More sharing options...
rnaj525 Posted June 18, 2011 Author Share Posted June 18, 2011 Thanks, but if you don't mind me asking, what dialog do I attach it to? I assume the dialog file with the said NPC, in this case Jana Lorso. However, I looked all over Kotor Tool for the past hour or so with no luck in finding her .dlg file. Is there something I'm missing? Link to comment Share on other sites More sharing options...
JebusJM Posted June 18, 2011 Share Posted June 18, 2011 Script that fires at end of the conversation. Link to comment Share on other sites More sharing options...
Istorian Posted June 18, 2011 Share Posted June 18, 2011 Well, Jana Lorso's dlg is 203lorso.dlg which is located in the 209tel_dlg.erf file. And Jana Lorso's utc file is somewhat hidden, as it's resref is n_czerkaoff001. It's Tag though is 203_Lorso. Also, if you want to gibe the NPC a "kick" so they attack you, the script should look something like this: void main() { object oNPC = GetObjectByTag("203_Lorso"); int iFaction = STANDARD_FACTION_HOSTILE_1; ChangeToStandardFaction(oNPC, iFaction); ExecuteScript("k_ai_master", oNPC, 1005); } EDIT: Sorry, I had forgot to put the "k_ai_master" string! Link to comment Share on other sites More sharing options...
harark1 Posted June 18, 2011 Share Posted June 18, 2011 Finally there is a question I can anwser but you beat me to it. Just my luck, . Link to comment Share on other sites More sharing options...
rnaj525 Posted June 18, 2011 Author Share Posted June 18, 2011 Thanks, that helps ALOT. Now that I know the code and the .dlg and .utc files, I just need to know where I attach the code onto either file. Now, what I'm trying to do is more or less make it so that if you help the Ithorians and bring the droid intelligence to them, and Jana says something along the lines of: "I simply do not have time for you. My hands are full with managing the restoration project without a droid intelligence, which you so kindly handed to the Ithorians" I want to make a dialog option I can select which will trigger her to become hostile, allowing me to kill her. I know where her .dlg and .utc files are now, and the code to make her hostile, I just need to know exactly where I put the code, and my custom dialog which will trigger it. Link to comment Share on other sites More sharing options...
Istorian Posted June 18, 2011 Share Posted June 18, 2011 Well, first of all, change the script because I haven't posted it correctly at first. Now it's edited and should work fine! Now, you won't need to touch poor Jana's utc file, the only thing you need to be able to slice her is to tweak a bit her dialogue. Just go in the entry (red lines) of Jana that says: "I simply do not have time for you. My hands are full with managing the restoration project without a droid intelligence, which you so kindly handed to the Ithorians" right click and select Add New Reply. A blue line will appear below Jana's Entry. In the wide white box on the right you can write what you want the Exile to say, and in the left, in the box that says Script #1 just put the name of the script you've compiled, the script above (without the .ncs extension). Then save you .dlg file (do not change its name), and put both this and the .ncs compiled script in the override folder of your game. Done correctly, it should work like a charm! Link to comment Share on other sites More sharing options...
rnaj525 Posted June 19, 2011 Author Share Posted June 19, 2011 I noticed that there isn't a tab on the Conversation Editor that says "Script #1" There is however, "Node Scripts" "This File 1" "This File 2" "This File 3" Is it one of those? And if so, what box do I place the script name in? e.i. "End Conv Normal Script" "Script to run for this node" etc. And lastly, does it matter what I name the custom script with the code to make the NPC hostile? Sorry for all the nooby questions, but this is the first time I've done modding outside editing .2da files and .utc files. Link to comment Share on other sites More sharing options...
Qui-Don Jorn Posted June 19, 2011 Share Posted June 19, 2011 First off, I would download DlgEditor by tk102 from here... http://www.lucasforums.com/showthread.php?s=&threadid=135639 I find it better than trying to use KotORTool for dialog stuff..no offense to Fred. All you really have to do is open the Jana dialog with it, find the node you want to have her go hostile on, and then type "a_hostile" (without the quotes) in one of the two script boxes. Then put her tag in the box on the right side of where you put the script...but do what Istorian said about the "adding new reply" first, if you want multiple options. It might be a good idea to find the end of that conversation if its applicable too. It might loook like this.. Also turn the "view scripts" and conditionals on before you get started editing..I do that first thing. Link to comment Share on other sites More sharing options...
rnaj525 Posted June 19, 2011 Author Share Posted June 19, 2011 So, would this work? Link to comment Share on other sites More sharing options...
Istorian Posted June 19, 2011 Share Posted June 19, 2011 Yes, that is correct! The "a_hostile" is a script of the game that does exactly the same as my previous script, but is tremendously better, as it takes the Tag of the NPC you want to fight from the Script Param (Parameter) box. Therefore, it is a standarized script and saves you the need to create many scripts if you want more NPC's with other Tags to become hostile later on. As your scripting experiences grow, you'll find that the power of the script parameters is enormous. This tutorial by glovemaster will help you quite a bit. Link to comment Share on other sites More sharing options...
rnaj525 Posted June 19, 2011 Author Share Posted June 19, 2011 It worked, thanks everyone for your time Also, thanks Istorian for the link, it should help me out lots. Link to comment Share on other sites More sharing options...
Qui-Don Jorn Posted June 21, 2011 Share Posted June 21, 2011 right on.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.