Jump to content

Home

Changing Treasure Drops Off Corpses


yihsiao

Recommended Posts

Is there a way to change how treasure drops work in KOTOR1?

 

I know many of the rewards like credits and other mundane items are randomly generated off kills and I wanted to see if there was a way I could modify them with other items or remove them entirely with the KOTOR Tool or another modding utility.

 

Thanks!

Link to comment
Share on other sites

If you want to modify the item what an NPC(later corpse:xp:) has, you should edit the NPCs .utc file. There is a bitton called "Inventory" in the .utc file(you should edit it with KotorTool. Double click to bring up the editor). Click on it. You can see the list of items on the left side. Drag one item, and drop it into the Inventory. Make sure you check it is Droppable;)

Link to comment
Share on other sites

Merely messing with the .utc file nly works for placeables with unique names. If you wanna change the items in specific lockers/boxes with generic names, edit the module files.

 

1. Make copies of all module .rim files. Anything from the Modules folder if you wanna play it really safe.

2. Get an ERF/RIM editor. ERFEdit will get the job done.

3. Extract all files from the module's .rim file. with the ERF/RIM editor.

4. Mod the inventory of any placeable to your heart's content with Kotor Tool or whatever utility.

5. Go back to the ERF/RIM editor. Make a new .rim file with all the module files from your modding directory.

6. Replace the files in the Modules folder of your KOTOR game. Voila.

 

Rinse and repeat for all modules you want to mod. Not as elegant as scripting, but at least it allows you to do something about the useless gear/rewards/whatever you'll find.

 

On a final note, I'd advise to mod .dlg files otherwise.

Link to comment
Share on other sites

Thanks for your input guys. That does help with the non-random treasure drops.

 

There's also a random treasure generator that drops random treasure like grenades, credits, etc. Do you know where I can edit this to generate a more appropriate reward for my mod?

 

Seeing how this is very similar to modding Baldur's Gate 2 (another Bioware game) and BG2 .2DAs allowed you to edit random treasure drops, I have a gut feeling there is a data file/script I'm overlooking.

Link to comment
Share on other sites

I'm following DarthCyclops's instructions, but I can't find where to open the UTC files I extraced with KOTOR. Also, I'm not sure on which RIM to extract. For example, if I'm trying to edit drops from the Sith Commandos on Telos during the attack, do I extract 220TEL.rim or 220TEL_s.rim?

Link to comment
Share on other sites

Is there a way to change how treasure drops work in KOTOR1?

 

I know many of the rewards like credits and other mundane items are randomly generated off kills and I wanted to see if there was a way I could modify them with other items or remove them entirely with the KOTOR Tool or another modding utility.

 

Thanks!

 

Random loot is handled via scripts. For loot dropped from containers the main logic is in the k_inc_treasure.nss include file. For changes to that file to take effect however you need to recompile the scripts that use it. The standard ones are:

 

k_plc_tresciv.nss

k_plc_trescorhig.nss

k_plc_trescorlow.nss

k_plc_trescormid.nss

k_plc_tresdrdhig.nss

k_plc_tresdrdlow.nss

k_plc_tresdrdmid.nss

k_plc_tresmilhig.nss

k_plc_tresmillow.nss

k_plc_tresmilmid.nss

k_plc_tresrakat.nss

k_plc_tresshahig.nss

k_plc_tresshalow.nss

k_plc_tresshamid.nss

k_plc_tressndppl.nss

 

Random loot dropped by creatures has the main logic in the k_inc_drop.nss include file. This file contains the function DR_SpawnCreatureTreasure(), which is called inside the standard AI function GN_SetListeningPatterns() (found in the k_inc_generic include file). This function in turn is called by the OnSpawn event script for creatures, and as such is run when they're loaded into the game world.

 

Thus, to make changes to the creature loot you'd need to recompile any OnSpawn event scripts that call this function. If you want the change to take effect globally you'd need to recompile them all. If you only want to affect a certain creature it's enough to check what OnSpawn script it uses and recompile that one. If it's a creature in a mod you're making you could give it a custom OnSpawn script for it.

 

k_amb_prey_spawn.nss

k_def_ambient.nss

k_def_ambmob.nss

k_def_bandspn.nss

k_def_calospn.nss

k_def_grenspn.nss

k_def_repairsp.nss

k_def_spawn01.nss

k_hen_candspwn.nss

k_hen_spawn01.nss

k_hjol_spawn01.nss

k_pdan_iriaz_sp.nss

k_pdan_kath03.nss

k_pdan_mand52.nss

k_pdan_stand02.nss

k_pkas_freyyspwn.nss

k_pkas_heart_on.nss

k_pman_amb_9.nss

k_pman_beast_9.nss

k_pman_shield_9.nss

k_ptat_amb1.nss

k_ptat_gizkaspwn.nss

k_swg_xor_def.nss

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...