niBBa 0 Posted August 13, 2018 Hey, been trying to edit the merchant prices with KotOR Tool by changing markup value for the various merchants, but they aren't working. So, I will pay someone via PayPal to make merchants have higher prices for both games. Quote Share this post Link to post Share on other sites
N-DReW25 1,319 Posted August 13, 2018 Deadlystream modders cannot accept donations, modders mod from the kindness of their heart or insanity so close your wallet. Merchants are an easy thing to mod so if you could explain exactly what you want to achieve we can probably teach you to do it yourself. 1 Quote Share this post Link to post Share on other sites
JCarter426 1,213 Posted August 13, 2018 Merchant markup is set by the script that opens the store, not in the store file. This is how, for example, Suvam is able to give you a discount after you beat him at pazaak, but the items in his store remain the same. // 378: Open oStore for oPC. void OpenStore(object oStore, object oPC, int nBonusMarkUp=0, int nBonusMarkDown=0); I believe the last two are percentage increases/decreases, the first for the merchant's inventory and the second for anything they buy from the player. One would have to locate the scripts for each merchant, decompile them, adjust the values, and recompile. It's not difficult - assuming the scripts will decompile properly - but tracking them all down would be a bit of work. Quote Share this post Link to post Share on other sites
niBBa 0 Posted August 13, 2018 N-DreW - I'd like to raise the prices of items that merchants offer. All of the merchants. In K1 and K2. JCarter said I'd have to find the scripts and all that but I don't even know where to begin. I figured it wouldn't be as simple as using KotOR Tool. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted August 13, 2018 28 minutes ago, niBBa said: I figured it wouldn't be as simple as using KotOR Tool Rarely are things as simple as using KTool. In many ways it's just a can opener (or rather a Swiss army knife). It can get you access to the juicy contents, but it can't make you a meal. 1 Quote Share this post Link to post Share on other sites
niBBa 0 Posted August 13, 2018 So what can I do? Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted August 13, 2018 9 minutes ago, niBBa said: So what can I do? Exactly what JCarter said. KTool will let you extract the compiled scripts (NCS) from each module. You'll want DeNCS to decompile them (NSS) which you can then edit in a text editor. You'll then need to recompile the modified scripts, which can be done in KTool, via NWNSSCOMP directly, KOTOR Scripting Tool, etc. Depending on the script names and their uniqueness, you'll probably have to inject them into MODs to avoid clashes, for which you'll want the ERF/RIM Editor. And if you plan on a public release, you'll need TSLPatcher in order to make your mod compatible. Quote Share this post Link to post Share on other sites
niBBa 0 Posted August 13, 2018 Wow. That's way above my pay-grade. 😞 Quote Share this post Link to post Share on other sites
LDR 234 Posted August 13, 2018 It's really not that bad once you get the hang of it. Pretty much all you're doing is decompiling the scripts, modifying the MarkSown/MarkUp values, recompiling, and throwing the scripts into your override folder. Quote Share this post Link to post Share on other sites
niBBa 0 Posted August 13, 2018 I've never touched these tools before and I know DarthParametric laid out the groundwork but I'd be very grateful if someone could maybe do a walkthrough/step-by-step for me. 😎 Quote Share this post Link to post Share on other sites
Guest Qui-Gon Glenn Posted August 13, 2018 In K1, decompiled source scripts can be found in scripts.bif. Your source code for each merchant, is called a script and is saved in a format called .nss You can create a new script in any text editor, I prefer notepad or the KotOR Tool editor. The KotOR Tool editor is helpful as it has a codebase in it to search functions and their proper syntax. That is helpful for deeper mods; what you are doing is very simple value editing, with no actual logic changes or additions. So, if you have found your source script in scripts.bif or using DeNCS, open that file with the KotOR Tool text editor. You will presented with something that looks similar to C/++ code. You need to change numbers as others in the thread have described. Then, use KotOR Tool to save your edited script, save as .nss and replace if asked. Then, compile the script using KT, selecting which game (K1/TSL) your script is being compiled for. This will produce an .ncs file of the same name as your edited .nss So, if your script to edit is merchant01.nss (this is just an example), when you compile you will have merchant01.ncs as output. This file will then need to be inserted into the module where your merchant lives - someone else can pick up the tut from here. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted August 13, 2018 3 minutes ago, Qui-Gon Glenn said: decompiled source scripts can be found in scripts.bif. For some scripts, not all scripts. Most, if not all, of the module-specific scripts have no included source and must be manually decompiled. Quote Share this post Link to post Share on other sites
Guest Qui-Gon Glenn Posted August 13, 2018 25 minutes ago, DarthParametric said: For some scripts, not all scripts. Most, if not all, of the module-specific scripts have no included source and must be manually decompiled. Never said otherwise. Just saying, you don't have to DeNCS everything. When given the opportunity to get the same or better results with less effort, I take it. Quote Share this post Link to post Share on other sites
niBBa 0 Posted August 13, 2018 Ok, I'm in KotOR 1 -> BIFs -> scripts.bif -> Script, Source and... wow. Not sure how anyone could find all the necessary merchant files in here. Unless I'm doing something wrong which is almost certain. Quote Share this post Link to post Share on other sites
Guest Qui-Gon Glenn Posted August 13, 2018 Ok. Each merchant has an in-game location. For K1, you need to enableconsole, so you can use whereami to get the module name you are in. Better, download this mod: https://www.nexusmods.com/kotor/mods/1076 That will give you the tag of your merchant as well, which will be helpful. Find the dialog file for that merchant and you will be able to find the script that fires for opening his store. Make a list of these, so that you can look for them in scripts.bif or use DeNCS to get the source .nss. Look at this mod for ideas: https://www.nexusmods.com/kotor/mods/533/?tab=3&navtag=http%3A%2F%2Fwww.nexusmods.com%2Fkotor%2Fajax%2Fmodimages%2F%3Fuser%3D0%26id%3D533%26gid%3D234 It probably has done most of your work for you Quote Share this post Link to post Share on other sites
niBBa 0 Posted February 5, 2021 Sorry for rezzing this thread, but I would love some assistance. In 2018, I contracted a modder to make merchant changes for me. That worked for a bit, but the changes weren't steep enough for me, and he is busy, so he helped me do it myself. Through DeNCS and the KotOR Script Tool, I was able to change these variables, but they don't seem to change the prices past putting it at 100. Anything below that changes the prices, but after that? Nothing. Is there anything I can do? Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted February 5, 2021 Presumably it's hard capped at 100%. If that's the case you are out of luck as far as scripting goes. You'd need to change all the base item prices in the global UTIs (item templates). That's what Bioware did for the stimpaks, except they created a second set. There are the regular ones you get at the beginning of the game, then if you nuke the giant fish they swap to the other set that cost more. 1 Quote Share this post Link to post Share on other sites
niBBa 0 Posted February 5, 2021 Hey Darth, good to hear from you. I figured that was the case. Really disappointing, but if I can find a way to edit the global UTIs as you say, maybe there's hope. Might you be able to tell me how I can do that? Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted February 5, 2021 Going back to your original post, this is actually something KTool can do. Look for the blueprint, items sub-section of templates.bif. Quote Share this post Link to post Share on other sites
niBBa 0 Posted February 5, 2021 To be clear: I can edit the items from KTool, then save them, and put them in my Override folder? Or am I making assumptions? I'm not sure I believe it is that easy (sounding). EDIT: What is the "Additional Cost" listed under "Cost" in KTool? EDIT2: "Additional Cost" seems to be the only setting that affects the price, so that's good, I guess. Quote Share this post Link to post Share on other sites
JCarter426 1,213 Posted February 5, 2021 Assuming there are no file name conflicts, yes, that should work. It's somewhat better practice for compatibility purposes to use TSLPatcher to patch the merchant file in a .mod file, but this isn't strictly necessary, especially if this is for your own personal use. The only caveat to add is that you have to load a save from before you ever entered the area where the merchant is. Quote Share this post Link to post Share on other sites
niBBa 0 Posted February 5, 2021 Yeah, I managed to tweak them the way that I wanted. Thanks guys. Quote Share this post Link to post Share on other sites