Do you know if it is possible to change the cost of brewing a potion, crafting a wand, or writing a scroll? I know there is a function in “x2_inc_craft”, however I modified the script and it does not affect the game in any way. Prices remain the same.
Good day to all !
1 Like
@raymondsebas
If I recall correctly, I also edited a large number of “cost” 2da considerations, as well as scripts.
Also, if you edited the OC include, did you remember you have to recompile all related scripts?
Again, I don’t recall exactly what I did (as it was some time ago for me now), but I think this may have been more involved than it first looked. But maybe will post a quick solution … or if I recall exactly what I did.
2 Likes
Because no matter how much I change the cost up , down , or even to zero, nothing changes.
To test, I even removed the “take gold” parts, but nothing work. The only thing it does is not display the “charged” amount when creating an item.
@raymondsebas
I have this note in my own notes, which may be a clue for you … I handled gold costs a lot differently back then, for reasons of other crafting costs…
// BUFFER GOLD - CORRECT CRAFTING COSTS FOR ZERO LEVEL SPELLS
// NB: Re INCORRECT GOLD REPORT: I would need to edit line 296 of x2_inc_spellhook to point to different script than "x2_pc_craft" and those
// that follow from that script to finally reach the function CICraftCheckScribeScroll(line 765) in x2_inc_craft where gold is done/reported.
// Easier to simply add abuffer to count for old costs.
Check out the CICraftCheckScribeScroll function mentioned here if you have not done so already.
EDIT: I obviously decided to work around the issue with a buffer system that worked for my own setup.
2 Likes
Did you recompile x2_pc_craft with the changes too?
2 Likes
Well yes. Why would I modify a script without first checking if it compiles? Anyway…
Even if I modify part of the script, for example the Wrapper for the crafting cost calculation, nothing will change in the game.
It’s very weird so far or It might be hardcoded …
2 Likes
Q, Could you work around it by just refunding x gp back to the PC based on your revised price list?
If you used that approach you could also consider other factors like reducing costs for characters with high Craft Alchemy skills.
Just a suggestion.
1 Like
I ask because you mention “x2_inc_craft”, but make no mention of “x2_pc_craft” - they’re different scripts. I tried changing X2_CI_CRAFTWAND_COSTMODIFIER in the first and recompiled the second, and the difference in cost was reflected in game. If this doesn’t work, specifically what did you try?
2 Likes
What did you modify in “x2_inc_craft” and
what did you modify in ““x2_pc_craft” to make it work ?
const int X2_CI_CRAFTWAND_COSTMODIFIER = 7;
Changed from 750 to 7.
I changed nothing in x2_pc_craft, merely recompiled it with the changes in x2_inc_craft. With that, a wand of Bull’s Strength cost 210 gold, which is definitely way less than normal.
In the “x2_inc_craft” for NWN_2 :
I changed all cost modifier to another number and even to zero (0)
nothing changed.
I modified and even deleted each of the “take gold” lines,
nothing changed.
I changed the “Wrapper for the crafting cost calculation”
int CIGetCraftGPCost(int nLevel, int nMod)
to “0”
and nothing changed…
Here in this image I didn’t change it, but I changed it previously to
// -----------------------------------------------------------------------------
// Wrapper for the crafting cost calculation, returns GP required
// -----------------------------------------------------------------------------
int CIGetCraftGPCost(int nLevel, int nMod)
{
return 0;
}
It doesn’t do anything at all… I even took it off and it doesn’t do anything either…
Sorry if I’m being ignorant now, I’m just trying to help…
After you did these changes in x2_inc_craft you recompiled x2_pc_craft also, right? As I’ve understodd it, if you change something in an include script, you need to recompile every script that uses that include script for the scripts using the include scripts to work. Maybe you recompiled x2_pc_craft after changing things in x2_inc_craft , and if that’s the case, I don’t know what’s going on.
2 Likes
If you’re certain all the relevant scripts are being compiled, you may want to check to make sure there are no duplicated scripts in your override folder.
3 Likes
SOLUTION (thanks to @Akhacha )
-
Duplicate “x2_inc_craft” and “x2_pc_craft” to your Module (make copy in fact);
-
in “x2_inc_craft” in the “Wrapper for the crafting cost calculation” section, add the line “return 1;” (see picture below);
-
in “x2_pc_craft” add the line “#include "x2_inc_craft” to it save and compile.
4 Likes
@raymondsebas
Yes, it was that x2_pc_craft I was referring to in that comment I posted from my own notes that would also require recompiling.
I wanted to avoid recompiling OC scripts where possible, and so considered rewriting my own script to replace such and then add functions required before recompiling… but, in the end, just went with the buffer system as prices could alter again in my system if a player wanted to scale what they were trying to make … e.g. A level 3 cure potion instead of a level 1 one. The former would cost more to brew.
2 Likes