It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
The good news is that it really seems to be 2 lines of code, like he says. gplotAppraiseOpenStore is a command for opening stores introduced in the first expansion and retroactively implemented in the OC and X2. It uses the nw_i0_plot library.

The bad news is that changing the nw_i0_plot script, one of the scripts shipped with the game, may be a little weird. I have no idea if, after following the procedure below, you need to recompile ("build") modules by-hand to see effects. Which is totally not worth it.

Anyway, a properly modified copy of this file can be put in the \override\ directory. Unless for god-knows-what you're already using a modified version of this script, there shouldn't be any compatibility issues. I went ahead and made the merchant and PC both "take 5," as opposed to the d10's that were there. And in a "favorable" store (I don't know where these are) the PC takes 10.

https://pastebin.com/raw/iiALxJwz

copy that text and save it as

nw_i0_plot.nss

... in the nwn \override\ directory.
Post edited April 09, 2018 by tristanlist
avatar
tristanlist: Anyway, a properly modified copy of this file can be put in the \override\ directory. Unless for god-knows-what you're already using a modified version of this script, there shouldn't be any compatibility issues. I went ahead and made the merchant and PC both "take 5," as opposed to the d10's that were there. And in a "favorable" store (I don't know where these are) the PC takes 10.

https://pastebin.com/raw/iiALxJwz
avatar
palswim: Inversely, you can set the Appraise value of some or all merchants to -99 using the NW Toolset. You can also adjust the base prices to something you think is fair. (Like if you want to ensure the merchant gives you the neutral price of 35, you can set the base sell price from 35 to 5, and then the merchant's Appraise skill to -99.)
Thanks for the source code digging/modification. After looking at the code, my initial suggestion of setting the merchants' Appraise skill to -99 will not work, since the code treats any value lower than 1 as having an Appraise skill of 1. So, a slight modification: set the merchant's Appraise skill to 99, and then set the base sell price to 30 more than the target sell price. (E.g. If you want a 35 sell price, change the base sell price from 35 to 65.)
avatar
tristanlist: The bad news is that changing the nw_i0_plot script, one of the scripts shipped with the game, may be a little weird. I have no idea if, after following the procedure below, you need to recompile ("build") modules by-hand to see effects. Which is totally not worth it.
You do, since it's a library file. Why is it totally not worth it, though? Shouldn't take more than 5-10 minutes, even with a bad computer.

avatar
tristanlist: Anyway, a properly modified copy of this file can be put in the \override\ directory. Unless for god-knows-what you're already using a modified version of this script, there shouldn't be any compatibility issues. I went ahead and made the merchant and PC both "take 5," as opposed to the d10's that were there. And in a "favorable" store (I don't know where these are) the PC takes 10.
Did you actually test this? I didn't think you could use a library file as an override like that but hey, if it works then great (and technically better than editing the module in many cases since this way patches won't overwrite it...and it'll technically apply to any custom modules that don't alter the script).

Personally I just removed the d10 roll completely -- it's an opposed check so removing from each is fine.

And then on the favorable store I manually added 10 (like you did).
avatar
MagicalMaster: Did you actually test this? I didn't think you could use a library file as an override like that but hey, if it works then great (and technically better than editing the module in many cases since this way patches won't overwrite it...and it'll technically apply to any custom modules that don't alter the script).
The fix works as posted.

Except you are right. The campaign modules all need to be recompiled in order for the change to take effect. Bleh. This strikes me as weird since this fix is sitting there in the override directory, not in the modules themselves. I had wanted to devise a fix for people that was totally non-reliant on opening the toolset and didn't involve cheating-up your characters... Too bad :(

To me personally, it would not be worth the price of butter to have to recompile the campaign modules. But here is the full procedure again to make this "Take 10" change to all appraise rolls, just for clarity:

https://pastebin.com/raw/iiALxJwz

Copy that to a text file and put it in the nwn \override\ directory.

Name the file
nw_i0_plot.nss

Now, to implement this change in modules you have to open them up in the toolset and tell it to recompile all the scripts. This has to be done to every module in the campaign:

From the \nwm\ directory, drag a campaign module onto nwtoolset.exe, which is located in the root nwn directory.

When the module is loaded, go Build > Build Module

Have it so that ONLY
(x) Compile
(x) Scripts
are ticked before doing the build command. Otherwise you are in for a long wait.

Save and close the module after building.

Repeat for all the campaign modules.
avatar
tristanlist: Except you are right. The campaign modules all need to be recompiled in order for the change to take effect. Bleh. This strikes me as weird since this fix is sitting there in the override directory, not in the modules themselves. I had wanted to devise a fix for people that was totally non-reliant on opening the toolset and didn't involve cheating-up your characters... Too bad :(
It was a noble idea. The problem is that we are dealing with a library script. Say you have 50 lines of code in script A (the main script) and 50 lines of code in script B (the library script).

When you compile A, it checks its 50 lines and then grabs the 50 lines from B to use as well. So any changes made to A or B will apply.

But if you try to compile B, you'll note it doesn't even give a compilation message. And A has already "taken" the code it wants, so until you recompile A it won't check and notice the updates to B.

Rebuilding the module's scripts applies this automatically for all scripts.

Technically speaking, you could achieve your goal by literally making a batch of override scripts -- more precisely, one for every merchant in every module of every campaign. Compile those with your fixed version of nw_plot and voila.

That's a lot of scripts, though.
I couldn't follow this topic since I was offline for the last week and I'm no nwn modding expert.
Of course it can't work if you just put the source code into the override directory. On the other hand, what would happen if you compile the new script once and put the compiled version into the override?
I'm afraid that wouldn't do any good, at least in part because it does not actually compile— it is an include file with functions and declarations and it does not run on its own.

The script in question is not packaged in the individual modules, but rather in with the game's common script resources. So, my hope was that overriding the game's copy of it would would cause new behavior in-game, and ideally, without needing to recompile the scripts all the modules. Well, the new behavior does go into effect, but only if the modules are recompiled. I still cannot wrap my head around this, but that's the way it is.

He was right that it only takes a few minutes to do that to the campaign modules. Procedure a couple posts back, if you are interested.
Post edited April 14, 2018 by tristanlist
With this info I think I understand why you have to recompile the module scripts.
When the scripts have references to library scripts the compiler sees these library scripts (source files) as part of the script it is compiling. So changes to the library scripts are treated the same way as changes in regular module scripts. I.e. the game can only recognize them if the whole script is recompiled.

Well, I'm not sure if I will do this, but in any case, thanks for the info.