Leaderboard


Popular Content

Showing content with the highest reputation on 04/02/2022 in Posts

  1. 1 point
    Ok. Thanks for the response.
  2. 1 point
    Having lurked around the forums a fair bit as of late following a lengthy absence from the community, I've decided to dip my toe back into the waters of KotOR modding. Seeing all of the innovations and changes over the past few years in terms of what we're able to achieve has really given me the itch again! For my first contribution, i've decided to publish this tutorial which I wrote more years ago than i'd care to admit which focusses on the correct way to recruit a new party member and build your own custom dialog tree and quest line for them. I did publish a tutorial soley on the dialog tree aspect of this on LucasForums many moons ago, but I later wrote this more fully fleshed out tutorial and fell off the map before I got around to publishing it. I've gone back to polish this off and tweaked/refined it a little to make things more readable and easier to follow, so hopefully it should be easily understood. I've tried to keep my naming conventions for things as close to the existing ones in the vanilla game files for consistency and so that game files can be easily examined whilst following along if need be. Admittiedly this will mostly be useful to people who are not so familiar with modding the KotOR games and possibly people who are experienced in other areas of modding but haven't dabbled in scripting or anything yet, so if you're already a reasonably well rounded modder in terms of breadth of experience across different areas, this may not be for you. That's enough waffling anyway. Enjoy! Step 1 - Preparing your NPC template: The most logical place to start in my opinion is by creating the template file which contains all of the vital information which the game needs to know about our new party member. Personally, I would start off with the .UTC file from an existing party member and modify it to suit. I personally like to go old school and use K-GFF to modify template files, so the field names I use here may not match whatever is in KotOR Tool, but they'll be similar enough for you to work out which is which. The vast majority of the fields in KotOR Tool or whichever editor you are using are completely self explanatory, so i'll just go over a few of the ones you may not be too familiar with. Here we go: IMPORTANT: When it comes to editing the new party member's scripts, you will need to ensure that the below fields match the values I have given. When it comes to setting your new party member's tag, you need to remember to use the tag of the vanilla party member you are replacing. DO NOT use a custom tag. The vanilla tags are as follows: The TemplateResRef is the unique identifier we assign to the party member's template so that the game can refer to it. In my case, I set it to "p_yuthura" and named the file "p_yuthura.utc" to match. Step 2 - globalcat.2da entries: For this step, all you'll need to do is add a couple of lines to globalcat.2da so that the game can track your progress through your new dialog tree/quest. For my example, I added two new rows: The K_SWG_YUTHURA global will essentially track which stage of the quest you have reached whilst the K_SWG_YUTHURA_LEVEL one will keep track of your PC's level as you progress through the quest. Their values will both be checked and modified by scripts whenver you reach a new stage in the tree, but more on that in the next step! Step 3 - Recruitment: This stage will cover the process of actually recruiting your new NPC and adding them to your party. This tutorial assumes that you will speak to Yuthura Ban in the Dantooine Courtyard before you recruit her. In order to have the conversation end and have Yuthura immediately available for selection, you would use this script: //recruit.nss void main() { RemoveAvailableNPC(5); AddAvailableNPCByTemplate(5, "p_yuthura"); DelayCommand(1.5, ShowPartySelectionGUI()); } If you follow it line by line, it's very simple to follow. It removes whichever NPC is currently occupying slot 5 in your party selection screen. It then adds a new party member to that slot based on the template you have specified. In this case, we have gone with p_yuthura because that's the template we created in Step 1. There will then be a short delay of 1.5 seconds before the party selection screen appears, just like when you recruit a new party member in the vanilla game. This line can be left out if it doesn't suit what you're trying to do. Obviously the number for the party member slot will change depending on which party member you are replacing, so here the different values for each slot in the game: Simply attach this script to an appropriate conversation node in your dialog file and you're good to go. In this case, since we are recruiting an NPC which we have physically encountered, there will now be a duplicate of your NPC still in the location you met them, even if you have recruited them already. This is very easily solved with another simple script attached to the final node in the recruitment dialog: // destroy.nss void main() { object oYuthura = GetObjectByTag("dan13_yuthura"); SetGlobalFadeOut(1.0, 0.5); DelayCommand(1.0, DestroyObject(oYuthura)); DelayCommand(1.0, SetGlobalFadeIn(0.7, 0.0)); } Again, very easy to understand if you go through it line by line. The SetGlobalFadeIn() and SetGlobalFadeOut() commands are used here to fade the screen to black and back to normal again with the disappearance of the NPC taking place in between the two. This adds a nice polished appearance to the affect. For a barebones recruitment mod, you could just stop there. If you've followed everything so far, you'll have a new party member join you and they'll work exactly as any other party member would, just without any sort of quest to follow. Step 3 - Dialog Tree: This is the step where you really flesh out your mod and give your NPC some life. Adding a new quest line based around your new NPC is a great way to not only add exciting new content to the game, but also to bring your new content more in line with the experiences players have with the vanilla party members. This is nowhere near as difficult as you might think when you start out. I'm certainly no programmer, but with a little common sense and applied logic, this who process becomes very simple. The first script we create here is the one which checks whether or not Yuthura's quest line has started yet: //k_swg_yuthura01.nss #include "k_inc_debug" int StartingConditional() { int nResult = GetGlobalNumber("K_SWG_YUTHURA") == 0; return nResult; } As you can see, this script checks that the currently set value of the K_SWG_YUTHURA global we created earlier is 0. If the current value of K_SWG_YUTHURA is indeed 0, then the value of nResult will be positive and the dialog node which this conditional script is attached to will be available. If the value of K_SWG_YUTHURA is anything other than 0, the node will be ignored and the game will move on to the next note in the tree. Once the initial conversation has been completed, we'll need to increase the value of K_SWG_YUTHURA so that a different conversation option becomes available next time. We achieve this by attaching the following script to the final node in the conversation tree: //k_swg_yuthura20.nss #include "k_inc_debug" void main() { int nPlot = GetGlobalNumber("K_SWG_YUTHURA"); int nLevel = GetHitDice(GetFirstPC()); SetGlobalNumber("K_SWG_YUTHURA", (nPlot + 1)); SetGlobalNumber("K_SWG_YUTHURA_LEVEL", nLevel); } Once again, this is simple to follow. We start by assigning values to nPlot and nLevel so that we can reference them later in the script. nPlot is assigned a value equal to the current value of our K_SWG_YUTHURA global and nLevel is assigned a value equal to the PCs current level. K_SWG_YUTHURA then has its value increased by 1 and K_SWG_YUTHURA_LEVEL has its value set to the PC's current level. Moving on to the second stage in the quest/conversation is really simple. All we do is attach this script to the relevant node in the dialog file: //k_swg_yuthura02.nss #include "k_inc_debug" int StartingConditional() { int nResult = GetGlobalNumber("K_SWG_YUTHURA"); int nLevel = GetHitDice(GetFirstPC()); int nLastLevel = GetGlobalNumber("K_SWG_YUTHURA_LEVEL"); if ((nResult == 1) && (nLevel > nLastLevel)) { return TRUE; } return FALSE; } A little more going on here at first glance, so let's break it down. We start by assigning values to nResult, nLevel and nLastLevel. Here, nResult is the current value of K_SWG_YUTHURA, nLevel is the PC's current level and nLastLevel is the current value of K_SWG_YUTHURA_LEVEL. If the value of K_SWG_YUTHURA is 1 and the players current level is greater than the stored value, then the conversation node will be available. You can basically copy and paste this script to cover the rest of the quest line, just by altering the nResult value which the script checks for. Every time you advance a stage in the quest, you increase it by 1. Summary: All in all, this is a fairly simple process to go through and doesn't take too long at all when you consider that the majority of the conditional scripts for your quest are going to end up being copies of eachother with just that one value changed. I've attached my example scripts to save you needing to copy/paste them if you want to use them as a basis for your own. Of course, there's still so much more you could do with your mod to make the experience even more immersive. In terms of dialog, you can make certain conversation options available only if other conditions are met, like needing to have collected a certain number of Star Maps to have been collected or needing to have reached a certain point in another quest. There are so many possibilities and the vast majority of them can be implemented using the same principles outlined in the tutorial above. Get creative with it! mf_recruitment_scripts.zip
  3. 1 point
    UPDATE - It has been 6 months since this project was first announced and I am pleased to report it is proceeding nicely. This idea originally started as me wondering what the Enclave Sublevel would look like cleaned up from debris in TSL and maybe what an academy run by the Exile would look like there. Over time, and with input and contributions from over a dozen community members, the project has evolved into what will be the realization of a dream so many have had since TSL was released: Seeing the Sublevel in K1. Below are pictures that will give you an idea on where the project is as well as where it still has to go from here. Please provide your opinions, feedback, ideas, and hopes for the Sublevel. As much community input and support this mod has, the more successful and impactful of an experience it will be. The Enclave Sublevel is being designed to serve as a sort of hub world where multiple quests will be given/turned in over the course of the game. Current examples include: Mandalorian Holocron Quest - @EAF97came up with the idea for this quest. The player will retrieve holocrons from the raiding Mandalorians on Dantooine and turn them in to Atris within the Jedi Archives. Here's a shot of the holocrons in the players inventory and a snippet of speaking to Atris: Stealing Kolto from the Sith on Manaan - This quest stemmed from my irritation as a kid that there was a whole store where Kolto was sold and I could not buy any! This quest will be given by the Selkath Jedi Master Qual found within the Medical Bay of the Enclave (pictured below). The player will be sent to use a mimicked Sith Kolto purchasing permit that will lead the player to work with Republic spies within the Sith to not only purchase an extra ton of Kolto on the Sith's dime, but to steal their existing shipment within their hangar as well. The player will be caught in the middle of the thievery and fight the Sith in the dropship loading area seen below. This area is ordinarily not accessible, but there is a walkmesh for it, allowing it to be used. This is another area I spent a lot of time wanting to enter as a kid. You can see on the mini map how its ordinarily out of bounds. Dantooine Murder Quest will be completable from within the Sublevel, and consequently able to be skipped without a negative response from Bolook in the Dantooine plains. The Jedi Shadows from SWTOR will play a role in the Sublevel as they offer rewards for any Jedi or Sith relics the player finds and turns in to them on their journey. The player will also be able to turn in any lightsabers they find on their journey for a bounty, in the same vein as turning in Gaffi sticks to Czerka. The items you turn in will be stored safely away within the storage room. This is the same room whose door malfunctions, trapping Dergar Chester, the Enclave's maintenance Head Technician, inside. Can we break in and get these items back? Sith Holocrons are stored safely inside away from the impressionable minds of the young students of the Academy. The Republic Operations Center has the capacity to play host to side quests centered around directly aiding the Republic itself. Think the side missions in Mass Effect where the Alliance calls asking for Shepards help. There are several STUNT modules of Republic ship bridges that could be used for this purpose. Speaking of the Ops Center. Here it is: Dodonna can be seen within at the moment and is a placeholder until a better female Republic officer can be found/created. If you have any suggestions on who to use here. Feel free to chime in! The player will be able to duel with all named Jedi all the way from Belaya to Master Vandar. I'm still playing with how that will work. But there are two circle rooms that have been slotted for the purpose of dueling. One is occupied and serves to help foster a 'lived in' atmosphere for the sublevel. The other is empty and awaiting the player to choose who they would like to duel. See the droid walking through the door? Select doors are set to auto open when near and auto close when no one is in range. This will help the Sublevel's droids complete their appointed rounds without interruption! These droids are not the Czerka model the Exile finds 5 years later, but the player will have a role in why the Enclave needed to replace all of their droids through a side quest with Dergar Chester's apprentice. Several TSL Masters are present within the Enclave as the war's travels have led them to temporarily stop off on Dantooine. Currently present are Kavar, Vash, and Atris. Thanks to @EAF97for their working porting them over and the initial dialog work for them. What remains to be done? -There remains a good deal of scripting to get done. Quests need back-end work for firing journal entries and to be staffed properly with relevant events like combat, and DLGs need to be fully fleshed out. -The child models currently are in a half baked state as far as the end state that is desired for them. The goal would be they would be able to wear Jedi robes and have full combat animations. All I have confirmed they can do at the moment is unarmed combat as seen below: I have repaired the initial room of the Sublevel by swapping out the room's model for another identical one that is used further in. You can see the difference in the tile and lighting. Speaking of lighting, the entire sublevel is way too dark for my liking. It made sense in TSL since it was abandoned, but I would like it to be much brighter in here than it is now. K1 is even darker than TSL is in the sublevel. See below for comparison. TSL^ K1^ I'm thinking new lightmaps for every room (some?) may be needed, but an expert on modeling and lightmaps would know more about how to best address this issue. The Central Garden area is...well, just look... Thor110 had this same issue when they ported over the module from TSL, and it was mimicked on Dxun, Telos surface, and Dantooine. Indicating it was likely a foliage texture issue. But loading in the module with no textures at all still has the odd black lines. So I'm thinking its a model issue with this area? All that to say! The meat and potatoes of the mod are moving forward. I am compiling a list of everyone who has assisted so far, whether large or small, so as many as possible can be credited for this mod as possible when it releases. @EAF97was the primary motivator for me shifting this project to K1 first instead of TSL. They've been a huge help getting this going. @Sith Holocronhas been instrumental in helping to coordinate the project and serving as a sounding board. The DS Discord has likewise been a big help. I know @lachjameshas looked at some AI work for the TSL Masters' VO, as well as that @Allronixhas put their experience to work ensuring said dialog is lore friendly and accurate. @Hunters Runrestored the Sublevel's walls to their original non-destroyed state. That alone was a huge contribution! There are many more who have helped one way or another that I will detail in full as the mod gets closer to a release. With that in mind, as many seasoned hands on this project, the better! While I will, and am learning how to mess with models and lightmaps to see the Sublevel made into what it can be, if you have experience addressing some of the issue I have noted above and want to play a role in bringing the Sublevel to K1, please PM me! If you have any ideas or thoughts on what you would like to see in the Sublevel, please comment below! I will be updating this post shortly with a new installer that will allow anyone who wants to look inside at this stage to do so. Whether for curiosities sake or for the sake of helping to address a problem.
  4. 1 point
    Its still being worked on. A little slow right now but it should pick up more in the spring. 😃