New features added to banker AI in the Distro-Alt

Discussion about the development of POL's official distribution scripts.

Moderators: POL Developer, Distro Developer

Post Reply
Yukiko
Distro Developer
Posts: 2139
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

New features added to banker AI in the Distro-Alt

Post by Yukiko » Thu Jun 08, 2017 2:36 pm

The commit updates some source, include, control, and config files to support the new features.
The following is from the Distro changes text file. It has been reformatted for posting here. :)


New features in banker.src in scripts/ai. When you request your balance it is no longer delivered as text but is displayed in a gump. The gump shows the balance of gold coins, silver cooins (if you have any), and copper coins (if you have any) in your bank box
.
Image

The other feature is the banker can now sell Banker's Orders (cheques) that you buy to use instead of carrying around huge amounts of coin. The speech command is "bankers order" or "banker's order". He will ask you to wait a moment(2 seconds) while he pulls out the ledger. That wait time can be removed if you want to but I thought it added to the RP value. Then you are presented with a gump to enter the amount of the cheque. The maximum is 500,000,000 coins. You can cancel by leaving it blank or the usual right-click method. Then you are asked to enter the payee's name. Be sure to spell it correctly. The script will then search to see if there is a player by that name. Assuming there is you will be presented with a 'yes/no' gump telling you that it will cost an additional ten coins for the cheque. If you agree the cheque will be put in your backpack and the coins extracted from your bank box. The total amount of coins, including the 10 additional for the cost of the Banker's Order must be in your bank.

Image

The process of redeeming a cheque is easy. The payee simply drops it on the banker. They get a gump asking if they wish to redeem it and if so the coins are deposited in their bank. The purchaser also has the option of cancelling the cheque if they have it in their possession by the same method. If you cancel it the 10 coins you used to purchase it are not refundable. :) All appropriate checks are made against full backpacks and bank boxes and the transactions will be canceled if there is no room for the cheque in the purchaser's pack or the coins to be deposited in the bank. No money will be taken in that case and if redeeming the cheque fails because the bank box is full the cheque will be returned to the player's backpack.

Note:
I will be updating the gump for the Banker's Order to make some parts more readable. I used an HTML text gump for the main text but the other parts were standard gump work. It is too bad that we cannot specify different UO fonts in gumps or atleast I haven't found a way. I believe I was told once that the client allows that from someone who has studied source code from RunUO.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Turley
POL Developer
Posts: 605
Joined: Sun Feb 05, 2006 4:45 am

Re: New features added to banker AI in the Distro-Alt

Post by Turley » Fri Jun 09, 2017 9:14 am

About the font style have you tried one of
<B></B> <BIG></BIG> <SMALL></SMALL> <EM></EM> <I></I> <U></U>
<H1></H1> <H2></H2> <H3></H3> <H4></H4> <H5></H5> <H6></H6> <BASEFONT size=1-7>
?
Cannot remember if these all only change the size of the same font.

Yukiko
Distro Developer
Posts: 2139
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New features added to banker AI in the Distro-Alt

Post by Yukiko » Fri Jun 09, 2017 2:50 pm

Those tags only work in the HTML gump element. Actually the HTML default font looks fine. I used an HTML element in the Banker's Order to display the part that in the middle ("The person named below is to be paid..."). It's the regular gump text elements that I'm talking about. If you look at the "Balance" gump I put spaces between each letter where I name the different coins, like this: G o l d C o i n s, to get a better appearance. The colour, or hue, makes some difference of course but the letters in the font seem to be a little too close together. I'll admit part of my perception could be my eye sight. I've never had perfect vision and I think my stroke may have affected my vision a little but still being able to use the alternate UO fonts might improve readability. It would at least allow for more creativity when building gumps. I don't know if it's possible to send the client some special gump packet to change fonts but as I mentioned I heard from someone that it's done on RunUO but I personally haven't looked at their code to see how, or if, they do.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Harley
Forum Regular
Posts: 307
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: New features added to banker AI in the Distro-Alt

Post by Harley » Sat Jun 10, 2017 11:55 am

Great work, Yukiko! I think somebody find this very useful!
I'm one of them!)

Yukiko
Distro Developer
Posts: 2139
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New features added to banker AI in the Distro-Alt

Post by Yukiko » Sat Jun 10, 2017 10:03 pm

I'm glad you like it. There's nothing fancy there but I did write a couple functions that I like. The one that places the commas in the coin amount listed for one, though the commas look like periods in the gump display.

If you are going to borrow the features for use in your own server be sure to get the necessary "include" files or at least copy the functions from them that are required. I had thought about making this a stand alone pkg but there are about 10 different ways and places that the AI scripts are handled. Most of my AI is done the way the original POL Distro was done with them in \scripts\ai.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Yukiko
Distro Developer
Posts: 2139
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: New features added to banker AI in the Distro-Alt

Post by Yukiko » Sat Jun 10, 2017 11:05 pm

Also if you are using a version of the Distro that has merchant nodes be sure to look at merchantNodeControl.src. Look in the ProcessBankerText function. That script preprocesses the speech commands and only sends "valid" speech to the prospective NPC. I had to add the speech for Banker's Note to that function as well as the banker AI script or the banker would never receive the request.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest