TheGreatXL Posted April 27, 2005 Share Posted April 27, 2005 I looked for a guide on how to do this and didn't find one. (or maybe I missed it. If I did, I'm sorry for opening a new thread.) I've made an armor exclusively for Atton. Everything in that department works fine. What I was wondering about was how to give Atton the armor after getting to a certain result in the dialog. Or more specifically, I wanted to give Atton this armor when you choose to train him as a Dark Jedi. Also, I was planning to make an armor for Atton when he is trained in the ways of the lightside. If possible, I would even like to make an armor for him available when you refuse to train him as a Jedi. Would someone please be willing to direct me to a guide or give me the steps to do such a thing? I will be eternally greatful to the person(s) who help me. Link to comment Share on other sites More sharing options...
boinga1 Posted April 27, 2005 Share Posted April 27, 2005 You'll need to set a script to fire when the dialogue takes place. Your script should look something like this: void main() { object oItem=CreateItemOnObject( "my_robe_tag", GetFirstPC()); } Should be pretty simple, really. Link to comment Share on other sites More sharing options...
TheGreatXL Posted April 27, 2005 Author Share Posted April 27, 2005 I was quite afraid you'd mention editing scripts as I have never done such things before. What script would I edit to include such a line? Sorry for such retarted questions, I understand that alot of you here find things such as scripting a second nature. I'm just an ignorant blonde from the south. Thank you (in advance) for having patience with me. Link to comment Share on other sites More sharing options...
TheCorman Posted April 27, 2005 Share Posted April 27, 2005 Thats not really a script you need to worry about, all you'll have to do is copy and past that into notepad, change "my_robe_tag" to the name of your .uti file that the armor uses (ie if your armor is AttonDark, the brackets would conatain: ( "AttonDark", GetFirstPC()); Then save it as filename.nss and compile then you'll need to use KOTOR tool to extract Atton.dlg, and use a tool like DLGEditor to attach the script to the line you want to link it to in this case the line where you say you'll train atton, but not as a jedi or whatever Hope that helps, i'm not a moder (thoguh I am working on some things) but I've been watching and reading about things on these forums for about a year (which is kinda sad if you look at my posts) *being tired, and obsesed with fixing spelling online don't mix* Link to comment Share on other sites More sharing options...
boinga1 Posted April 27, 2005 Share Posted April 27, 2005 You'll have to forgive me, but I'm also an ignorant blonde (dirty blonde, anyways) from the South. Let me tell you, script are easy. Yolu can probably find a better tutorial up here somewhere, but I'll try my best. A script basically tells the game to do something, almost anything. For your purposes, creating an item. What you have to do is copy/paste that little shmeal I gave you into notepad. Then save you file - we'll call this script atoon_robe.nss. Whatever name you choose, it must be in .nss file format. So, you have an uncompiled script. Now open KOTOR tool. Go to the Project Manger, under Tools. Create a new project in whatever folder you're working in, and set "Project File" and "debug path" in that same folder. Right-click on "Override" and choose add files. Now find your .nss file and add it. Then, tell the Manger to "Build Project" (under File). Now, in the folder you set as "Project File", there should be a folder called Override. In it, you should have a compiled .nsc script. Your script is ready. Now, open up the dialogue for Atton in DLGEdit (NOT KOTOR TOOL!!). Go to the node you want, about the Dark Jedi training. Go to "Script to run" (something like that) and type in the name of your script WITHOUT the .nsc extension. You should be good to go. Go in-game, and save a game at a point righ tbefore this conversation. If it works, great. If not, keep working on it. (You can get most of the info on compiling scripts here.. I just tried to compact this for you. Good luck, and welcome to the nightmare that is scripting. Link to comment Share on other sites More sharing options...
Darth333 Posted April 27, 2005 Share Posted April 27, 2005 I'm just an ignorant blonde from the south. OK, let's see if a blonde form the north can answer the question before people start making blonde jokes Originally posted by TheGreatXL I was quite afraid you'd mention editing scripts as I have never done such things before. What script would I edit to include such a line? There is no reason to be afraid of scripting. This is very simple: You open notepad, you copy/paste the script and you simply replace "my_robe_tag" by the tag of the robe/item you want to add (check the tag field .uti file). Save you script with a .nss extension (like myscript.nss) and compile as indicated in this tutorial: http://www.lucasforums.com/showthread.php?s=&threadid=143681 (may seem complicated but it's not: if you use a batch file it's no more difficult than a double click) finally attach it to the .dlg branch where you want the item to be given to the player (just type the name of the script in the script field of your dialog branch). edit: beaten by another blonde Link to comment Share on other sites More sharing options...
boinga1 Posted April 27, 2005 Share Posted April 27, 2005 A blone blonde walks into a barber shop. The barber asks her to remove her headphones... Link to comment Share on other sites More sharing options...
TheGreatXL Posted April 27, 2005 Author Share Posted April 27, 2005 You all are extremely helpful. Its quite scary that even I understood these simple directions. I'll edit this post as soon as I'm done and tell you if I got it to work. If not, I'll edit the post and blame it on my blondness. Thanks again to all of you. Link to comment Share on other sites More sharing options...
Darth333 Posted April 27, 2005 Share Posted April 27, 2005 If it doesn't work or if you need clarifications don't hesitate to post your questions. Link to comment Share on other sites More sharing options...
stoffe Posted April 27, 2005 Share Posted April 27, 2005 Alternatively, if you want to avoid having to modify Atton's dialog, you could just modify the script that makes him a Jedi instead and make it give him the robe at the same time. That script is called "a_makejedi". You could modify it like this: // a_makejedi.nss void main() { int nScriptNumber = GetScriptParameter( 1 ); if ( nScriptNumber == NPC_ATTON ) { AddMultiClass (CLASS_TYPE_JEDISENTINEL, GetObjectByTag("Atton") ); CreateItemOnObject("AttonRobeName", GetFirstPC(), 1, TRUE); } else if ( nScriptNumber == NPC_BAO_DUR ) { AddMultiClass (CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("BaoDur") ); } else if ( nScriptNumber == NPC_HANDMAIDEN ) { AddMultiClass (CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("Handmaiden") ); } else if ( nScriptNumber == NPC_MIRA ) { AddMultiClass (CLASS_TYPE_JEDISENTINEL, GetObjectByTag("Mira") ); } else if ( nScriptNumber == NPC_DISCIPLE ) { AddMultiClass (CLASS_TYPE_JEDICONSULAR, GetObjectByTag("Disciple") ); } } Replace where it says "AttonRobeName" in the code with the filename of your robe, recompile and put in Override and it should work. (At least that's what this blonde from the North thinks. ) Link to comment Share on other sites More sharing options...
TheGreatXL Posted April 27, 2005 Author Share Posted April 27, 2005 Wow, there are so many alternate ways to do this. It's kind of freaky. But anyways, I'm to the part in which i'm editing Atton's dialog. (Which seems to be the simplest way to do this thing right now. Although I will try all of these ways later on to see which I like best.) There are many different choices in which to train him as a dark jedi. Do I have to add the refrence to all of the choices if I want all of them to give Atton the robe? Edit: Nevermind, I found the exact line where is says [Atton has taken his first steps on the path of a Dark Jedi Sentinel. His power will grow as he travels with you and masters what you know of the Force.] I'm guessing that is where I add it. Link to comment Share on other sites More sharing options...
T7nowhere Posted April 27, 2005 Share Posted April 27, 2005 stoffe -mkb-'s way is the easyest and most efficient way to do it. But if you are going to edit or write dialog files and you just want to give an item you can use the generic scripts in this case to have an item put into your inventory you would use the script a_give_item. you would type a_give_item in script #1 or Script #2 boxes and then in the String Param box inthe same row as your script you would type the Items ResRef. But in your case I would go with Stoffe's suggestion. Link to comment Share on other sites More sharing options...
Achilles Posted April 27, 2005 Share Posted April 27, 2005 stoffe -mkb-, Your suggestion won't work for one reason: Jedi robe require Jedi Defense. Multiclassed NPC's have to level up before they can equip Jedi specific items. I suppose you could mod the script to give them that feat prior to the equip statement or the user could mod the robe to not requite Jedi Defense. Sorry to be the killjoy. ...And T7nowhere, I'm glad you posted what you did. As I was reading the thread I was afraid that everyone was overlooking one of the easiest solutions of all. Link to comment Share on other sites More sharing options...
stoffe Posted April 27, 2005 Share Posted April 27, 2005 Originally posted by Achilles Your suggestion won't work for one reason: Jedi robe require Jedi Defense. Multiclassed NPC's have to level up before they can equip Jedi specific items. Right, sorry about that. That's what you get for posting right before going to bed I suppose. (I'd forgotten about that since I removed that restriction in my game. Thought it was a bit silly you needed to be a certain class to wear what essentially is plain clothes...) I modified the script above to only put the robe in the inventory to avoid further confusion. Link to comment Share on other sites More sharing options...
TheGreatXL Posted April 27, 2005 Author Share Posted April 27, 2005 Originally posted by T7nowhere stoffe -mkb-'s way is the easyest and most efficient way to do it. But if you are going to edit or write dialog files and you just want to give an item you can use the generic scripts in this case to have an item put into your inventory you would use the script a_give_item. you would type a_give_item in script #1 or Script #2 boxes and then in the String Param box inthe same row as your script you would type the Items ResRef. But in your case I would go with Stoffe's suggestion. Sorry to be such a headache to you all, but I put "a_give_item" in the box that says 'Script #1' and went over to the "String Param" and typed 'attonarmor' (the name of the robe I want given to him). I saved the atton.dlg file in my override folder. I went in game to test it out and I only received DSP for my answers to his questions and not the robe. Am I missing something, or am I still being a blonde. On a lighter note, there are three types of blondes in this world. Those who can count, and those who can't. Link to comment Share on other sites More sharing options...
Achilles Posted April 27, 2005 Share Posted April 27, 2005 Originally posted by TheGreatXL Sorry to be such a headache to you all, but I put "a_give_item" in the box that says 'Script #1' and went over to the "String Param" and typed 'attonarmor' (the name of the robe I want given to him). I saved the atton.dlg file in my override folder. I went in game to test it out and I only received DSP for my answers to his questions and not the robe. Am I missing something, or am I still being a blonde. On a lighter note, there are three types of blondes in this world. Those who can count, and those who can't. Couple of things to consider: Does the dialog/script work when using one of the game's default robes? Can you use the giveitem command to get the robes normally? If giveitem works but the script doesn't then there's something wrong with the dialog. If the dialog works with the default robe, but not your robe, then the robe is the problem, not the script. I hope that helps. Link to comment Share on other sites More sharing options...
T7nowhere Posted April 27, 2005 Share Posted April 27, 2005 Make sure you have the robe in override, also make certain that the name of the script and the Resref do not have a space after the last letter. The game will count a space as a valid character. Link to comment Share on other sites More sharing options...
TheGreatXL Posted April 29, 2005 Author Share Posted April 29, 2005 Here's another question about a different robe I'm making: What kind of script would I need to give a robe to someone who reaches 100% Lightside or 100% Darkside, or is this even possible? I was thinking of making two powerful robes called the "Serenity Robe" and "Chaos Robe" and I wanted the PC to receive these when they reach 100% in their respective alignment. Also, thank you all for all the help you have offered me thus far. I have tempted to mod for several games, and this has to be the most helpful community by far. Link to comment Share on other sites More sharing options...
stoffe Posted April 29, 2005 Share Posted April 29, 2005 Originally posted by TheGreatXL What kind of script would I need to give a robe to someone who reaches 100% Lightside or 100% Darkside, or is this even possible? I was thinking of making two powerful robes called the "Serenity Robe" and "Chaos Robe" and I wanted the PC to receive these when they reach 100% in their respective alignment. I assume you mean they will be given automatically and not when you speak to someone, right? If so, extract the script named "k_align_movie.nss" with KotorTool from BIFs --> Scripts.bif --> Script, Source. Open this script, find the main() function. After where it says: void main() { ...add a new line and paste this code: object oPC = GetFirstPC(); if ((GetGoodEvilValue(oPC) == 100) && !GetLocalBoolean(oPC, 61) && !GetIsObjectValid(GetItemPossessedBy(oPC, "TAG_OF_LIGHT_ROBE"))) { SetLocalBoolean(oPC, 61, TRUE); CreateItemOnObject("RESREF_OF_LIGHT_ROBE", oPC); } else if ((GetGoodEvilValue(oPC) == 0) && !GetLocalBoolean(oPC, 61) && !GetIsObjectValid(GetItemPossessedBy(oPC, "TAG_OF_DARK_ROBE"))) { SetLocalBoolean(oPC, 61, TRUE); CreateItemOnObject("RESREF_OF_DARK_ROBE", oPC); } Where it says TAG_OF_DARK_ROBE, put the tag of your evil robe, and replace TAG_OF_DARK_ROBE with the tag of your good robe. (You set the tag when you create your item UTI file.) Where it says RESREF_OF_DARK_ROBE, put the filename (without .uti suffix) of your evil robe, and replace RESREF_OF_LIGHT_ROBE with the filename of your good robe. Compile and put the script in the Override folder, and the robe should plop up in the inventory of the player when they reach either lightside or darkside mastery. Note that the addlightside/adddarkside console commands do not trigger this, only "normal" alignment changes in-game (the ones with swirling clouds, playing sound and icon popping up on the GUI) will work. Link to comment Share on other sites More sharing options...
TheGreatXL Posted April 29, 2005 Author Share Posted April 29, 2005 Okay, I'm getting really agrivated with this atton.dlg file. Everytime I find the part to train him as a dark jedi and put the script name (and armor name if using a_give_item script), and save atton.dlg, it doesn't really save. I'll open it back up only to find that what I typed is now gone. I've had this issue for the last few days but I thought I could find a way to fix it myself. I guess not. Link to comment Share on other sites More sharing options...
T7nowhere Posted April 29, 2005 Share Posted April 29, 2005 You have to apply the changes, by defualt DLGeditor auto applys when you select a new node. you can enable to apply changes button in the options so that you don't have to switch nodes. Link to comment Share on other sites More sharing options...
tk102 Posted April 29, 2005 Share Posted April 29, 2005 [off topic] Ok, I'll take this as a DLGEditor request: when saving, saving as, or closing a file, Apply Changes should be done implicitly if Auto-Apply is enabled. Gotcha... [/off topic] Link to comment Share on other sites More sharing options...
TheGreatXL Posted April 29, 2005 Author Share Posted April 29, 2005 Ah, gotcha. See, that was my problem. I would always put in the information, save, and close. Edit: Wow. I would first like to thank everyone on this board who stopped by to help me with this mod. Being the ditz I am, it took me awhile to figure it out, but with step by step help from everyone, I have finally succeeded. http://i4.photobucket.com/albums/y149/TheGreatXL/AttonsJediCivilWarArmorBeingReceived.jpg I plan to make a Lightside Jedi armor for Atton too and go through the same steps. For someone as script-illiterate as I am, I can't believe I did it right. (A very special thanks to all of the blondes who helped me. Just because, well, your blondes like me. ) Edit 2: The mod is now up at PCGameMods.com - http://www.pcgamemods.com/12151/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.