N-DReW25

No Random Merchant Loot [TSL]

Recommended Posts

In this mod, I'm trying to remove the annoying and easily exploitable random merchant loot generator. Basically I want the merchant loot to be the same EVERY single time you play the game like in K1. For my first test I have decompiled the a_stockstore_01.ncs script (Which I think is Dendis Dobo's) using DeNCS now one of the first problem I encountered is when I decompiled the script I got a_stockstore_01_compile_fails which doesn't look good but when I opened it in Kotor Tool it looked like a script so that might just be me panicking already.

 

So i'm asking how do you turn the random loot thing off in the script.

a_stockstore_01_compile_fails.zip

Share this post


Link to post
Share on other sites

The reason a "_compile_fails" file was produced was because DeNCS does a "sanity" check after it decompiles a file by attempting to re-compile it. So your script did decompile (and you can right-click on the gibberish and click "View decompiled code" or something like that) and still work with it; 95% of the time this is true.

Share this post


Link to post
Share on other sites

You'd not only need to turn off the random loot, but create a full list of items for each merchant to carry.

You mean create a new utm file with more items for sale than yes i'm up for that but i'm asking how you turn off the random loot script so it doesn't spawn anything or doesn't work at all.

Share this post


Link to post
Share on other sites

As far as the random loot script stuff, it seems that for the three stores in 201TEL at least, they each have scripts that stock the store (like a_stockstore_01.ncs). These are what generate the random items in the store, so you'd essentially need to make empty versions of the scripts:

 

void main()

{

 

}

 

Done.

Share this post


Link to post
Share on other sites

As far as the random loot script stuff, it seems that for the three stores in 201TEL at least, they each have scripts that stock the store (like a_stockstore_01.ncs). These are what generate the random items in the store, so you'd essentially need to make empty versions of the scripts:

 

void main()

{

 

}

 

Done.

Well that worked, now all I need to do is figure out what I want each merchant to carry.

 

Also could that script work with the random loot system as a whole (And also can things like credits, stims and random medpacs still be random)

Share this post


Link to post
Share on other sites

Well that worked, now all I need to do is figure out what I want each merchant to carry.

 

Also could that script work with the random loot system as a whole (And also can things like credits, stims and random medpacs still be random)

It's very different for the rest of the random loot system, since the rest of it is an entirely different system.

 

You'd need to do the following:

 

0. I recommend making a new blank Override folder to keep this organized for now.

1. Extract the following files from KotOR 2's scripts.bif:

 

k_def_ambmobtrea.nss

k_def_spawn01.nss

k_def_spn_t_jedi.nss

k_def_spn_t_less.nss

k_def_spn_t_more.nss

k_inc_cheat.nss

k_inc_debug.nss

k_inc_disguise.nss

k_inc_drop.nss

k_inc_fab.nss

k_inc_fakecombat.nss

k_inc_force.nss

k_inc_generic.nss

k_inc_gensupport.nss

k_inc_glob_party.nss

k_inc_hawk.nss

k_inc_item_gen.nss

k_inc_npckill.nss

k_inc_quest_hk.nss

k_inc_q_crystal.nss

k_inc_switch.nss

k_inc_treasure.nss

k_inc_treas_k2.nss

k_inc_utility.nss

k_inc_walkways.nss

k_inc_zone.nss

k_kin_endconv.nss

k_kin_percept.nss

k_level_dlg.nss

k_medstation.nss

k_oei_endconv.nss

k_oei_hench_inc.nss

k_oei_spawn.nss

k_oei_userdef.nss

k_plc_it_arm.nss

k_plc_it_arm_h.nss

k_plc_it_arm_l.nss

k_plc_it_arm_m.nss

k_plc_it_arm_r.nss

k_plc_it_d_shld.nss

k_plc_it_d_stim.nss

k_plc_it_eq.nss

k_plc_it_eq_belt.nss

k_plc_it_eq_glov.nss

k_plc_it_eq_helm.nss

k_plc_it_eq_imp.nss

k_plc_it_up.nss

k_plc_it_up_a.nss

k_plc_it_up_l.nss

k_plc_it_up_l_cr.nss

k_plc_it_up_m.nss

k_plc_it_up_r.nss

k_plc_it_weap.nss

k_plc_it_weap_bp.nss

k_plc_it_weap_br.nss

k_plc_it_weap_l.nss

k_plc_it_weap_m.nss

k_plc_treas_disp.nss

k_plc_treas_empt.nss

k_plc_treas_less.nss

k_plc_treas_more.nss

k_plc_treas_norm.nss

k_plc_tresciv.nss

k_plc_trescorhig.nss

k_plc_trescorlow.nss

k_plc_trescormid.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

nwscript.nss

 

 

2. Open k_inc_treas_k2.nss and go to town deleting most of the items. Pretty much leave only what you want to be random, though I'm really leaving out the gory details.

 

3. Save k_inc_treas_k2.nss in the Override folder and try to compile it. You will never get a .nss out of this, but this can help weed out errors in the script.

 

4. Once you get no errors in the script, download this.

 

nwnnsscomp_batch.7z

 

5. Extract the nwnnsscomp.exe and the compile.bat file to the Override folder.

 

6. Run the compile.bat file and it will automatically compile all the files, or attempt to.

 

In the end, you should have a lot of .ncs files. The .nss can go in a folder, and then you can use the .ncs files to go through and test the game.

Share this post


Link to post
Share on other sites

I'm curious about the reasoning behind doing away with random loot. What's the reasoning it's so bad?

Because the random loot makes the game feel bad in general. Do you think it's Logical to get an Ion Carbine as T3-M4 that gets transferred back to the Exile even though blasters weren't allowed on Peragus, Is it logical when you kill the Rodian guard at the exchange base on Citadel he drops Mandalorian Battle Armor, is it logical to get Exar Kuns Battle Suit on a Mandalorian corspe on Dxun then to get the exact same set again off a Vaklu Soldier. And then the Merchants are just exploitable so if you really want good gear just save the game before entering the module the merchant is in then when you check his loot and if its bad reload the save and repeat until your satisfied.

Share this post


Link to post
Share on other sites

Because the random loot makes the game feel bad in general. Do you think it's Logical to get an Ion Carbine as T3-M4 that gets transferred back to the Exile even though blasters weren't allowed on Peragus, Is it logical when you kill the Rodian guard at the exchange base on Citadel he drops Mandalorian Battle Armor, is it logical to get Exar Kuns Battle Suit on a Mandalorian corspe on Dxun then to get the exact same set again off a Vaklu Soldier. And then the Merchants are just exploitable so if you really want good gear just save the game before entering the module the merchant is in then when you check his loot and if its bad reload the save and repeat until your satisfied.

That is a very good point, and something that's bothered me as well. As a programmer, maybe I am too in love with the beauty of the random loot system, but I think it could be made better to have the best of both worlds: randomness within reason and sensible drops.

Share this post


Link to post
Share on other sites

That is a very good point, and something that's bothered me as well. As a programmer, maybe I am too in love with the beauty of the random loot system, but I think it could be made better to have the best of both worlds: randomness within reason and sensible drops.

Well wouldn't that reduce random loot as a whole. Now things like named items should not be random and should be sold by merchants and NPC's shouldn't have random loot or at least random weapons and armor. Though for the placeables those can still keep the random loot system except on Peragus as I hate it when you get an Ion Rifle as T3 or another blaster or get some stupid item like an implant or an energy shield from a mining droid.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.