The next installment of Kittrell's Persistent Banking System. Version 1.5b adds in the option for taking out loans, it assigns weekly interest to loans and deposits in the bank, and stores a credit reputation for each character (which helps or hurts them when dealing with the bank, getting new loans, etc.), and more.
Try out the demo module included. kpb_system15b.zip is ~60 KB.
Decided to upload as a separate file from the basic banking at http://nwvault.ign.com/Files/scripts/data/1055806553034.shtml in case people only want the basic system and nothing else.
Let me know what you think. ReadMe is below in the 'Code' box. Post all comments and help requests here.
Apparently, there is a character limit on the amount you can put in this window. Sorry, guys, you'll have to wait for the 1.6 update before this problem is fixed.
If you are an advanced user, you may fix it yourself by deleting the int StartingConditional line, and move the script down between void main() { }.
Yes, the culprit has been revealed! Simply paste the following script as your KPB_ASSESSINT script, and it will fix the problem.
I used a time advancement item to test it, it appears to be working quite nicely now. The code also has a few bug fixes, such as reading the global interest rate if a DM has not yet set it (set to 1 by default to make sure no one exploits the system to get extra money if the DM wants the rate no higher than this.)
----------------------------------------
#include "kpb_dateinc"
void main()
{
object oPC = GetPCSpeaker();
int nBalance = GetCampaignInt("kpb_bank", "KPB_BANK_BALANCE", oPC);
int nYear = GetCampaignInt("kpb_bank", "KPB_DEPO_YEAR", oPC);
int nMonth = GetCampaignInt("kpb_bank", "KPB_DEPO_MONTH", oPC);
int nDay = GetCampaignInt("kpb_bank", "KPB_DEPO_DAY", oPC);
int iMonth = GetCalendarMonth();
int iDay = GetCalendarDay();
int iYear = GetCalendarYear();
string sCurrentDate = GetCurrentDate();
string sDepDate = GetDateString(nDay, nMonth, nYear);
int nTotalDays = GetDateDifference(sDepDate, sCurrentDate, "days");
int nInterest = GetCampaignInt("kpb_bank", "KPB_GLO_INT");
int nNewInterest = ((nInterest * nBalance)/100);
if (nInterest = 8 && nTotalDays = 15 && nTotalDays = 22 && nTotalDays = 29 && nTotalDays 37)
{
int nBalFigure = (nBalance + (nNewInterest * 6));
SetCampaignInt("kpb_bank", "KPB_BANK_BALANCE", nBalFigure, oPC);
SetCampaignInt("kpb_bank", "KPB_DEPO_YEAR", iYear, oPC);
SetCampaignInt("kpb_bank", "KPB_DEPO_DAY", iDay, oPC);
SetCampaignInt("kpb_bank", "KPB_DEPO_MONTH", iMonth, oPC);
SpeakString("Your account has been assessed. You now have " + IntToString(nBalFigure) + " gold pieces in your account.", TALKVOLUME_TALK);
}
}
Correct me if I'm wrong, but the code fix you placed below was for the onActivate of the DM Wand, correct? If so, I had that working fine under HotU (I have my own onActivate script and integrated the original with it).
I guess that still leaves the original question I had. Is anyone using this with HotU receiving interest on deposits? It doesn't seem to be working for me. I set the interest rate as a DM with the DM Wand provided, when I check the interest rate as a player, it tells me the exact rate that I set, but after a week or more is up, the player characters deposits are not receiving the interest they should. Any ideas? :-/
Definitely not a problem. I didn't realize that I wrote a script that so many people would like/use/download when I wrote it, and I looked here and saw that it was really a one-of-a-kind system, so I decided to keep maintaining it. :)
Great News! I really like this system! Glad to hear it's still being maintained! Thanks for the update! ;)
Posted by Tethyr Darknight ( ..xxx.xxx ) at 2004-02-18 05:32:00
The above system is compatible with SoU versions and back to beta 1.30. Continuation of this project will occur with the uploading of version 1.6 of this system, for fixes concerning HotU and other general fixes.
Though the continuation scripts in this ongoing project will more than likely work with older versions of the game before HotU, they will not be supported by the author, as I cannot support old versions when I have a newer version of the software/all the expansions.
I will post a link to the new project set when I have uploaded it, which will contain fixes for the HotU users, as well as a couple of other minor bug fixes.
Posted by Tethyr Darknight ( ..xxx.xxx ) at 2004-02-18 03:36:00
Alright, I found out what the problem was. Yes, HotU creates its own OnActivate script for use with the expansion pack. Here is the revised kpb_on_activate script that you will need to put as your OnActivate script. Basically, it's the kpb_on_activate and the BioWare standard OnActivate script merged together to work in concert with one another. I will post an updated version of the file soon, along with possibly some additional cool add-ons.
Place this file as your OnActivateFile:
//::///////////////////////////////////////////////
//:: KBP (Kittrell's Persistent Banking) Fixed
//:: OnActivateItem + Modified Original Bioware
//:: Hordes of the Undertide OnActivateItem
//:: Script to Fix Compatibility Issues
//:: kpb_on_activate.nss
//:: (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnItemActivate Event
*/
//:://////////////////////////////////////////////
//:: Modified By: Brian J. Kittrell / Tethyr
//:: Darknight
//:: Created On: 2004-2-14
//:://////////////////////////////////////////////
// * Generic Item Script Execution Code
// * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
// * it will execute a script that has the same name as the item's tag
// * inside this script you can manage scripts for all events by checking against
// * GetUserDefinedItemEventNumber(). See x2_it_example.nss
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
if(sTag=="kpbwand")
{
if (GetIsDM(oUser) == TRUE)
{
AssignCommand(oUser, ActionStartConversation(oUser, "kpb_wand", TRUE));
}
else
{
DestroyObject(oItem);
SendMessageToPC(oUser, "I am not an immortal, and I cannot use that item!");
}
}
}
Posted by Tethyr Darknight ( ..xxx.xxx ) at 2004-02-17 22:47:00
I have not tried the system under the HotU expansion. I am not sure if Bioware removed a vital command from the language or what. I will take a look into it after I reinstall all of the expansions and everything.
I've tried using this and it stores Gold just fine. I cannot seem to get the interest on deposit function to work though. I've set the interest rate with the DM tool, but player accounts are not gaining interest after the week is up. Anyone have this working with HotU?
Posted by i need a bank ( ..xxx.xxx ) at 2004-01-25 22:30:00
this script is not working on hotu version?? :(
and have a way to store itens in the bank too??
is possible do it in one future update?
Posted by Morgan Quickthrust ( ..xxx.xxx ) at 2004-01-20 12:23:00
Tethyr/Brian (if you are one and the same. heh heh...),
I was wondering if you had any planned expansions for this system still? If so, what might they be? This sytem is the front-runner to use as my Banking system in the PW I'm currently developing and building and I was just wondering what might be added in the future. Always looking ahead. Heh heh... :)
Posted by Ott ( ..xxx.xxx ) at 2004-01-12 00:45:00
Try putting this in the Module OnActivateItem script you are currently using (No guarentees this will work...) -
ExecuteScript (�kpb_on_activate�, OBJECT_SELF);
Posted by Ott ( ..xxx.xxx ) at 2004-01-12 00:44:00
Try putting this in the Module OnActivateItem script you are currently using (No guarentees this will work...) -
ExecuteScript (�kpb_on_activate�, OBJECT_SELF);
Posted by migbane ( ..xxx.xxx ) at 2004-01-10 09:12:00
Sorry that was How does SOMEONE make this work since HOTU has an OnActivateItem script and you can't just add #include "kpb_on_activate" because that wont compile. Any ideas because this system is brilliant?...
Posted by migbane ( ..xxx.xxx ) at 2004-01-10 09:10:00
How does on make this work since HOTU has an OnActivateItem script and you can't just add #include "kpb_on_activate" because that wont compile. Any ideas because this system is brilliant?...
Posted by Tethyr Darknight ( ..xxx.xxx ) at 2003-12-20 18:36:00
Thanks, digitalares for the comments, it was my first attempt at a more major system. :)
Posted by Tethyr Darknight ( ..xxx.xxx ) at 2003-12-20 18:32:00
Just in response to some folks, since I have been away for such a long time! :O
To Simkin, for just gold storage and retrieval, please refer to my first release; it only has storage and retrieval, no interest.
About transfering gold between characters, the design of the script was based around the accumulation of wealth on one character. Transfering to other characters may make the whole thing a bit cheapened and increase the inflation on modules more than GM's would like to deal with. This is currently not a planned feature.
As for the question of if this is an add-on, you should simply be able to add in the scripts from this version over the old one and it should work fine. It uses the same file names for the old stuff, so it should be plug and play (though you may need to build your module over again).
I hope to be working on this system further now that I am back around the NWN world a bit!
Posted by Asturias ( ..xxx.xxx ) at 2003-08-29 09:00:00
Nice work. Is it possible to make an addon to transfer funds to another character.
Posted by Rayn ( ..xxx.xxx ) at 2003-07-29 19:24:00
I am wondering if this is an add on to your origional 1.30 bank script using the database. Or would I have to strip it from the mod completely and replace it with this one.
Posted by Simkin ( ..xxx.xxx ) at 2003-07-26 21:18:00
Just wondering if its possible to toggle the credit ratings, all I want is the gold storage/retrieval.
Posted by Brian J. Kittrell ( ..xxx.xxx ) at 2003-07-19 15:55:00
I appreciate the positive comments. :) I'd hoped to create a secure loan/economy system since NWN came out (some people are bored by economics, but I like to study it *shrugs*). I believe I have done so in this project, and I only hope that everyone who needs something like this can enjoy it. :D
As for any missing scripts that it claims are not there, do not worry, it/they are there.
Posted by digitalares ( ..xxx.xxx ) at 2003-07-17 05:54:00
I tested this lastnight and added it to a mod I'm working on. Dear Lord, you did an incredible job on this! I'm truly impressed by its simplicity to impliment.
As you further work on this masterpiece please maintain the simplicity. Simply put:
1. Import .erf
2. Update the On Activate Item script with the included script.
3. Drag and drop included Banker into your mod.
4. Done!
WOW!!!!
Posted by digitalares ( ..xxx.xxx ) at 2003-07-16 19:30:00
When I imported the scripts it said that kpb_dateinc.ncs was required but not included ... should I be concerned?
Posted by Brian J. Kittrell ( ..xxx.xxx ) at 2003-06-24 18:14:00
The credit rating is non-transferable. It only works for the PC that has the credit rating.
Posted by Rashad ( ..xxx.xxx ) at 2003-06-23 08:52:00
Does the credit rating system prevent quick windfalls by a character that can then be transferred to another as the previous character is retired ?
Posted by Brian J. Kittrell ( ..xxx.xxx ) at 2003-06-21 20:31:00
And, yes, I intend to update it so players can also store items. That will come soon.
Posted by Brian J. Kittrell ( ..xxx.xxx ) at 2003-06-21 20:30:00
Hi. The bank account is accessible across the module as one account; the players can access their same bank account from two different bankers in two different cities.
Posted by Knowledge ( ..xxx.xxx ) at 2003-06-21 15:11:00
I'm assuming it works only for gold, not items...perhaps players could purchase a smalls safe-deposit box that would allow them to keep a limited number of items for a cost...just an idea.