Page 1 of 1

Having 2 bank boxes?

Posted: Sun Jul 26, 2009 6:58 am
by Jester
Hey!

I would need some tips on how to get a second storage system up. I want to have a new storage system of some kind that is totally secluded from the bankers. Any tips on the easiest way to go about doing this? Using new datafiles or sum? I run Pol 095.

// David

Re: Having 2 bank boxes?

Posted: Sun Jul 26, 2009 11:26 am
by Tomi
take a look at scripts/include/NPCBackpacks.inc and see how the storage areas are used there.

Storage areas are 1 of the less documented part of pol/escript. So the best approach should be to check existing scripts for it.

Re: Having 2 bank boxes?

Posted: Sun Jul 26, 2009 11:27 am
by Targun
run this command once for pol to create storage area for your addictional boxes:

Code: Select all

CreateStorageArea("mystoragearea");

run this once for every player to create his second bankbox

Code: Select all

var area:=FindStorageArea( "mystoragearea");
CreateRootItemInStorageArea( area, player.serial+"_bankbox2", <objtype> );
Now your player has a new box in storage area 'mystoragearea'. the box name is "<player.serial>_bankbox2"
<objtype> is objtype of container that you want to use as your addictional bankbox

to open this box for player you need to:

Code: Select all

var area:=FindStorageArea( "mystoragearea"); // finds storage area with boxes
var box:=FindRootItemInStorageArea( area, player.serial+"_bankbox2"); // finds players box
SendOpenSpecialContainer( player, box);
:whip:

Re: Having 2 bank boxes?

Posted: Sun Jul 26, 2009 11:32 am
by Targun
Tomi wrote:take a look at scripts/include/NPCBackpacks.inc and see how the storage areas are used there.

Storage areas are 1 of the less documented part of pol/escript. So the best approach should be to check existing scripts for it.
yup, looking into includes is a good idea, but remember USE YOUR OWN STORAGE AREA NAMES
or you end up deleting bankboxes while cleaning some garbage
(Once I accidentaly wiped all keyrings and playervendor shops , cuz some genius thought it'll be a good idea to put'em in 'tamed storage' area)

Re: Having 2 bank boxes?

Posted: Sun Jul 26, 2009 10:48 pm
by Jester
Targun wrote:
Tomi wrote:take a look at scripts/include/NPCBackpacks.inc and see how the storage areas are used there.

Storage areas are 1 of the less documented part of pol/escript. So the best approach should be to check existing scripts for it.
yup, looking into includes is a good idea, but remember USE YOUR OWN STORAGE AREA NAMES
or you end up deleting bankboxes while cleaning some garbage
(Once I accidentaly wiped all keyrings and playervendor shops , cuz some genius thought it'll be a good idea to put'em in 'tamed storage' area)

Thanks, now I know how to do it really. So the bankers at this secluded area could use a copy of my current banker script just modified for another storage area...