lfnetwork.com mark read register faq members calendar

Thread: Changing Treasure Drops Off Corpses
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-23-2009, 11:58 AM   #1
yihsiao
Lurker
 
Join Date: Jun 2009
Posts: 2
Changing Treasure Drops Off Corpses

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!
yihsiao is offline   you may: quote & reply,
Old 06-23-2009, 12:16 PM   #2
Demongo
Afro Skeleton
 
Demongo's Avatar
 
Join Date: Apr 2009
Posts: 963
Current Game: Street Fighter IV
If you want to modify the item what an NPC(later corpse) 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



Bink's Sake

"I've barely eaten anything for many decades now. It feels like my stomach shriveled into my back........though i don't have a stomach or back because i'm a skeleton! Yohohohoho! SKULL JOKE!"

"My eyes have never seen such a pretty woman! But i'm a skeleton so my eyes don't see much."
Demongo is offline   you may: quote & reply,
Old 06-23-2009, 05:05 PM   #3
DarthCyclopsRLZ
Rookie
 
DarthCyclopsRLZ's Avatar
 
Join Date: Nov 2006
Posts: 35
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.
DarthCyclopsRLZ is offline   you may: quote & reply,
Old 06-24-2009, 10:19 AM   #4
yihsiao
Lurker
 
Join Date: Jun 2009
Posts: 2
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.
yihsiao is offline   you may: quote & reply,
Old 06-24-2009, 10:27 AM   #5
Demongo
Afro Skeleton
 
Demongo's Avatar
 
Join Date: Apr 2009
Posts: 963
Current Game: Street Fighter IV
I'm not sure of it, but I think that the "random item generator" is some kind of built-in feature. It usually generates some credits,grenades or some simple stuff.



Bink's Sake

"I've barely eaten anything for many decades now. It feels like my stomach shriveled into my back........though i don't have a stomach or back because i'm a skeleton! Yohohohoho! SKULL JOKE!"

"My eyes have never seen such a pretty woman! But i'm a skeleton so my eyes don't see much."
Demongo is offline   you may: quote & reply,
Old 06-24-2009, 10:50 AM   #6
TheSpartanJedi
Lurker
 
Join Date: Mar 2008
Posts: 9
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?
TheSpartanJedi is offline   you may: quote & reply,
Old 06-24-2009, 10:54 AM   #7
R2-X2
Junior Member
 
R2-X2's Avatar
 
Join Date: Dec 2008
Location: Above Lehon
Posts: 352
Current Game: KotOR again. F*** yeah.
220TEL_s.rim. The _s.rim file has all the GFF files (utc/uti/utp...)in it.



Beep.
R2-X2 is offline   you may: quote & reply,
Old 06-24-2009, 10:56 AM   #8
TheSpartanJedi
Lurker
 
Join Date: Mar 2008
Posts: 9
Quote:
Originally Posted by R2-X2 View Post
220TEL_s.rim. The _s.rim file has all the GFF files (utc/uti/utp...)in it.
That's what I thought, thanks. I also found out how to open the files with KOTOR Tool (File>Open GFF Files...)
TheSpartanJedi is offline   you may: quote & reply,
Old 06-24-2009, 12:01 PM   #9
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by yihsiao View Post
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

stoffe is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Changing Treasure Drops Off Corpses

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:07 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.