This is the continuation of the KPB system, and it is considered to be the final edition. Expansions may come in the future, but it's at a final point for the base system. Store gold and items, invest in random ventures, take out/repay loans, and more. Read the ReadMe for more information.
This is a compilation of many previous versions. You may see the others under Scripts Index -> Database Related -> Banking.
Posted by sharlynk at 2010-05-10 16:56:55 Voted 9.00 on 05/10/10
If some people are still using this and having a problem with the Item Duping issue described below, here is a fix I found today while trying to fix the exploit for our persistent world (The Moonsea).
There were some serious issues with the counters in kpb_ppis_disturb and with my fix it looks like it's working fine. Here is how:
1. Add kpb_ppis_disturb to the OnDisturb event of the placeable Item Bank Vault (unique) in the palette.
2. Replace the entire content of the kpb_ppis_disturb script by this:
/////////////////////////////////
//: Kittrell's Persistent Banking
//: kbp_ppis_disturb.css
//: Modified By: Brian J. Kittrell
//: Modified On: 19-2-2004
//:
//: Originally By: OldManWhistler
//: PPIS System
/////////////////////////////////
int PPISUserDefinedInventoryLimit(object oPC, int iCount, object oItem)
{
// Maximum allowable items stored in the vault by any one player.
if(iCount >= 30)
{
SendMessageToPC(oPC, "You may not store more than 30 items.");
return FALSE;
}
return TRUE;
}
const string PPIS_COUNT = "PPISCount";
void main()
{
object oPC = GetLastDisturbed();
if (!GetIsPC(oPC)) return;
int iType = GetInventoryDisturbType();
object oItem = GetInventoryDisturbItem();
int iCount = GetLocalInt(OBJECT_SELF, PPIS_COUNT);
if (iType == INVENTORY_DISTURB_TYPE_ADDED)
{
if (GetItemStackSize(oItem) > 1)
{
iCount++;
SetLocalInt(OBJECT_SELF, PPIS_COUNT, iCount);
DelayCommand(0.3, AssignCommand(OBJECT_SELF, ActionGiveItem(oItem, oPC)));
SendMessageToPC(oPC, "Gold and other stacked items cannot be stored within this container.");
}
else if (GetHasInventory(oItem))
{
iCount++;
SetLocalInt(OBJECT_SELF, PPIS_COUNT, iCount);
DelayCommand(0.3, AssignCommand(OBJECT_SELF, ActionGiveItem(oItem, oPC)));
SendMessageToPC(oPC, "You cannot store containers in your vault.");
}
else if(!PPISUserDefinedInventoryLimit(oPC, iCount, oItem))
{
iCount++;
SetLocalInt(OBJECT_SELF, PPIS_COUNT, iCount);
DelayCommand(0.3, AssignCommand(OBJECT_SELF, ActionGiveItem(oItem, oPC)));
}
else {
iCount++;
SendMessageToPC(oPC, "The vault has "+IntToString(iCount)+" items stored.");
}
SetLocalInt(OBJECT_SELF, PPIS_COUNT, iCount);
}
else if (iType == INVENTORY_DISTURB_TYPE_REMOVED)
{
iCount--;
SetLocalInt(OBJECT_SELF, PPIS_COUNT, iCount);
SendMessageToPC(oPC, "The vault has "+IntToString(iCount)+" items stored.");
}
return ;
}
Anyway, very nice bank system, has been in use in our PW for a while now. Thanks again!
Posted by azak30 at 2009-06-30 20:13:18 Voted 10.00 on 06/30/09
Still one of the best banks made for the game. Number 1 in my book.
Also, my purchase of NWN Diamond/NWN1 was sparked by a highly difficult time of trying to make sense of the new toolset. It's definitely more like a 3D software suite than a game/map editor. I may worry with it in the future, but for now, I'd rather stick to what I know. lol
Well, I am suprised that people have still found a use for it after all this time. I just went and bought NWN Diamond (can't find my old CD's) so that I could possibly play and build again.
Thanks for the positive comments. I really appreciate it.
Posted by DM_Lady_Death at 2006-09-23 22:46:06 Voted 10.00 on 09/23/06
this is an awesome system we are going to be adding it in to the PW RP server Elanst'wyb Shire Among the Mists. _________________________ DM_Lady_Death
Posted by diavlen at 2006-08-02 12:40:59 Voted 10.00 on 08/02/06
I've been using this banking system for some time now on our persistant world of Borgo Pass. Very nice work! _________________________ Borgo Pass PW Link
Posted by DMLadyAbagail at 2006-07-29 16:03:46 Voted 10.00 on 07/29/06
I just love this system I have been using for over a year now and its the best Ive seen! This belongs in the HOF! _________________________ "Pudding can't fill the emptiness inside me...but it will help!"
Posted by TethyrDarknight ( 74.229.xxx.xxx ) at 2006-06-08 19:48:29
Hi,
Well, the formulae and the numbers can be adjusted depending upon each particular DM.
The numbers/formulae used in this guarantees a money-sink/rare extreme success rate on the investments. It is designed to make money a little rarer by sinking it from the players, while keeping making a big reward if a player happens to be lucky enough to hit the big money. (And there is some big money available in the script.)
But, sorry for the length between responses. I heard NWN2 was coming out, and I am very turned on about the new planned features.
I will be re-writing this system for NWN2, as it will more than likely need to be re-vamped for the new functions and new platform.
I also have a little more programming experience under my belt now from when I started, so I will write the system to run a little more smoothly and efficiently.
Glad everyone is having a good time with the system (save the few errors experienced by some folks).
If your DM wants to change the variables in the script for his uses, that's fine. But, in playing around with it personally, I found the system to be balanced for use in a game like this. (Since money is generated via monsters/loot out of thin-air, you need something on the other end to catch some of the thin-air stuff to keep the economy balanced).
I've been playing in a PW that uses this system, and was trying to generate some additional gold for my group between weekly sessions by using the Investment Broker. When I finally accumulated enough to invest in Food Production, within a few attempts I lost the entire investment. That led me to wonder how the terms describing risk are defined numerically in the script - especially "small chance of losing your entire investment." Our DM was kind enough to mention that he found the banking script here, so I downloaded it and dug a little deeper. I did some rough calculations based on the percentage chance for various returns, and found that, except for Food Production, all of the other types of investments have a large negative expectancy due mainly to the chance of losing the entire investment. This means that, over a large number of trials (or even a small number, in my case - ouch!), the players investing in these are all but guaranteed to go broke. I'm not sure whether this was your intention, but I thought I'd bring it to your attention just in case. Thanks.
Posted by Daijin at 2005-12-21 20:50:28 Voted 10.00 on 12/21/05
I use this in my private server Dunjon Legends, and it makes thing soo much easier, thank you!! _________________________ Dream Well, Faith, Loyalty, Truth, Honor, Friendship always.....
Daijin Dreamweaver, Leader of the Dream Warriors for 32 years, going strong.
Posted by TethyrDarknight ( 216.45.xxx.xxx ) at 2005-07-23 14:31:30
I have read back over the comments here after being gone for a while, and I will take a look at this and see if I can figure out some kind of workaround. I did not design the storage chest system personally, I simply integrated it to work into this banking system and included it as many people were requesting a system like this.
At that time, I could not see a way of doing the chest storage system without duping bugs such as this. The system I integrated claimed to work correctly without duping, but alas, it did not. hehe
I will look through this an attempt to either fix it or add a workaround for this problem. Thank you for your support and discussion, though.
Oh, just in case its not clear from the above, you CAN add more than 30 items and noy wind up with dupes, I just did this to verify the point at which duping occurs. The tower shield is 2x4 squares, so you could add 30 more 2x2 items and still not get duping. Or you could put 360 one space items in there with nothing else and get no dupes, if you were so inclined. Duping occurs at the point that the item you are tring to put in does not fit into any of the remaining empty spots. Depending on the order you put things in, you could wind up duping or not duping with the same set of items. On average, players start getting dupes between 70 and 80 items stored.
Funky
The below script is cut out of kpb_ppis_start. The added section is set off by commented lines. This works flawlessly to stop duping, but doesn't resolve the other problems I discuss above.
The problem Sol is referring to is posted on the previous versions page. I'll supply the details for you now. I'm not going to vote one way or the other at this time, out of respect for the time you've obviously put into these scripts. But I would certainly not characterize it as 'minor'. Duping occurs whenever the invisible creatures inventory exceeds the normal 6 page limit of a character. This means the minimum number of items needed before duping is possible is 31. The fact that you set the default limit in kpb_ppis_disturb to 30 suggests to me that you are aware of this, though I suppose it could be coincidence. Basically, whenever the creature receives an item it cannot fit into its inventory, that item is duped onto the ground, but this happens at the very end of the vaulting process, AFTER the item has already been stored in the database. One can open the container and ppull the same item out again. You can test this by opening your demo module and depositing 33 tower shields on the ground. Thn run the module. Deposit the 33 shields (Im using 33 as an example, 31 still causes this problem as I indicated earlier. This will not be a problem as by default the inventory limiter function is NOT on the the ppis_individual (where it does no good) OR the unique vault (where it fires correctly). Walk away from the chest. The PPIS Heartbeat script fires and sends the message, 33 items stored. But 3 tower shields are deposited on the ground in front of the chest at the same instant. Pick them up, deposit them. Walk away. Message says 36 stored, and 6 fall to the ground. Repeat again, and 42 are stored, 12 fall to the ground. Now withdraw all 42, and combined with the 12 on the ground, you now have 54 ahields - 21 dupes, all ready for sale. Now imagine doing this with an expensive item on a PW. And don't think that players won't discover it, players on my PW report it regularly.
So, I and another DM cracked open the toolset, and after some experimenting, figured out that the kpb_ppis_disturb script needs to go on the the unique vault. Great! we figured, problem solved. We left the limit at 30 and tested it. Funny thing is, that script doesnt work correctly. Its behavior is a bit erratic, but it appears that the first shield deposited (or whatever item you please) after the 30 limit is broached is STILL entered into inventory. Only at the 31st does the limiter kick in. End result? You can still dupe. Not only that, but if you dump items in there fast enough, you can dupe almost as easily as with no disturb script. I finally devised a workaround script to destroy the dupes instantaneously, which I'll post below. This does NOT, however, resolve the fairly serious issue that players can dump items into storage to their hearts content, generating unwanted database size and extra lag. The DM and I toyed with the ondisturb script for hours, tweaking this and that. Tried switching the iCount to 29, no good. Tried redoing the if/else structure - no good. Tried adding nInt -- statements, no good. Got it to do some very strange stuff, but not to work correctly.
Otherwise, this is a great script, but PLEASE fix kpb_ppis_disturb. Thank you for your time, and your formiddable script!
Best,
Funky
Posted by DM_HellSpawn at 2005-05-17 18:33:14 Voted 9.50 on 05/17/05
I'm currently experiencing 2 problems.
1) I'm also having problems with Items "spilling" out onto the floor. Though I believe this is because when the items are stored in the database they are stored on a creature and that creature is in some ways governed by the bioware allotted inventory slots.
2) When you set your item limit (ie 30) It is allowing me to put the 31st items in storage then when I add another (32nd) it kicks it out and tells me I have 30 Items in the vault when there is 31. You can keep putting items in the vault in this fashion infinitely it seems. It will however register the correct number of items when you walk away from the chest to persistantly store them.
If you would like more info on this feel free to contact me.
I've heard briefly of this problem before someplace, but I was never supplies the exact details about it.
Posted by _Sol_ ( 65.173.xxx.xxx ) at 2005-04-12 03:07:00
I seem to have a problem, which I couldn't see listed in the fixes for 1.6x.
The item vault seems to 'spill' items duplicating them somehow. Anybody ran into this problem before? I will post more details later tonite when i get home from work ;)
Posted by _Sol_ ( 65.173.xxx.xxx ) at 2005-04-12 03:07:00
I seem to have a problem, which I couldn't see listed in the fixes for 1.6x.
The item vault seems to 'spill' items duplicating them somehow. Anybody ran into this problem before? I will post more details later tonite when i get home from work ;)
Ack, just found out that my new Readme was overwritten at some point by one of the old ones. Have they changed how you update files on the vault? I put my correct email in the field where it asked...
Grrr... I will try to see how I can update this stuff, but I never did receive my information to update it. (No email, although I put my email information in there.)
Anyhow, the conversations/core scripts have only been fixed with any grammatical/spelling errors I've noticed. The only scripting add-on is the persistent time script, which most of you already will have. Like I said before, it's mainly a final version with everything necessary to run out of the box, so to speak. People who have been using this system are not required to update to the latest version, as no core scripts nor conversations have changed in any functional way. If you have noticed no spelling/grammar errors in the conversation, you've either already fixed it or no one has noticed as yet.
Posted by Ry'gel ( 82.217.xxx.xxx ) at 2005-04-01 01:17:00
What scripts/conversations did change? I went up modifying the lot (MySQL functions) in our module to concentrate the MySQL calls, so it would be very nice to know what has changed exactly. Also the readme included in the zip has a date of 20-2-2005 and doesn't look new to me :S
Hmmm... that's strange. It's never come up for me like that before. Did you make sure to walk away from the chest after placing something inside until you saw a "X items store persistently"? Or is it storing the things and just saying 0 items?
Posted by Yabbadabbado ( 220.240.xxx.xxx ) at 2005-03-28 05:04:00
Just a little bug...
No matter how many items you store in the bank vault, it seems to tell you that; "You have 0 items stored."
As for the lag-free policy, there are no heartbeats (whew :) ) in the system, and the only real resources it uses is to send/receive information to/from the database. Other than that, it's clean and efficient.