This extract is beta v.0.5 but the system has been developing for many years in my own modules. Please let me know if you encounter problems, bugs or difficulties. This system does NOT require the C.R.A.P. system to function - it is extracted from it, but has been heavily modified. All original credit goes to the original C.R.A.P. team. All my edits should be fully commented into the scripts that were modified. There are a number of new scripts as well.
Version info:
v.0.3 adds the CRAP chest blueprints and the related Open and Destroy scripts for each chest. The Blueprints also have the variables for coins setup, too.
------------------------
12/29/2017 Edit to the crp_inc_merchant script (v.0.4 and the 12/2018 patch includes this edit)
I will import an erf here with the edited script, but it is easy enough to edit yourself.
open "crp_inc_merchant" script in your favorite editor.
Go to line 783
put a "return" infront of the TakeCoinMakeChange command. Save, and build your scripts. This fixes an error that crept in when I put the GetAllMakeChange into the crp_MakeMenuSelection replacing the TakeCoinMakeChange.
------------------------
12/2018 edit - the yearly update! This is just a 4 script patch file that is detailed at the top.
There is also an erf for stackable 100 coins, cep_coins, which is compatable with the mannat1.hak detailed above.
v.0.4 is uploaded 1/8/2019
-------------------------
8/2019 - I uploaded as a seperate project the Improved Craft and Coins update. This has the coin edits to the NWN crafting system which I left out of this system. Importing this erf will allow your players to actually pay for the NWN crafting with coins active.
-------------------------
August 2021
0.4a includes the updated crp_inc_merchant file which should have been included in 0.4.
0.4b fixes line 611 to in same file to call BASE_COIN instead of COIN_GOLD
Add-on to show how to install Pre-decimal coins. Farthing - Ha' Penny - Penny - Shilling - Crowns... etc.
- 8/24/21 Reuploaded this package because the variables on the sample modules needed correction. Also added a barrel full of money to test large amounts of coins.
-----------------------
September 2021
0.5 is a package download with 2 install erf files, 2 item erf files, 4 sample modules, 1 hak file and a text doc.
Attachment | Size |
---|---|
![]() | 94.11 KB |
![]() | 175.84 KB |
![]() | 94.1 KB |
![]() | 935.08 KB |
![]() | 2.01 KB |
Lanterna |
78% |
A Fairy Tale |
80% |
The Cursed Land |
83.3% |
Sheep and Stone |
93.3% |
Vordan's Hero Creator |
98.8% |
The Gathering Storm |
84.4% |
The Crystalmist Campaign Chapter 3: The Sahuagin Heel |
84% |
Conan Chronicles 2 - The Zamorian Chronicles |
96% |
Dark Avenger Chapter 2 |
88.6% |
Trial and Terror |
83.3% |
Module OnEnter script
This has been added into the v.0.2 version. Previous information in this post was removed.
Just comment back in the "CRP_DEBUG" setting at the top of the script. A number of the scripts call on this variable whether it is positive or not. This was fixed in version 0.2
I added a link to the optional hak file which has an edited CEP compatible 2da file, coin images and an erf with coins that stack to 100. It also has other CRP images and objects for Pits, torches and animations. It is in the posting for the MVB, Mannast Vanila Basemodule and is an optional hak for that module.
Just for those who care, I added a 1 script erf which contains the crpm_openstore script. Kaelthia had asked if I could modify the store opening script to find coins other than Gold and Platinum and apply them to the total NWN Gold given the PC when said NWN store is opened. I think version 0.2 is good to go. Until I actually get a chance to really test it, it will still be Beta and not added into the system.
Actually this turned into part of the v.0.3 update and so is not included separately anymore. Enjoy!
EDIT:
I have to apologize here, I totally missinterpreted the system and thus made a false asumption.
After Mannast explained it below, it is certainly not a bug but me being stupid :(
Script works 100% fine!!
____________________
Awww how sad, would have been the perfect script. Small and useable.
But it has a major bug it seems, at least for me:
The System allways coverts 1 NWN Gold into 1 Gold Coin instead of 100NWN into 1 Gold Coin.
That means it doesn't use any coin that is below gold coin.
It doesn't even use coins above gold, you just get 100er stacks of gold coins instead.
So 10 000 gold converts into 10 stacks of 100 gold coins. No additional coin is used.
Have not yet found where the error is occouring :/
But as this poject has not been updated since a year I think Mannast is no longer active :)
I'm not sure what your bug is? It does directly convert NWN gold into 1 gold coin. If you want the NWN gold to be a lower coin and convert into a smaller coin, that is possible by adjusting the unit numbers for individual coins. However, that will inflate the cost of items. Let me know specifically what you are looking for and I can see what you need to adjust. Thanks!
To convert 1 ingame Gold to 1 Copper coin.
So that 100 ingame Gold converts to 1 Gold Coin.
I also will only use the normal NWN store, thus I was looking for a system that converts NWNGold back and forth to Item Coins.
After more testing I might understand where the issue is: It all revolves around the feature of the normal NWN store. Where gold is converted to gold.
Also the store doesn't obey the exchange rules. So you get only stacks of 100gold coins all the time till you have 500 gold in coins then you get that Letter of credit.
That is unfortunate for me. So my idea to just shift everything a bit to the right and make "Gold" to copper, " Platin" to silver and so on will not work either as the coins are not converted correctly but just made a letter of credit :(
Not a problem. Looking at the closestore script, I see what you mean. It does use an older bit of code to create the gold coins back in the PC inventory. In the openstore script, I made a change that would go through all the coins present and create a gold coin value of NWN gold - assuming that the NWN gold would always equal the basic gold coin of the system. The close door script also uses this assumption. <sigh>. If I am able, I will play with it and see if we can seperate the NWN gold value from the gold coin value of the coin script. Initially I thought you could just change which coin blueprint was being used in which slot (use a gold coin blueprint for the copper coin) and go up. But then you would not be able to use smaller coins.
I tested a little bit further and the thing is, that this is part of the CRAP Core that you used. It handles the things there the same way unfortunately.
I also thought about just switching the coins and just add a few more to rename coin4 to copper.
However the problem with the whole core is (as it is in crap) it doesn't change to higher/lower coins . You allways get stacks and stacks of coin4.
Which means, if you have 10 000 gold, you will get 100 stacks of 100 coin4 instead of coin5 and possible higher. Then your "letter of credit" kicks in which makes the whole system obsolete.
Also what I realized is, of course the close store script can't use lower coins to convert them, as their value is below 1 ingameGold and that doesn't exist in NWN.
If 1 Gold equals 1 ingame gold, 1 silver equals 1/10th of one ingame gold, which is impossible for nwn to understand. Except for a whole stack of 10 silver coins this one will get converted to 1 gold coin.
So in order to make a system that I was looking for a complete automated exchange system has to be created that automaticly converts coins back and forth when closing the shop. Which is totally beyond the scope of this script and possibly the time you'd like to invest.
On a sidenote:
I played around a bit with this one:
https://neverwintervault.org/project/nwn1/hakpak/original-hakpak/pnp-coi...
It has a system in place that converts coins back and forth and that saves the number of coins you initially had to give it back to you as you had them:
Like 20 copper, 10 silver, 3 gold and so on.
But it has the same issue with igGold = Goldcoin, I managed to change the conversion of igGold to copper, by changing the multiplicatives used.
Silver:
GiveGoldToCreature(oPC, nStack* 1/10);
iCoin2 = iCoin2 + nStack;
to
GiveGoldToCreature(oPC, nStack*10);
iCoin2 = iCoin2 + nStack;
Which meant Silver was worth 10 times coin1 and one gold coin being basically 100 ingame gold.
But I was unable to fully comprehend the math behind the exchange rates in the script which broke everything and so I gave up *sighs*
It also doesn't use that cool coin pouch and I had to deativate that obnoxious weight system. Also 50k stacks are rediculous.
Maybe if I am some day a bit more advanced in scripting I might be able to combine both systems to a fully functioning Currency System that solves the issue NWN has that only 1 type of currenty that inflates heavyly is used in the core game.
Anyway! Thanks for checking it out, I really appreciate it!
I did make an attempt to implement the coin system you referenced - I disliked it for the same reasons. Also, NPCactivities had some parts of a system that Deva Bryson Winblood wrote included in it but I never could get that to do anything. The "crp_inc_control and "crp_inc_merchant" define all the coins - the openstrore script uses these to get the number of NWN coins available, but it was the closestore script that I think I dropped the ball on. If I get something working, I will let you know. I readily admit, my current module building does not include the coins and so I have not been looking at this in a while.
Sure if you'd like to play around with it, it would be great.
But since you don't use it yourself there is not much reason to do so, however a working currency system might be cool anyway.
My initial thoughs were basically: Redefine ingameGold as the lowest possible curreny -> copper coin.
And have 10 copper convert to 1 silver, 10 silver to 1 gold, 10 gold to 1 platinum and 100 platinum to a coin6.
So we basically would have a system that converts 100 000 worth of ingame gold into one item. I don't think it would ever need more than that.
This is not the hard part, the hard part is really the exchange system that needs to take place at the close store event, since the open store works flawelessly as far as I can see, and that would require some math.
That is totally beyond y scope but I have seen those systems in the past.
I might get back to screw around with that System a bit more once I got the other scripts working. It is really fun to play around with it though :)
Okay - I am thinking about it now - the actual 2 points where the conversion is done involves the "crap_default" script which takes any NWN gold the PC has on them outside of a store situation and turns them into coins and the open/close store scripts. So the only editing that need be done is during these processes.
The points are these:
- VALUE_GOLD when used is where these scripts define how many B(ase)I(tem)C(oin)s each NWN coin is worth.
We can use a different number in here to determine the BIC we want. By default, VALUE_GOLD usually is 100. But say we want our gold coin to be worth 1/100th of a NWN gold piece. We can use "1" instead of VALUE_GOLD.
- nGold and COIN_GOLD are used to create these coins from NWN gold.
These are used to compare the number of NWN gold with the default stack size. BUT if we want to change how many coins are available to each NWN Gold, we can apply that at this point. So we replace nGold with nGold*100.
So I thought I could just whip up the edits here, but RL is in the way. I will hopefully check back in later with the actual edits. Sigh
Sounds awesome. Will look forward to it once you found some time.
Please no hurry!
I tried to play around with
const int VALUE_* in crp_inc_controll but it doesn't seem to influence the shop conversion at all.
I uploaded a 4 script patch which allows you to change the default conversion coin - I tested it quite a bit, but I'm sure I've missed something. Let me know if that works for you!
Hey! Thanks for the update. Appreaciate it.
But either way maybe I am not understanding what happens at all, or it doesn't work as intended.
If BASE_COIN and VALUE are not changed, the system behaves exactly as before. Which should be intended. That means it ignories every coin below gold.
If it is changed to COIN_COPPER it behaves completely strange. Instead of converting 75 ingame gold to 75 copper coins, or better 5 copper 7 silver, it gives back 7000+ ingame gold and spams the inventory with copper stacks.
So something is not working at all here, or I haven't fully understood it. CEP coins also do no longer work it seems.
Will test tomorrow, when I got mor etime a bit further :)
EDIT - Oh my - I just was able to confirm what you said - the open store script is not working as it was when I was testing it before. <sigh>
OK - figured it out, the crap_default script didn't make it correctly into the erf. I'm an idiot sometimes. I also managed to overwrite it in my tester mod with this erf and will need to rewrite it. Will upload when done. Updated and new version is being uploaded
---------------------
Hey,
quick testing done while on the train:
Conversion to copper seems to work now. However a few things I notices though:
- CEP and with that stack size of 100 doesn't work anymore. Not sure if I broke something but I just imported all erfs.
- The sytem now only converts coins to excessive amounts of copper, spaming the inventore. For some reason not to higher value coins and doesn't remember which coins you initially had. (maybe a great idea to fix that is, letting the system convert your money just randomly every time, the same as the onEnter script just awards random coins. This should keep the amound of coins diverse and lower numbers.)
also what do you mean with: "I also managed to overwrite it in my tester mod with this erf and will need to rewrite it." did you overwrite a backup or so? Still might have the old files from you if you need something.
<sigh> no worries - I was just bemoaning my bad practice at overwriting old testing mods. When I exported the erf files, I go in and try to edit out the extraneous includes that get added. For my original uploading, I managed to delete the .nss copy of of the crap_default script, so it would not load properly. However, since I overwrote my testing mod, the original version of that script was obliterated. On the lighter side, it mirrors for the most part the closestore script, so it was easy to rewrite it.
I will try it with the larger stack size to test, but that shouldn't have been impacted - That is controlled in the "crp_inc_control" script near the bottom. Stack size should be edited to 100. I will test, but maybe check the control file and do a script build.
Ok.
Well does the CEP version and 100 stack size still work for you? In that case I did something wrong somewhere.
Since it doesn't work for me I keep testing with 10stacks but that means massive amounts of copper stacks since the system doesn't want to convert to higher coins once the stack limit is reached.
I uploaded some new coins that use the mannast1.hak (which is CEP compatable) and are stackable to 100. This is the cep_coins.7z that I added above. That was the one step I didn't remember from when I made that option. What was happening to you was the script assumed it was making a stack of 100 coins, but the item would stop at the first 10 and ignore the remainder...
Hey there!
the conversion seems to work now, at least it doesn't bug anymore.
However it still doesn't convert into anything beside 4 100copper stacks and (for some reason) 1 silver or 1 gold piece and after that a letter of credit.
Yet at least it works and I might be able to play around with it to customize it more towards what I hoped to find. I mean I "just" have to thing about a way to convert the money back on store closed to coins that are more realistic and handy to use.
Thank you so much for your time!! I really appreciate it.
((just on a sidenote which might be important for some people to know: the exchange merchent will now dupe money of course since the values no longer match, so better not use it in conjunction to this update))
EDIT - Actually, this is buggy too. I'm working on a fix, which actually should simplify crap, but it is not working yet.
I think if you set the InsaneGoldProcess variable int to "1" on the module, it will not use the Letter of Credit and instead use the coin you set in BASE_PLUS and VALUE_PLUS. You can also set the InsaneGold variable int on the module to a lower number (it defaults to 500) to trigger when those higher value coins are used.
Update patch is now version 0.3b - this differs from 0.3a with upgraded coin change processes especially in streamlining the crap_default and crpm_closestore scripts.
cep_coin.7z has been improved at this time as well, providing described coins, including the two penny and the bar of gold. If you want, set the InsaneCoinProcess integer on the module to "1" to see the Bar of Gold used as a coin for large amounts of NWN gold.
Hey there,
I tested around a bit, this is what I found out:
I have set:
const string BASE_COIN = COIN_COPPER;
const int BASE_VALUE = VALUE_COPPER;
const string BASE_PLUS = COIN_SILVER;
const int VALUE_PLUS = VALUE_SILVER;
With InsaneGoldProcess = 0, the system converts ingame gold to 5 stacks of silver coins and then directly to gold bars. Neither gold coins nor platinum is used at all.
If
const string BASE_HIGH = COIN_BARGOLD;
const int VALUE_HIGH = VALUE_BARGOLD;
Is ist to COIN_GOlD / VALUE_GOLD the system starts to dupe gold again with every open/close store cycle.
It really seems the CRAP sytem is not flexible enough to be used outside its conversation based story system :( everything else would require a complete redesign it seems.
At least your version is now somewhat more flexible and interesting, though unfortunately not useable for me and what I hoped to find but that is of course due to the limitations of its base system, you made it allready a lot more advanced!
However there is unfortunately not much immersion in having hundreds of the same coin all to time. So I think i have to just stick with NWNs rediculous gold system till I am able to build something like that myself.
I don't feel good to occupy you with that issue the whole time especially since you don't even use these systems yourself currently.
So either was thank you so very much for making this system even more flexable!
I actually enjoy the problem solving aspect of this stuff, so no worries there. Please take a look at the version I just uploaded 0.3b - because it does have a third constant introduced - BASE_HIGH, which then is used by the InsaneGold process (if that is set InsaneGoldProcess int 1 on module) for the highest coins. Then the scripts now use the change making scripts to distribute the remainder, so it is possible to end up with 3 or 4 types of coins. If you use the hak file and import the coin erf, it works rather well. I appreciate you trying it out. I may go through and eventually upgrade the whole thing to v.0.4 but there are some other issues I need to think about before I do that. Thanks!
If you really enjoy it fine then we can of course continue if I am at least a bit helpful in QA , debugging what you made :)
My post is refered towards your 0.3b version.
If i use BASE_HIGH at for example COIN_GOLD it will start to dupe gold for some reason. Your amount ofIG gld increases for each cycle of open/close store.
If i keep it a COIN_BARGOLD it behaves as I have reported in my post before.
I use your hak file and scirpts in a completely clean module to prevent other scripts interfering in the testing process.
I will build a new module again just to make sure nothing went wrong. If anything behaves differently than I have reported I will edit thi spost in a few mins.
I was able to reproduce this bug and am now hunting down the bug. Thanks!
Awesome!
I tested again with a fresh initialized module:
Testsetting:
const string BASE_COIN = COIN_COPPER;
const int BASE_VALUE = VALUE_COPPER;//This value should match the base coin above
const string BASE_PLUS = COIN_SILVER;//This should be the coin above in value
const int VALUE_PLUS = VALUE_SILVER;//This should match the coin above
const string BASE_HIGH = COIN_BARGOLD;//This can be the same as BASE_PLUS or even Higher, if available
const int VALUE_HIGH = VALUE_BARGOLD;//This should match the coin above
InsaneGoldProcess = 1
InsaneGold = 0 (so 500)
Behaviour:
1 igGold gets converted to 1 Copper
2 igGold gets converted to 1 Two penny, so every even number gets converted to an amount of two pennys: 6igGold = 3 Two Penny, 7igGold = 3Twopenny 1Copper.
You never get more than 1 copper due to this system of Two Pennys.
After that every 10 igGold gets converted to 1 silver. till 5999 igGold, or 5,9 stacks of silver coins are accumulated. No gold or platinum coins are ever awarded.
After 6000 igGold , 5000 of it gets converted to 1 god bar instead.
So the system does indeed only use these 3 coin types you have defined above, every other coin is not awarded but can be used in openstore , but will then be converted to exessive amonts of silver coins again.
Found the bug - i will try and upload the change, but it's just one line!
In the crpm_openstore script, line 53, it is missing an "if" statement edit it to:
if(VALUE_HIGH> VALUE_PLATINUM) nTotal = ConvertCoin(oPC, nTotal, BASE_HIGH);
Without this, and if the coin has already been counted above it, the script has not yet removed the coins, so it will count them twice. This change will minimize that possibility
Now that I am looking at it, there can be a line added above it for the BASE_PLUS, too:
if(VALUE_PLUS> VALUE_PLATINUM) nTotal = ConvertCoin(oPC, nTotal, BASE_PLUS);
Testing:
Behaves normally till 500 gold, then with 600 iggold it converts into 1 gold coin, and after that it again statrd duping gold with ever cylcle. So nope the fix didn't work it seems.
I have however set:
const string BASE_HIGH = COIN_GOLD;
const int VALUE_HIGH = VALUE_GOLD;
Because personally I want to use copper -> silver -> gold - platinum as currencies. Since I don't ever intend to have a module where people have more than 10 stacks of platinum, which would bei 10 000 000 ig gold.
So no need for bars or letters of credit in that system, in my opinion.
Question:
What would happen if we declare more than these:
const string BASE_COIN = COIN_COPPER;
const int BASE_VALUE = VALUE_COPPER;
const string BASE_PLUS = COIN_SILVER;
const int VALUE_PLUS = VALUE_SILVER;
const string BASE_HIGH = COIN_GOLD;
const int VALUE_HIGH = VALUE_GOLD;
const string BASE_VERYHIGH = COIN_PLATINUM;
const int VALUE_VERYHIGH = VALUE_PLATINUM;
Wouldn't that solve the issue somehow? Because we would have a very linear conversion
1 copper = 1 igGold
1 silber = 10 igGold
1 gold = 100 igGold
1 platinum = 1000 igGold
And to make the system mor eflexible if needed, we could add then even one higher currency like Letters/Bars. But in that case we allready are at:
100 * 10000 iGold per stack of bars, don't think players will every encounter situationswhere they have more than 20 million gold.
RL has been distracting me, so I haven't looked at this recently. I will consider it and the duping bug. Thank you for testing this stuff - Sometimes when you script something and test what you are adjusting, it can blind you to other issues, so it is great having another pair of eyes on the issue.
Hey of course, no issue.
It is christmas currently so RL gets "in the way". We can continue as soon as we have the time again, no hurry.
Sure I try to help where I can :)
Talime - thanks again for your input - I uploaded a new patch v.0.3c above. I think it may be reaching something useful - Let me know if the text feedback is useful or annoying - it was debugging info, but I actually liked having the script tell me which coins were what, so I left it in.
Hey Mannast!
I think you've made it. After a quick test of your recent build I have not yet encountered a bug.
The conversion seems to work great till gold coins are reched. They don't get converted to platinum though but that might be just because you have not yet added a value for platinum now.
The gold dupe bug is also gone it seems.
Concerning the debug info: Of course this iteration is currently just for debugging and thus not refinded yet, but the idea of giving some sort of feedback to let players understadn what is currently happening with their gold is a great idea. I like that.
Maybe however it could be made optional with a global variable or a switch in crp_inc_controll since maybe not all want to have these information broadcasted.
But we should deffinately get back to that and refine the output a bit more. For now it is a bit too spamy I'd say.
Just a note aboout the latest version and Pre-Decimal coins add-on. I have been thinking hard about the paradigm of NWN coins equating a golden coin in whatever coin system we are using. In the comments above, Leaf was looking to make the NWN coin be the basic coin (lowest value) of the system.
In hindsight, I think this may be the correct direction to go. In other conversations, people mention that the NWN prices seem to be inflated by a factor. This would make the NWN coin worth roughly the DnD Silver coin, or 1/10 the Gold coin. But some things are heavily over priced. Ultimately, I think Leaf's idea of having the NWN be the copper - or lowest - coin in the system works best. It makes the correlating NWN stores make more sense and if you don't want to have text-driven stores (ala CRAP) the relation works without breaking the immersion as well.
So, I suggest the following:
at line 36 of the script "crp_inc_merchant"
this will set the copper coin as the NWN conversion coin. In the Pre-Decimal coin I would make the base coin the Farthing
const string BASE_COIN = COIN_FARTHING;