Jump to content


Kexikus

Member Since 14 Oct 2014
Offline Last Active Yesterday, 08:33 PM
*****

Topics I've Started

Block "Item Lost/Received" message

12 May 2017 - 08:40 PM

I'm working on a script that swaps a hidden item on a partymember. So what I'm doing is basically this (sItem is a string with the item's tag):

object oOldItem = GetItemInSlot(INVENTORY_SLOT_CARMOUR, OBJECT_SELF);  
object oNewItem = CreateItemOnObject(sItem, OBJECT_SELF);

if (GetIsObjectValid(oOldItem)) {
  DestroyObject(oOldItem);
}
DelayCommand(0.2, ActionEquipItem(oNewItem, INVENTORY_SLOT_CARMOUR, TRUE));

And that's working perfectly fine. However, when I run this script in a dialog, I always get the pop-up message that I lost and gained an item. I'd very much prefer it this message did not appear as these Creature Hide items are a hidden game mechanic that the player shouldn't be informed about. Is there any way to do that?

 

Edit: Oh, and a second question: Are there switch-cases possible in KotOR / TSL or do I have to use if-else statements all the time?


Sorting droid armor into tiers

29 April 2017 - 02:29 PM

I'm working on a small mod that requires me to sort TSL's droid armor into three tiers. For most armor items that's easy as they exist in Mark I, II and III. But there are some exceptions, so I was wondering where you'd sort those in. I'm just really bad when it comes to rating items, skills, etc. so that's why I'm asking for help :)

 

The armors in question are:

Droid Desh Plating

Droid Agrinium Armor

Droid Quadranium Armor

Droid Diatum Plating

Droid Capacitor Armor (HK's special armor. Where do you get that one by the way?)

 

Any help would be very appreciated. Thank you :)


Fog and Speed Blur Fix for the 2016 TSL patch

29 April 2017 - 09:46 AM

As you might know, fog is not working or at least not working properly in Aspyr's 2016 Steam patch for KotOR 2: TSL. An official fix for this issue doesn't seem to be in sight but luckily HappyFunTimes101 wrote a fix himself.

 

To show the issue with the 2016 patch, here's a comparison between the Steam and the GOG version:

 

Attached File  20170429110154_1.jpg   190.56KB   1 downloads   Attached File  Star Wars Knights of the Old Republic 2 04.29.2017 - 11.12.24.01.png   3.05MB   2 downloads

 

As you can see, the fog is really screwed up in the latest Steam version while all other versions (4CD, DVD, gog, Steam legacy) look the same as the "gog picture". In other areas, the issue is not as visible when the fog is completely missing in the Steam version, but if you compare the two versions it's easy to see.

 

And finally, here's what it looks like with HappyFunTImes101's fix applied:

 

Attached File  20170429110919_1.jpg   180.49KB   1 downloads

 

One more comparison, taken from the Ravager where the fog is not present at all in the Steam version:

 

Attached File  20170429111104_1.jpg   206KB   1 downloads   Attached File  20170429111034_1.jpg   193.06KB   1 downloads

 

Additionally HappyFunTimes101 provides a completely new speed blur effect to get rid of that headache causing blur in the vanilla game while keeping some visual effect:

 

Attached File  20170429111309_1.jpg   86.21KB   1 downloads   Attached File  20170429112034_1.jpg   141.58KB   2 downloads   Attached File  20170429112037_1.jpg   147.58KB   2 downloads

 

It's a little hard to see on a still frame but if you compare the last two pictures, you can see that the edges of the screen are warped while running with Force Speed active. I really like that new effect, but it's optional when installing the fog fix, so it's up to you to decide whether you want it or not.

 

Which brings me to the important part: How to install the fix

First of all, here's the Read-Me. But I'll provide easier to follow instructions, originally taken from a reddit post by TonyKaku but slightly edited:

 

  1. Go here and download the contents of the Release folder. Copy them in your main KotOR 2 directory. If you don't want the changed speed effect, go to KotOR 2 directory \ shaders_override and delete fp_speedblur.txt.
  2. Start the game
  3. You should now have two folders called shaders_original and shadow_override in your KOTOR folder.
  4. Go into the shaders_original folder and open the first file with a program like Notepad++
  5. locate the line that says "MOV result.color, r0" (second to last line usually)
  6. right above that line paste the content of the quote under "Fog Issue" that starts with PARAM p =.... Your file should look like this.
  7. Repeat this step for every text file in the folder that has the MOV result.color, r0 line (these are all files starting with fp). That can take some time and there might be ways to automate the process but explaining it might take so long that you're probably just better off doing the whole thing manually.
  8. After you pasted this into every file that has the MOV result.color, r0 line near the end, copy all text files into the shader_override folder.
  9. Launch the game, the fog should now be fixed

This fix is definitely a big step forward for the usability of the Steam patch, which I always avoided due to issues like these. It's up to you to decide if it's easier to fix the fog in the Steam version or to get widescreen support in a different version but it's definitely a good thing to have this patch available. Maybe this fix can even be expanded to include the missing saber hilt textures (if that's even a shader issue).

A big thanks to TonyKaku for posting this on the kotor reddit or I wouldn't have found it. :D

 

To the moderators: I wasn't sure if that qualifies as a tutorial, so I posted it in the general section. If it is, please just move it or maybe just pin it so that the information doesn't get lost. Thank you :D

 

Edit: I tried to apply the speed effect change to the older TSL version and to K1, but it's not as easy as I hoped it would be. The shader identified as the speed shader in shader_ident.txt just doesn't exist in these versions of K1/TSL so it can't be overwritten that way either. I assume it would be possible by editing the OpenGL32.dll file but I just don't know how to do that.


TSLPatcher: Only modify file if it's present

28 April 2017 - 02:21 PM

I'm currently setting up the installer for my Full Jedi Council mod v2.0 and I've run into a problem.

 

My mod edits holorec.dlg and since this file is also modified by several other mods (TSLRCM, TSLRCM No Overlay, PartySwap to name a few) I use TSLPatcher to apply my changes to a file already present in the Override. The problem is that TSLRCM places its edited holorec.dlg in 950COR.mod and not in the Override. So there are two options:

Apply my changes to the holorec.dlg in 950COR.mod which could be either from TSLRCM or from the 950COR.mod that I install if it's not present. But then any of the other mods that places holorec.dlg in the Override would override my changes.

The other option would be to make my changes to holorec.dlg in the Override. That way I could apply them to a holorec.dlg already installed there by other mods but that results in an issue when installing on a vanilla installation or with only TSLRCM. Then I'd have to provide a holorec.dlg that these changes could be applied to. So either I'd use the vanilla holorec.dlg for that, overriding TSLRCM's changes or the TSLRCM file, installing TSLRCM changes for a user who probably doesn't want them or he'd have installed TSLRCM before doing so.

 

I could of course just put TSLRCM as a requirement in my read-me but I'd rather avoid that. Ideally I'd just tell TSLPatcher to modify the holorec.dlg in 950COR.mod and if holorec.dlg is present in the Override folder modify that as well. The first part is no problem but so far I've not been able to tell TSLPatcher to do the latter. Is this even possible? And if it is, how?


Folder priorities: Where to put your mod's files

25 April 2017 - 01:12 PM

Luckily we rarely have to overwrite files when modding the Knights of the Old Republic games. Instead we can used edited copies of the original, vanilla files that will then be prioritized over the original game assets. However that also means that one file can be present in multiple locations at once, making is necessary to know which file takes precedence. That's where this tutorial comes in. I'll try to give an overview of the different ways different file types are prioritized. Let's start with an overview of the places a file could be in:

 

Overview of file locations

 

  • The original game assets: These are stored in multiple packages across the entire game installation, ususally coming packed in .rim, .bif or .erf files. I don't know the priorities between those but since you shouldn't edit them anyway, it doesn't really matter anyway.
  • The Override folder: This folder located in the main installation directory is where most of your modded files will go.
  • The Modules folder: This folder has all the module files (.rim) by default. There are two .rim files per module, named the same except for the ending "_s" on one of them. These are where the game stores assets for that specific module. Again, you won't edit these, but this folder is also where .mod files go. These are basically copies of the .rim files, packing the contents of both .rim files of one module into one file. Sometimes it is necessary to put files here due to the way the game prioritizes files. But they are also important when two files of the same name are used in different modules and you only want to edit one of them. Instead of putting your edited file in the Override where it would override both occurences, you'd put it into the .mod for the module you want the edit to be used in.
  • Savegames: Some information is also stored directly in the savegame. You'll usually not edit this information, but knowing that it's there can be important. You'll see why in a bit.

Those are the main locations for files, with the second and third being where you'll ususally put your files. So now let's get to the priorities. The game will always start at the highest priority and if it can't find the file it'll continue with the next step until it finds the file.

 

The usual case

 

This usual case holds for most of the game assets, including textures (.tga), texture information (.txi), models (.mdl and .mdx), scripts (.ncs), dialog (.dlg), GUI files (.gui), 2da files (.2da) and many many more. Those are prioritized in the following way:

  1. Override folder
  2. .mod files in the Modules folder
  3. vanilla assets

Unless you have a file that's different accros two or more modules, you can safely put these files into the Override folder.

 

.ut* files

 

.ut* files (i.e. characters (.utc), items (.uti), triggers (.utt) etc.) are different due to the fact that their information is also stored in the savegame the first time they're accessed in a playthrough. The priority goes as follows:

  1. Savegame
  2. Override folder
  3. .mod files in the Modules folder
  4. vanilla assets

The important difference here is that the information in a savegame takes precedence over every other option. This is why you always have to load a savegame where the module you're working in hasn't been visited yet to see your changes. For your final mod you'll still place the files in the Override with the same exceptions as described above and you should note that a fresh playthrough or a savegame from before visiting a certain area is necessary for the mod to work in the description.

 

Static Area Info .are

 

Static Area Info files (.are) behave the same as .ut* files:

  1. Savegame
  2. Override folder
  3. .mod files in the Modules folder
  4. vanilla assets

Dynamic Area Info .git

 

Dynamic Area Info files (.git) behave slightly different when compared to the prievous file types. This difference is quite important though, and you'll see why:

  1. Override folder
  2. Savegame
  3. .mod files in the Modules folder
  4. vanilla assets

As you can see the Override folder takes precedence over the information stored in savegames. This will result in an area being reset everytime the player loads a savegame or re-enters that area while the corresponding .git is in the Override. Thus you should NEVER have a .git in the Override for a final mod. This behaviour can be quite useful for testing though. Just make sure to put the .git in the .mod for the final release.

 

Module Info .ifo

 

To be honest, I don't know what module info files (.ifo) do and I don't think I've ever seen a mod that edited those, but I want to mention them anyway. Since this file is named the same for every module (module.ifo), you really don't want to place it in the Override but keep it in the .mod should you ever need to edit it.

Edit: According to DarthTyren, all the module.ifo file does is to tell them game which .are and .git file to use for a module. So you probably won't edit it anyway, but should you require to do so at some point, follow the recommendation above.

 

dialog.tlk

 

This very important file, cannot be overriden by a different version in the Override folder or somewhere else. Instead the file has to stay where it is (main installation directory) and must be modified directly.

 

Override subfolders

 

In K1 all files have to be placed directly into the Override folder and files in subfolders won't be recognized by the game. In TSL this has changed and you can put your files in subfolders. The priorities then goes as follows:

  1. Main Override folder
  2. Subfolders in alphabetic order with numbers preceding letters

Sub-subfolders won't work in TSL either and you should always keep in mind that putting a file in a subfolder will make it harder to detect incompabilites as no files will be overwritten when installing a second mod using the same file in a different or no subfolder at all.

 

 

Most of you probably knew all of this already but I've been looking into it recently and figured I'd share it for those that are new to KotOR modding. May it help you in your career :D