Leaderboard


Popular Content

Showing content with the highest reputation on 08/07/2020 in Posts

  1. 1 point
    The bug commonly referred to as the "Juhani Quest Glitch" has officially been fixed. With the help of LiliArch, Kexikus, and several other people, I've managed to fix this long-standing bug in the game, and here's the bug, how the bug is caused, how to fix it, and how we found it: The Bug: Whenever you follow Juhani's personal dialog far enough along, you will be approached by a Twilek named Xor. He will take an interest in Juhani, but is forced to leave disappointed and angry. Later, he ambushes you outside your ship if Juhani is present, and will be dead when all is said and done. From that first moment when you get approached by Xor, you will no longer be able to be approached by any more messengers, effectively stopping the advance of others' personal quests and blocking you off from a shop later in the game. Because of the loss of this store, most players have learned to hold of on delving too deep into Juhani's past until later on, after the store is open. The Cause: The bug is caused simply because the game checks that the value of the global number K_XOR_AMBUSH is either 0 or greater than 2 when determining whether to have any messengers approach you. K_XOR_AMBUSH is set to 1 after Xor talks to you and takes an interest in Juhani. It is set to 2 after he attacks you later on. But it is never set to 3 after the attack is done! The Fix: You guessed it: you need to set the global number K_XOR_AMBUSH to 3 after Xor dies. This will allow other messengers to approach you and allow you access to a store later on. The Discovery: While looking into this bug, I went searching through the game's files for how the messengers were spawned and determined. I found out that each planet had one or two scripts for this, but not all could be decompiled. By examining the ones that could be decompiled, I was able to track the code that handles everything to k_inc_utility.nss in KotOR 1's scripts.bif. The relevant code from that file: Of importance is the following sample: int nXor = GetGlobalNumber("K_XOR_AMBUSH"); //Do not fire any messenger plots on Kashyyyk if Chuundar is dead if(GetGlobalNumber("K_CURRENT_PLANET") == 20) { bConditional = GetGlobalBoolean("kas_ChuundarDead"); } if(bConditional == FALSE) { if(nXor == 0 || nXor > 2) { This led me to investigate the K_XOR_AMBUSH global number and how and where it was changed. I discovered that it was set to 2 just before he attacked you, but that it was never set to 3 when he is dying. From there, I gathered saves from Kexikus and others and tested setting the K_XOR_AMBUSH to 3 after Xor dies. And everything works! This script is used by the game to launch Xor's death scene, but I've edited it to set the K_XOR_AMBUSH to 3 at that time as well. Simply drop it into your override folder and you're good to go! k_hxor_state03.7z
  2. 1 point
    I'll try a little tutorial: Conversion: With KotOR Tool you extract pmhc07.mdl (from Kotor II -> BIFs -> models.bif -> Aurora Model) and pmhc07.mdx (from Kotor II -> BIFs -> models.bif -> Aurora Model Extension). Now with MDLEdit you load the mdl file, just to see which supermodel you need (it's almost always S_Female02, but still good to check). After loading the file, on the bottom half of the window you see "Header", click that and on the top half of the window you see "Supermodel: S_Female02". This is the supermodel from K1 that you need (the supermodel from the game you are porting to is needed). The mdl and mdx of the supermodel need to be in the same location as the model you're trying to convert. So, in KotOR Tool you need to export those files, Kotor I -> BIFs -> Aurora Model / Aurora Model Extension -> s_female02.mdl/mdx. Preperation for conversion done. Now you open MDLEdit, make sure the KOTOR1/KOTOR2 button below the menu is on KOTOR2, because you're loading a K2 model. Load the mdl file, you might think you can now just switch to K1 and save a binary file, but no. You can now switch the button to KOTOR1, you Save -> ASCII, then you load that ascii file, now you can save as binary (which the game can use). Put the mdl and mdx in K1's override folder. Textures/portraits: K1 has 2 more darkside transition phases and the filenames work slightly different. K2: neutral/light, halfway dark (...d1), full dark (...d2) K1: neutral/light, 1/4 dark (...d1), halfway dark (...d2), 3/4 dark (...d3), full dark (...d) With PMHC07 you're in luck, the portraits all have the same pose, so in an image editor you can combine different images to get the intermediate phases. For example, load the neutral portrait, add the halfway dark portrait in a layer on top, set the opacity of that layer to 50% and you get K1's d1 phase portrait. You do pretty much the same with the head textures. Portraits: Kotor II -> ERFs -> TexturePacks -> swpc_tex_gui.erf -> P -> po_PMHC07/po_PMHC07d1/po_PMHC07d2 Head textures: Kotor II -> ERFs -> TexturePacks -> swpc_tex_tpa.erf -> P -> PMHC07/PMHC07d1/PMHC07d2 2da files: To turn this into a mod you would need to use the TSLPatcher, but that's a bit beyond the scope of this tutorial. You can however study the changes.ini file that come with one of my mods that do something similar, it's mostly just changing P[M/F]H[A/B/C/H] values to PMHC07. There's no PMHC07 in K1 so you can stick to that name. To test things for yourself you need to add lines to portraits.2da, appearance.2da and heads.2da (You can extract those with KotOR Tool to your override if you don't already have these in there. Kotor I -> BIFs -> 2da.bif -> 2D Array). You can add a new line with the * at the bottom of the list and you can copy lines to that new line, so copy another row (for example an existing PMHC one, right click the "button" of an existing line, left from the first column -> Copy Row, similarly you can paste that on the new row). Make sure you change things accordingly. Portraits.2da lists the playable characters and points to lines in appearance.2da, appearance.2da points to a head in heads.2da. In this case I would repeat how things are done for an existing pmhc, for example pmhc05. Good luck and happy experimenting