This is a very simple system, import, and place the chest and the banker. The storage NPC is used to speed up the process, but don't worry about placing that one since it's handled automatically. Built in HOTU/SOU toolset, but compatible with original, just use an erf tool to fix the ExportInfo.gff if you need to or contact me and I'll try to do it for you/show you how to do it.
Posted by Olander at 2005-01-12 03:27:21 Voted 10.00 on 01/12/05
This is a very nice and easy to use bullet proof Banking System. I have integrated this in my Realistic Systems recently with very minor changes.
Great work Xanas!
Cheers!
Olander
Posted by smitheeen at 2004-12-26 18:15:41 Voted 9.00 on 12/26/04
Its simple, that's true :)
Posted by Gomisan at 2004-09-18 02:52:00 Voted 8.00 on 05/13/04
Nice to hear back anyway. If you feel liek seeing your stuff in action soemwhere, pop by 'Thh Realme'
Gee we could even do with another scripter if you wanted a pet project. ;)
Must admit, I too am really looking forward to NWN 2
Posted by Xanas at 2004-09-17 14:45:00 Voted 10.00
Well it's been some time since you wrote but I'm looking around so I'll explain a bit. At the time I stopped scripting a lot of things I was getting kinda tired of NWN. I had had a large part in scripting for one pw, left there and started my own thing with another team we had. Then that kinda broke off (still friends but no-one is working now :) ) and I think everyone was pretty much just tired of the work they had done on that other world. We had a lot of ideas of how we wanted to do things differently, had a pretty decent story/concept for the world I think, but just not really the desire to move forward that is required for large projects.
Among many reasons I didn't have hosting for the world anyway, so it was going to be difficult to setup. I like sharing but ultimately I do scripts for my own projects and that's the largest reason for decline. If I had a more solid solution for the hosting and I could get the other 4 members of my team back (or at least 2 of them) then I'd probably be doing something more right now.
Another thing recently drawing me away is the Obsidian NWN2 announcement. This game has me thinking of all those limitations of NWN1 I want to see corrected, and though it's a couple years away I look forward to it a lot. If it includes a quarter of the things I'm suggesting on their forums I'll be very happy :)
I hope my scripts have been somewhat valuable to people and I really hope that I've written them in such a way they are easy to follow so that other scripters can learn from them.
We'll see what I do later on :)
Posted by Gomi(san) ( 203.87.xxx.xxx ) at 2004-08-31 18:41:00
You've done some nice scripts, I'd like to see you stay active. Of course, theres a purely selfish reason... we use your scripts and the better they get the better for our server!
:)
It's interesting the number of people who've mentioned waiting for the 1.64 patch to see if they are going to get back into NWN. Personally, I think if it's going to need a patch to get you back in it, the patch will probably never satisfy. I'm actually dreading the patch, and all the extra work I'm going to have to do un-fixing my mod.
Posted by Xanas at 2004-08-31 09:47:00 Voted 10.00
haven't been around in awhile.. and still waiting on the 1.64 patch to see if it makes me want to be active again on this game :)
But, DCB should work well for you in this situation. I didn't realize that the files grew even when data isn't added. That shouldn't be my fault, but if I do come back to scripting then I'll definetly look into that.
Posted by ArmageddonVI at 2004-08-16 07:20:42 Voted 10.00 on 08/16/04
This script does everything I want it to do. Very, very easy to implement and works great.
Posted by Algernon's Ghost ( 24.176.xxx.xxx ) at 2004-08-12 00:08:00
Acrodania,
Thanks for the input. Something I realized with more experimentation is exactly what you have said, the files just keep growing. It became a problem with any given chest when it reached about 500k + though, so I found the function, DestroyCampaignDatabase, and set it to delete the database entry associated with that particular object just before doing the recursive save in the OnClose script. Since I am using a separate database entry for each 'chest' object, destroying the database associated with the object in question is not an issue, and it has been running great all this time.
Posted by Gomisan at 2004-05-13 03:32:59 Voted 8.00 on 05/13/04
Could do perhaps with alternate methods of selecting the amount deposited or withdrawn. I find that people dont actually realise they have to type in the amount.
Posted by AG at 2004-05-01 16:10:00 Voted 9.00 on 04/21/04
Xanas,
As you know, I am working with a modified version of your system for chests that saves a database for each chest separately. I am seeing the datbase file sizes increase each time the chest is opened, even though nothing is added to the chest. Do you know, is this normal with the BW database, or could there be something wrong? Does it not overwrite the data? Or is it laying copies of itself next to eachother in the database file?
Thanks for any input you migh thave on this.
Algernon's Ghost
Posted by StingRay2k01 at 2004-04-29 11:37:57 Voted 10.00 on 04/29/04
Posted by AG at 2004-04-21 22:39:39 Voted 9.00 on 04/21/04
Very simple to implement.
Posted by Xanas at 2004-04-21 01:36:00 Voted 10.00
done I think.. if you are still having trouble though I'll continue to answer over there.
Posted by AG at 2004-04-20 12:43:00 Voted 9.00 on 04/21/04
Xanas,
Alrighty, heh (here he goes again...), I've changed the chest scripts to create an invidual database entry for each placed chest so they can just be used for private storage chests, and show all goods placed inside to anyone. Each chest should have a unique tag.
I'm still having a problem with the gold return function, it is returning the amount twice. I'll post what I have in the BW scripting forum so you can see it. If you would have a look, I would surely appreciate it. Thanks again.
Algernon's Ghost
Posted by AG at 2004-04-20 11:41:00 Voted 9.00 on 04/21/04
Xanas,
One other question, If I change the scripts to look for the chest tag instead of cd key (already have actually, and it works fine), will I still have the problem with more than one player opening the chest at the same time, and the first to close it getting all of the items? I'm just not clear on this part. Thanks.
Algernon's Ghost
Posted by AG at 2004-04-20 10:59:00 Voted 9.00 on 04/21/04
Xanas,
Thanks for the response. Whoops, I forgot about the previous post about gold after reading all the other posts. I will mess with it a little, and see what I can come up with. I'll let you know.
Algernon's Ghost
Posted by Xanas at 2004-04-20 03:14:00 Voted 10.00
Well, first of all I suggest following the advice of the below if you are worried about your players having that problem. Simply add the lines
int iGold = GetGold(OBJECT_SELF);
GiveGoldToCreature(oPC, iGold);
right above the while loop in the onclose and that will automatically give that gold back to them. But putting a banker in there for them to talk to before accessing the chests is a good idea.
As far as 2 players opening chests simultaneously.. the one who closes the chest will end up getting the items saved.. while the other one will not. I do suggest if you want to make the chests specific to the housing and not to the player, that you mess with the script as it is now.. and just take out the references to the players public cdkey, playername, etc. and just use like the tag of the chest (make it where each chest has a different tag of course).
And so yeah, you can do pretty much what you want with it. The code is pretty simple so you shouldn't have too many problems with it, but if you post in biowares forum if you have trouble I'll try to help there. It's harder to reply here.
Posted by AG at 2004-04-19 23:28:00 Voted 9.00 on 04/21/04
Xanas,
This is indeed a nice simple storage chest system, and I will test the chest functions out for possible use on our PW. I have a couple of questions though.
Why is gold storage not allowed in the chests? Any gold placed in them is lost when opened again. This will be a problem, as players will undoubtedly put gold in the chests.
I am looking mainly for players with houses to have a solution for storing items. If I place multiple instances of the chest, could there be issues if two players access chests simultaneously?
Also, is it possible to modify the code so that individual instances of chests can be tagged differently, and have the items only appear in the chest in which they were originally placed (still only for the proper player of course)?
Thanks in advance for any assistance and advice.
Posted by CassidyB at 2004-04-19 22:31:51 Voted 10.00 on 04/19/04
Great script, and great support. Thanks for takeing the ime
Posted by CassidyB ( 68.6.xxx.xxx ) at 2004-04-19 22:26:00
OK, I think you know about this bug, but I had a problem with players putting money in the bank and not being able to get it out. While reading the posts it seems that the fact that the players had long names could be the issue. I uploaded your new script and added it in.
I hope that is the fix I needed.
//CassidyB
Posted by Xanas at 2004-04-17 12:19:00 Voted 10.00
Yeah but anything I would add in the future would probably be in the way of pre-storage checks. It would be just checking of local variables on an item on the player or something to that effect.
But I do understand the need to keep simple code or I wouldn't have made this as few scripts as possible.
Posted by Mohobie01 ( 24.52.xxx.xxx ) at 2004-04-17 11:13:00
Thats not a bad idea at all, however don't forget simple code takes less resources in a PW ;) I think you've done great. testing has indicated the fix's work perfect. However I've only been testing your banker, and swapped your chest codes with the modifications. Simple is key to me, as I am doing my best to find ways to reduce lag, while still haveing a "fleshed" world.
This script set is perfect for anyone who wishs for players to have storage for both items and gold.
Posted by Xanas at 2004-04-16 23:46:00 Voted 10.00
Actually I understand that well enough, I don't plan on having a high loot module either :) But I was actually thinking of being nice and forwarding it to their bank account and letting them handle gold in either way.. just haven't actually done that yet but it'll be in a later version.
Posted by Mohobie01 ( 24.52.xxx.xxx ) at 2004-04-16 22:03:00
I did a quick test by myself to check it. It appears to function as intended without issues concerning name truncation.
As far as players recreating characters with extremely similar names, my thought is if they want it that bad, they would find a different approach anyways. ;) Looks good works great, I can't forsee any issues with this system now. but if I stumble across any I'll be sure to let ya know.
On the chests, In my module gold is very limited, so a loss of even a few hundred could hurt a player, there are 2 lines that you should be able to transfer from the code I posted :
int iGold = GetGold(OBJECT_SELF);
GiveGoldToCreature(oPC, iGold);
can be placed into your onclose above the while loop, as a simple fix. welps I guess I'll be movin on to new headaches and brain farts... thanks so much for your aid.
Mohobie
Posted by Xanas at 2004-04-16 18:58:00 Voted 10.00
If that way doesn't work for you or you can think of any problems with it later on just tell me and I'll do the full fledged bank accounts thing I talked about below. It'll basically be using one more item to be included with the system that will be put in the players inventory the first time the bank is used. They'll be assigned an account #, etc. I'll probably even set it up so that you can have a "routing #" that makes the banks be not module wide and include a feature that allows you to split up bank management files based on the # of players to lessen problems of possible corruption. (Bioware DB can corrupt and I've heard that's more of a problem when there are many players).
Posted by Mohobie01 ( 24.52.xxx.xxx ) at 2004-04-16 17:17:00
Oh great thank you, I'll install it tonight. My player with the truncated name doesn't come on till late night. But thats when Ill be doing some work on the module, so I'll get a chance to try it out for ya.
I wanted to add a little note, about the donation box idea I had. Adding that setplot line turned out to be a failure. I think i'm running into the same problem i had with the gethasinventory check. If i get bored enough or it becomes an issue in my module I'll work on a modified version of these scripts to fix that.
Xanas, you seem todo alot of scripting...just a small little neet idea would be maybe a lil animated gif that says powered by Xanas technology. Or even just a lil pic. Hehe I'd put it on my site... ;)
Mohobie
Posted by Xanas at 2004-04-16 15:13:00 Voted 10.00
Ok, in this version I attempt to deal with Mohobies problem by truncating PCPlayerName + CharName to 25 characters
Posted by Xanas at 2004-04-16 15:00:00 Voted 10.00
Well what you can do is just make it cut their name down.. I don't think it can be the length though because as far as I know variable names dont' have a set length. I'm not sure if the db has a limitation but I couldn't imagine it'd be that short.
So let me see, there are a few ways to handle this. We can either A) switch to a system where a player is assigned an account # that is attached to an object placed in their inventory. That would require me to write one more script to include with the system that would be attached to the modules oncliententer event. (it would basically put this item in their inventory the first time).. I could put the item in their inventory the first time they speak with the banker or something else..)
Or, I could simply truncate the long names myself through a basic function. Just use GetSubString(0, 20) and max it out at 20 characters or something. Of course the disadvantage of that is they can create a new character with that partial name and get the gold.. but, since it still uses their playername that shouldn't matter.. what do you think would be the best solution? One will require more work for those who want to include the system and one won't but will possibly allow people to create new characters that can get the gold out if they know the length limit.
Posted by Mohobie01 ( 24.52.xxx.xxx ) at 2004-04-16 14:27:00
Xana's I'm writing to inform you that I have found a bug in the bankers code. I'm pretty busy today so I won't have time to look into it, but it appears that players who have a long name can experience issues when useing the banker.
I'm not certain but it appears that a players name can get truncated, and result in the players funds not being saved(or recalled) properly.
I have 1 player in my module who has experienced this issue. Previously i attributed it to a fluke similar to one you posted below. however the bank system has proven to work with all my players, excluding this one. I'm no good with database files, but a quick prob into the database files shows that his name was infact truncated. Below is a copy paste of 2 examples from my database discoveries:
Jreban_Spelbush Drizzle of Sind
vs.
Farbarian_Daniel Farber_gold
The top one is from my player who's name was truncated. Ive also noticed that this one lacked the _gold on the end...could be to limitations in character size? I wish i had a lil more time to look into it, and I may be able to later tonight. But I was hoping i could get your aid on this one. Thanks and I hope to hear from ya.
Mohobie.
Posted by Xanas at 2004-04-16 11:24:00 Voted 10.00
That's fine, you might choose to post it in a more popular script also though :)
BTW, I'm pretty sure as of now this script is feature complete. If people really really want it to disallow gold or to forward gold put in it to peoples bank accounts ask and I'll put in the time. But for myself I am thinking with a banker in the same bank if people do that they kinda deserve it for not talking to the npcs before putting their stuff in a strange chest. LOL.
But I'm there are other views so if it's wanted I'll include it. If there are any other nice features people think this should include tell me that as well and I'll try it out.
Oh, and bugs. If there are any bugs I'm not aware of them so please let me know.