Darth333 Posted July 17, 2004 Share Posted July 17, 2004 This is a tutorial on how to make your own recruitment mod: 1. Tools: Kotor tool Gff editor (I'll use Bioware's GFFeditor for this mod) edit (10-03-2004): now you can do most of this job with Kotor tool Graphic application that supports the .tga extension ( to add a portrait to the party selection table: otherwise, you can recruit the npc but his portrait will be black) Notepad HazardX script compiler 2. Make your custom dialogue: use Kotor tool integrated dialogue editor or tk102's wonderful DLGeditor 3. For more info concerning dialogues, read this post of mine. Check the Guide for the Newbie sticky to get all and the tools and for instructions on how to use them. 2. Making the mod: step 1 --> extract the .utc file for the future recruit: Select the npc you want to recruit. Extract the corresponding .utc. Since it is easier to work with an example, I will use Dustil ( you can download the mod at http://www.pcgamemods.com/u/3451/ - pls use my website only if you are unable to access pcgamemods: it is a 2.7 MB download - because of the sound files - and I have limited bandwidth. If I exceed it, then the site is down for a couple of hours ). I included the source code in the download. I strongly suggest that you follow this tutorial with the mod in hand. For Dustil, I extracted: kor35_dustil.utc Then rename the file: for dustil, i used p_dustil.utc. The name doesn't matter as it won't appear in the game. You could name it hello_holowan.utc and it would work, as long as it is a unique name (not used by the game). However, I recommend you use a name that will permit to identify the file easily. The reason why the name has to be unique is that it you simply use g_sithtroop002.utc (for a sith trooper), you'll end up overwriting everysingle g_sithtroop002.utc file in the game. Not only you'll have a ton of new friends (you'll see later, we will change the faction and behavior of the npc to that of a party member) but the game may crash when you reach certain points. For Dustil, I extracted: kor35_dustil.utc step 2 --> edit the utc file for the future recruit: Open the .utc file with GFFeditor. Now, we will edit the following fields (note, the present tutorial also covers editing .utc files for custom made npcs. However, it covers only the basics of making a recruitment mod. You can edit class, feats, inventory, etc. in the utc file but it is not covered here): a) AppearanceType: the number at the side , corresponds to yor npc's appearance row number in apprerance.2da. For Dustil, it is 432. Put the number corresponding to the appearance of the npc (in short, you will use this only if you recruit a custom made npc) b) then go down to the conversation field: type the name of the dlg file (without the extension) . Per example, for dustil i wrote p_ductilc: which is the name of the .dlg file that will be used by ductil once recruited. c) FactionID field: set it to 2 which is the faction id for party members. d) FirstName: This is the name that will appear on top of your npc's head when you paly the game. If you want to change the npc's first name (useful for custom made npcs) , put -1 in the top box (this means you are not referring to an entry no. in the .tlk file) and , if you have the English version of the game, 1 in the lower box. For other laguages, type one of the following numbers in the lower box: Language ID English 0 French 1 German 2 Italian 3 Spanish 4 Polish 5 Korean 128 Chinese Traditional 129 Chinese Simplified 130 Japanese 131 e) you may also alter the ForcePoints and GoodEvil fields ( for force points, take your npc's level into consideration and for GoodEvil:100 is 100% good and 0 is 100% evil ) f) Last name: works the same way as as first name but it is the last name of your npc... g) portrait id, this number will correspond to the row of your npc's portrait in portaits.2da file (this will bu used to make the portrait appear in the party selection table) . You may leave it blank for now unless except if you are not using any ither recruitment mod. If you are not using any other recruitment mod, then type 41, the original portraits.2da stops at 40) h) the scripts: this will define your npc's behavior. You want your npc to follow your pc and to react like a party member and not like an ennemy during battles, etc... Replace k_hen_blahblah by k_def_blahblah as follows in the following fields: ScriptAttacked --> k_hen_attacked01 ScriptDamaged --> k_hen_damage01 ScriptDialogue --> k_hen_dialogue01 ScriptEndRound --> k_hen_combend01 ScriptHeartbeat --> k_hen_heartbt01 ScriptonBlocked -->k_hen_blocked01 ScriptonNotice --> k_hen_percept01 ScriptSpawn --> k_hen_spawn01 Delete the entries in the other script fields. Example i) go to the tag field: type the tag of the npc you want to replace: (don't use a custom tag or the game will crash when it doesn't find the original npc when it was supposed to talk or do something ) T3M4: T3M4 Canderous: Cand Mission: Mission Jolee: Jolee Juhani: Juhani HK-47: HK47 Bastila: Bastila Carth: Carth Zaalbar: Zaalbar j) go to the TemplateResRef field and type a custom Template ResRef for your new npc: could be new_npc (i recommend using a name that will allow you to regognize the npc easily - it will not be seen in game but if you type hlf_f8fsrdfs you'll have probelms remembering what to type later on...) k) save and close the utc file. step 3 --> the script: This is the script that will tell your game to recruit your npc. Open notepad and paste the following script: void main() { RemoveAvailableNPC(7); AddAvailableNPCByTemplate(7, "p_dustil"); ClearAllActions(); DelayCommand(1.5,ShowPartySelectionGUI()); } In RemoveAvailableNPC, number 7 will replave t3m4, for other npcs, use one of the following slot numbers: BASTILA = 0 CANDEROUS= 1 CARTH = 2 HK_47 = 3 JOLEE= 4 JUHANI= 5 MISSION= 6 T3_M4 = 7 ZAALBAR = 8 In AddAvailableNPCByTemplate(7, "p_dustil"), also replace number 7 by the slot number of the npc you want to replace and replace p_dustil by the TemplateResRef you usedin the .utc file. Save the script as "recruit_npc.nss" (or whatever name you wish as long as it has a .nss extension - for dustil , the script is : 'dus_recruit.nss' - ) and compile with HazardX's script compiler. For instructions and troubleshooting concerning the script compiler, read this thread: http://www.lucasforums.com/showthread.php?s=&postid=1555923. COMPILING YOUR SCRIPT IS MANDATORY. YOU CANNOT BYPASS THIS. Once compiled, you should now have an new .ncs file - example the dustil mod gives you 'dus_recruit.ncs' (if you followed the instructions in the script compiler thread, the compiled script (.ncs file) should be placed in your override folder. You could also give the player the option to recruit whoever he wants. See this post and the following: http://www.lucasforums.com/showthread.php?s=&postid=1579579#post1579579 step 4 --> attach the script to a conversation: To recruit your npc, you need to attach the script somewhere in order to fire it. The best bet is to attach it to a conversation (dlg file). Open the dlg file with GFFeditor or TK102's dlg edit and select and entry or a reply. In the script field of that entry, type the name of your script without the extension anme in the field entitled script. Per eaxmple, in the Dustil mod, the script is attached to Entry no. 104 in the kor39_utharwynn.dlg file. Note, contrary to DLGedit, you wont be able to see the text with Gff editor so you will need to knoe the exact Entry/Reply number to which you want to attach the script to. You can view (BUT NOT EDIT) a dlg file with Kotor Tool: select the dlg you wish to view in the RIMs and press ctrl + double click. You should see something like this: http://img47.photobucket.com/albums/v144/Darth333/dlgkt.jpg example BiowareGFF example customGFF With dlg edit the procedure is similar: example DLGedit. step 5 --> edit the apprearance of your npc: If you want your npc to be able to wear armors and robes, you have to edit appearance.2da with Kotor Tool. I suggest you follow the BIFs section in T7's tutorial concerning editing appearance.2da: http://www.map-review.com/index.php?page=tutorial_view&id=28 In any event, look at what i did in the appearance.2da file for the Dustil mod: compare row 432 in the original file and the file included in my mod download. I edited the columns from modela to texj. (model is for model and tex is for texture...but do I need to explain this...) Look at the row number of the apprearance. If you need , reopen the utc file and change the row number corresponding to your npc's appearance in the apperance field (number 432 for Dustil). step 6 --> take a photo of your npc : You can now test your mod. Go to the game and test it, recruit your npc, select your new npc in the party selection table and take screenshot of your npc while in game, open it with a graphic application suc as photoshpop or paint shop pro (it has to support the .tga extension) and make a 64 or 256 pixels square, per example, and save at 32 bits. Check this thread for a state of the art explanation: http://www.lucasforums.com/showthre...hlight=sv%F6sh. Save your image as po_blahblah.tga ( for dustil, i used po_dustil.tga) Then, go to the portrait.2da file and add a new row: If you don't know how to add a new row to a.2da file, look at this thread: http://www.lucasforums.com/showthread.php?s=&threadid=130290 In the baseref column, type the name of your .tga file (po_blahblah) without the extension. Then, in the "appearance number", "appearance_f" and "appearance_s" colums, enter the row number of the appearance.2da file corresponding to the appearance of your npc. Race, normally it's 6 but check the "Race" field in your npc's .utc file just in case. screenshot of portraits.2da modifications in the dustil mod Save and close (before saving, just click on another row you'll loose your new row). Check the portrait.2da file in one of my recruitable mods to see how it's done. Finally, open the utc file with GFF editor and in the field entitled portraitID, and check the number of the row you just added to the portrait.2da file (per example 41). Step 7 --> eliminate "twins" : If you are recruiting an npc that is already used by the game, you may want to use an additional script or you may end up with twins. If you look at step 1 of this tutorial, you'll remember that we extracted the original .utc and renamed it. For the game these are two different objects, even if they have the same appearance. So when you recruit the npc, the original npc will still be there and you'll end up with 'twins". In order to avoid this, you can use the following script which will destroy the original npc on place: (note: don't look for this in the Dustil mod, it's not there. I made him run away instead of destroying him on place ) void main() { ActionPauseConversation(); object oGoodbye; oGoodbye = GetObjectByTag("my_npc_tag"); SetGlobalFadeOut(1.0, 0.5); DelayCommand(1.0, DestroyObject(oGoodbye)); DelayCommand(1.0,SetGlobalFadeIn(0.7,0.0)); ActionResumeConversation(); } oGoodbye = GetObjectByTag("my_npc_tag"); (leave the quotes there) and replace my_npc_tag by the tag of the original npc in the the game. OPen the .utc file of the original npc in the game with GFF or Kotor tool, for Dustil the .utc file is named kor35_dustil.utc, and check the tag field. For Dustil the tag is also kor35_dustil but the name of the file does not always correspond to the tag field so always check. Save with an .nss extension, compile and attach to dialog (do this at the very end of the conversation with the original npc or you'll ran into trouble if he disappears permanently before the end of the conversation). Additional stuff: What you can do with a recruit mod is infinite. You can add sound, conditions upon which the npc will be recruited, sidequests, journal entries, experiance points, etc. : these have all been covered at holowan labs and look at T7's stickcy Do you want to start modding? Then start here.. Therefore, there is only one more thing I will add: If you want to recruit a custom npc and want to spawn him somewhere before recruiting it. You need another custom .utc file. Extract a .utc file from a similar npc in the game (not the apperance but in characteristics - it's easier to simply change the appearnace number than re-edit all the stats). This is a new npc for the game so give it a new name. For the purpose of this tutorial , we will call it not_recruited_yet.utc a) Change the AppearanceType filed to the row number you wish in appearance.2da b) then go down to the conversation field: type the name of the custom dlg file (without the extension) . ër example, not_recruited_speaks c) FactionID field: set it to 5 which is neutral (if you set it to 1, you'll only have a battle and no dialog so no possibility to recruit). d) FirstName: This is the name that will appear on top of your npc's head when you paly the game. Refer to the 1st part of this tutorial e) Last name: works the same way as as first name but it is the last name of your npc... f) the scripts that define the npc's behavior should be already set if you did not first extracted an original party member .utc g) go to the tag field: type a custom tag. example "not_yet_recruited" j) go to the TemplateResRef field and type a custom Template ResRef : you can use the same name as the tag, "not_yet_recruited" k) save and close the utc file Spawning: use the following script: I'll use the Spawn Deadeye Duncan on Manaan Mod as an example. I uploaded the mod at pcgamemods but forgot to include the source. Here you have a complete package that includes the source code: http://mars.walagata.com/w/darth333/duncan_source.zip Spawn script: paste in notepad, make apporpriate changes, save as an .nss file and compile: (originally made by tk102) void main() { //do a whereami cheat to get the coordinates of the location //where you want the npc to spawn float x=0.00f; float y=0.00f; float z=0.00f; //unless you want something specific, forget about orientation float r=0.0f; vector vecNPC=Vector(x,y,z); location locNPC=Location(vecNPC, r); //insert your npc tag instead of dan26_duncan. Don't remove the quotes. object oNPC=CreateObject(OBJECT_TYPE_CREATURE,"dan26_duncan",locNPC); object oPC=GetFirstPC(); AssignCommand(oNPC,ActionMoveToObject(oPC)); //replace man26_duncan by the name of the dlg file the npc is supposed to use AssignCommand(oNPC,ActionStartConversation(oPC,"man26_duncan")); } Attach the script to a mandatory conversation - there are other ways of doing it but this is the most simple way: the idea here is to get you started - branch in the game, located in the same module you want to spawn the npc. Per example, when you first arrive on Manaan, a conversation begins with a republic officer. I attached the script to Entry no. 4, which is not being repeated (thus no problems spawning a new deadeye Duncan everytime you speak to the officer and no need to add anything else to the script. Feedback always appreciated. If you feel some points are not clear or if i forgot something, just say so and I'll complete the tutorial. Link to comment Share on other sites More sharing options...
Achilles Posted July 17, 2004 Share Posted July 17, 2004 Originally posted by Darth333 Feedback always appreciated. If you feel some points are not clear or if i forgot something, just say so and I'll complete the tutorial. Other than a few broken links and misspelled entries (see the Tag for T3-M4 in section 2-i for an example) this is great! I wish this was around about a week ago, this would have made things much easier =) Great work! Link to comment Share on other sites More sharing options...
Darth333 Posted July 17, 2004 Author Share Posted July 17, 2004 I corrected the tag for t3m4 and repaired the broken links. Link to comment Share on other sites More sharing options...
RedHawke Posted July 17, 2004 Share Posted July 17, 2004 Awesome tutorial Darth333! Now you have left me no excuse, I'm just going to have to use this tutorial and try a recruit mod. Hmm... Now... Whom to recruit? Link to comment Share on other sites More sharing options...
Darth333 Posted July 17, 2004 Author Share Posted July 17, 2004 Originally posted by RedHawke Now you have left me no excuse, I'm just going to have to use this tutorial and try a recruit mod. Hmm... Now... Whom to recruit? Your own custom made npc of course! You can recruit anything you want, even a Bantha ! I think the problem is not who to recruit but who to replace... Link to comment Share on other sites More sharing options...
RedHawke Posted July 17, 2004 Share Posted July 17, 2004 Originally posted by Darth333 Your own custom made npc of course! You can recruit anything you want, even a Bantha ! I think the problem who to recruit but who to replace... True... I've noticed that replacing T3 is one of the most common. Link to comment Share on other sites More sharing options...
Mav Posted July 17, 2004 Share Posted July 17, 2004 Very good stuff Darth333 hopefully this will lead to some great new mods, if I ever find some free time I'll know what to do. :D Link to comment Share on other sites More sharing options...
Achilles Posted July 17, 2004 Share Posted July 17, 2004 Originally posted by RedHawke True... I've noticed that replacing T3 is one of the most common. Bunch of frickin' droid haters... I'm actually making a NPC that replaces T3, but not because I dislike him. The other one I'm working on replaces Zaalbar =) Link to comment Share on other sites More sharing options...
Mav Posted July 17, 2004 Share Posted July 17, 2004 Bunch of frickin' droid haters... I'm actually making a NPC that replaces T3, but not because I dislike him. The other one I'm working on replaces Zaalbar =) I look forward to seeing those mods achillies Link to comment Share on other sites More sharing options...
Jackel Posted July 17, 2004 Share Posted July 17, 2004 Originally posted by Darth333 i) go to the tag field: type the tag of the npc you want to replace: (don't use a custom tag or the game will crash when it doesn't find the original npc when it was supposed to talk or do something ) T3M4: T3M4 Canderous: Cand Mission: Mission Jolee: Jolee Juhani: Juhani HK-47: HK47 Bastila: Bastila Carth: Carth You missed Big Z Link to comment Share on other sites More sharing options...
EnderWiggin Posted July 17, 2004 Share Posted July 17, 2004 Someone should give this to T7's Start Here Sticky or make this a sticky itself! Thanks Darth333! Great Work! _EW_ Link to comment Share on other sites More sharing options...
Darth Dex Posted July 17, 2004 Share Posted July 17, 2004 I vote for a STicky! Link to comment Share on other sites More sharing options...
Darth333 Posted July 17, 2004 Author Share Posted July 17, 2004 Originally posted by Jackel You missed Big Z I knew I was forgetting someone I just added Big Z to my list I don't think this tutorial should be a sticky: there are enough stickies on the first page. I think it would be better to add a simple link in the 'Do you want to start modding kotor? then start here' sticky. Link to comment Share on other sites More sharing options...
Achilles Posted July 17, 2004 Share Posted July 17, 2004 Originally posted by Darth333 I think it would be better to add a simple link in the 'Do you want to start modding kotor? then start here' sticky. Agreed! This needs to be added. Link to comment Share on other sites More sharing options...
deathdisco Posted July 18, 2004 Share Posted July 18, 2004 Oh no:p Another tutorial... must resist urge to mod..... At least until I have some free time. Good work, thanks Darth333. Link to comment Share on other sites More sharing options...
Tanesh Posted July 21, 2004 Share Posted July 21, 2004 Originally posted by Darth333 Spawning: use the following script: I'll use the Spawn Deadeye Duncan on Manaan Mod as an example. I uploaded the mod at pcgamemods but forgot to include the source. Here you have a complete package that includes the source code: http://mars.walagata.com/w/darth333/duncan_source.zip Spawn script: paste in notepad, make apporpriate changes, save as an .nss file and compile: (originally made by tk102) void main() { //do a whereami cheat to get the coordinates of the location //where you want the npc to spawn float x=0.00f; float y=0.00f; float z=0.00f; //unless you want something specific, forget about orientation float r=0.0f; vector vecNPC=Vector(x,y,z); location locNPC=Location(vecNPC, r); //insert your npc tag instead of dan26_duncan. Don't remove the quotes. object oNPC=CreateObject(OBJECT_TYPE_CREATURE,"dan26_duncan",locNPC); object oPC=GetFirstPC(); AssignCommand(oNPC,ActionMoveToObject(oPC)); //replace man26_duncan by the name of the dlg file the npc is supposed to use AssignCommand(oNPC,ActionStartConversation(oPC,"man26_duncan")); } Okay, I did it exactly as it was described here and I had a look at the source of the Duncan Mod, too. But somehow, it only works halfway. The NPC spawns, but just keeps standing on his spawn-point. He doesn't walk to my PC and start the conversation. The dialgoue starts only if I walk to him and talk to him. I just don't know why. And I really checked it several times. It has to work, but it doesn't. Please help! Link to comment Share on other sites More sharing options...
Mono_Giganto Posted July 22, 2004 Share Posted July 22, 2004 STICKY STICKY STICKY Hehehe, I'll be using this... And actually, I thought of something. It would be a short time recruitment, but what if you recruited a character after the leviathan, and have it take Bastila's slot? If you go lightside, they stay with you, then maybe darkside they die with Mission and Zaalbar(Maybe)? Is it possible to make them die if you go darkside? Link to comment Share on other sites More sharing options...
Darth Dex Posted July 22, 2004 Share Posted July 22, 2004 Yeah, Darth333 would tell you how, but she's on vaction. Link to comment Share on other sites More sharing options...
Tanesh Posted July 22, 2004 Share Posted July 22, 2004 Ok, forget about my post above. After a hard fight, I was able to make it work using a combination of Darth333's spawn script and one of Lilac Soul's Script Generator. Still don't know why Darth333's original spawn script didn't work for me, though. Link to comment Share on other sites More sharing options...
RedHawke Posted July 25, 2004 Share Posted July 25, 2004 Just 'officially' used the walkthrough Darth333, got everything working for the NPC recruit section in just a few hours, the dialogues took me the most time, but they are up and running. And I found no confusion with the tutorial, it went roughly step by step as you listed. You made doing a recruit mod far less intimidating, and provided the links all in one place... So Thanks Darth333! Now I'll just have to do the scripting for the new NPC's 'removal' from the party in the Unknown World temple, it goes with the NPC's story, and I'll be all set! Originally posted by Darth333 Your own custom made npc of course! I think the problem is not who to recruit but who to replace... Also Darth333 I decided on a completely custom NPC, as you suggested. It took around 6+ hours last night setting up the body and head models, fidgeting with body and head textures, making items, etc. I broke down and went ahead and replaced T3, I didn't have the heart to replace Canderous. So thanks again, for the tutorial Darth333! Link to comment Share on other sites More sharing options...
Darth333 Posted July 25, 2004 Author Share Posted July 25, 2004 Thanks a lot for this great feedback RedHawke! This is exactly the kind of feedback every modder dreams of: it allows us to see if we are on the right track or not. And congrats on the new mod I'll try it out. Concerning who to replace, I had an idea this week: why not add conversation options that would let the player chose who he want to replace. It could be something like this: PC: 1. ok, come with me, i have a droid to replace (attach script to replace t3-m4) (and why not add the obligation for the pc to sell him to a merchant first - conditional script - to make place on the ebon hawk ) 2. ok, come with me, you'll take the place of my wookie slave (attach script here) 3. ok, come with me, you'll certainly be more useful than a 14 yrs old girl for this "mission"... (attach script to replace Mission) etc... Link to comment Share on other sites More sharing options...
RedHawke Posted July 26, 2004 Share Posted July 26, 2004 You know Darth333 thats a bloody brilliant idea, and not too hard to do either. The recruit takes place on Dantooine so it would either be Mission, Zzalbar, Canderous or T3 to choose from and that would give the player the choice, I really like that, and I think other people will too. Then I need to play through From Dantooine to make sure everything works right, and then I need to do a departure script / dialogue / scene for her in the Temple on the Unknown world. Excellent idea Darth333, I'll whip the selection dialogue part up tonight! Link to comment Share on other sites More sharing options...
Darth333 Posted July 26, 2004 Author Share Posted July 26, 2004 Originally posted by RedHawke The recruit takes place on Dantooine so it would either be Mission, Zzalbar, Canderous or T3 to choose from and that would give the player the choice, I really like that, and I think other people will too. Looks cool If your mod can be accessed when the pc returns to Dantoine later in the game, you could also add replies for other npcs, even if it's on Dantoine: just add a conditional script in the active field of the 'RepliesList' in the EntryList that checks if an npc is a party member and, depending on the result, make those replies available or not. Link to comment Share on other sites More sharing options...
RedHawke Posted July 26, 2004 Share Posted July 26, 2004 Originally posted by Darth333 If your mod can be accessed when the pc returns to Dantoine later in the game, you could also add replies for other npcs, even if it's on Dantoine: just add a conditional script in the active field of the 'RepliesList' in the EntryList that checks if an npc is a party member and, depending on the result, make those replies available or not. I could make her avilable later on, I think that would be allright, so the script to check for the party members, that would be something like; int StartingConditional() { IsObjectPartyMember("T3M4")); } Or is it something else? Link to comment Share on other sites More sharing options...
tk102 Posted July 26, 2004 Share Posted July 26, 2004 Close... int StartingConditional() { return IsObjectPartyMember("T3M4")); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.