Banker

Here you can post threads specific to the current release of the core (099)
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Banker

Post by boberski »

I have downlaoded 099 Alt_Distro from repo and when I create for example NPC banker an I try to say bank near him he do not react. Somebody can tell mi what is wrong?

banker.src

Code: Select all

use npc;
use os;
use uo;
use cfgfile;
use util;

include "util/bank";
include "include/eventID";
include "include/sysEvent";
include "include/client";
include "include/anchors";
include "include/dist";
include "include/begging";

var bank;
var me := Self();
var npccfg := ReadConfigFile("npcdesc");

program banker();
  say("Hi!");
  start_script("NPCKeeper", me);
  var next_wander := ReadGameClock() + 30;
  var myanchor := GetObjProperty(me, "Anchor");
  if(myanchor)
    MoveObjectToLocation(me, myanchor[1], myanchor[2], myanchor[3], me.realm, MOVEOBJECT_FORCELOCATION);
  endif
  drop_anchor();
  myanchor := GetObjProperty(me, "Anchor");
  EnableEvents(EVID_NODE);
  DisableEvents(SYSEVENT_SPEECH);
  var text;
  while(1)
    var ev;
    ev := os::wait_for_event(120);
    if(ev.type == EVID_NODE)
      text := lower(ev.text);
      if(text["bank"])
        if(ev.source.criminal == 1)
          say("I will not do business with criminals!");
        else
          OpenBank(ev.source);
        endif
      elseif(text["balance"])
        if(ev.source.criminal == 1)
          say("I will not do business with criminals!");
        else
          var bankbox := FindBankBox(ev.source);
          var contents := EnumerateItemsInContainer(bankbox);
          var amt := 0;
          foreach item in contents
            if(item.objtype == 0xeed)
              amt := (amt + item.amount);
            endif
          endforeach
          if(amt == 1)
            PrintTextAbove(me,"" + ev.source.name + ", Your bank box holds " + amt + " gold coin.");
          else
            PrintTextAbove(me,"" + ev.source.name + ", Your bank box holds " + amt + " gold coins.");
          endif
        endif
      endif
    endif
	if(ReadGameClock() >= next_wander)
	  begpurse(me);
      wander();
      if(coordist(me.x, me.y, myanchor[1], myanchor[2]) > 5)
        MoveObjectToLocation(me, myanchor[1], myanchor[2], myanchor[3], me.realm, MOVEOBJECT_FORCELOCATION);
      endif
      next_wander := ReadGameClock() + 10;
    endif
  endwhile
endprogram

function OpenBank(you)
  TurnToward(you);
  var bankbox := FindBankBox(you);
  if(bankbox)
    var contents := EnumerateItemsInContainer(bankbox);
    var amt := 0;
    foreach item in contents
      if((item.container.objtype != 0xefa) && (item.container.objtype != 0xe3b))
        amt := (amt + 1);
      endif
    endforeach
    printtextaboveprivate(me, "Your bank box holds " + amt + " items", you);
    SendOpenSpecialContainer(you, bankbox);
  else
    say("You don't seem to have a bank box, "+ you.name);
  endif
endfunction
npcdesc.cfg declaration:

Code: Select all

NpcTemplate  banker
{
    Name                   <random> the banker
    script                 banker
    ObjType                0x190
    Color                  33770
    TrueColor              33784
    Gender                 0
    STR                    200
    INT                    200
    DEX                    200
    HITS                   200
    MANA                   200
    STAM                   200
    Privs                  invul
    Settings               invul
    guardignore            1
    AttackAttribute        Wrestling
    AttackSpeed            80
    AttackDamage           5d100
    dstart                 10
    psub                   25
    alignment              good
    wealth                 poor
    CProp  Equipt          sbanker
    AttackHitScript        :combat:wrestlingHitScript
    OpensDoors             1
}
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

First let me say thanks for downloading the alternate Distro. I was asked by Nando to provide it for those who want a "bare bones" shard which they can add to on their own. It's based on the POL 0.95 Distro but upgraded to work on the current version of POL Core. It is fully functional except for snooping and stealing skills but I am still organizing and cleaning up some of the code. I hadn't announced it yet because I was awaiting permission from Nando but he's not been around for a few weeks.

It is based on the an earlier Distro that used "nodes" as listeners for the merchants, bankers, and guards. The merchant, banker, and guards do not function unless they are created using a node.

There is documentation for the nodes in \distro-alt\docs\additional docs
the textfile named nodes.txt gives a description of the node system. Use the .createnode command to create a node. Select the type you wish to create, merchant or banker. Then place the node. Now double-click on the node. A gump will appear. Click on the checkbox in the upper left side where it says "Create a new merchant here?". If you created a banker node then type banker in when the gump disappears. You will get a target. Click the location you want the banker to appear and he/she should appear within a minute or so. If you created a merchant node rather than a banker node then you would enter the type of merchant you want to appear.

You can have multiple types of merchants attached to a single node. Simply double-click the node to add additional merchants.
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

First of all, thanks for the answer! :)
Yukiko wrote:It is fully functional except for snooping and stealing skills but I am still organizing and cleaning up some of the code. I hadn't announced it yet because I was awaiting permission from Nando but he's not been around for a few weeks.
It will be something new? You think when you commit that?
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

There is no .createnode command in Distro :( orrr I am an idiot :P
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

You're not an idiot I'm sure but there is a .createnode command. If you're running on Linux that might be the issue because the text command is named createNode and as Linux is case based that could be the issue. Try using .createNode and see if that works. I will go through all of the commands and make sure they are all lowercase and update the repo. Your character has to be at least a GM for the command to work but I assume your character is using the default account which is higher than GM level,
It will be something new? You think when you commit that?
Yes, it's new and is intended as an alternate for those who don't want a "pre-made" type shard like the "Distro". There are still some of us that don't want a class system or that want to create our own for example. In the case of class systems if you want to create your own it's easier to start from fresh without one than it is to remove an existing class system.

Please let me know if the .createNode command doesn't work.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

I went through the text commands on my local copy of the alternative Distro and made them all lowercase. I have a problem though when I try to get the GitHub client to allow me to commit the changes. Apparently the client doesn't see case changes made to file names as a valid change. For example changing createNode.src to createnode.src isn't seen as a change to the file. So I had to go through some maneuvers to get the name changes committed. I think the relevant files have now been updated.
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm

Re: Banker

Post by bodom »

if you are working on Windows, it's normal: blame the OS for ignoring the case :D

Code: Select all

git mv -f OldFile oldfile
should do the trick anyway
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

Yukiko wrote:Please let me know if the .createNode command doesn't work.
I create a node but I cannot access it, double click on item do not do anything.

Also:

Code: Select all

Warning! merchantNodeDestroy.ecl does not exist!
Exception caught while loading script merchantNodeDestroy.ecl: Unable to open merchantNodeDestroy.ecl for reading.
Unable to read script 'merchantNodeDestroy.ecl'
Warning! merchantNodeDestroy.ecl does not exist!
Exception caught while loading script merchantNodeDestroy.ecl: Unable to open merchantNodeDestroy.ecl for reading.
Unable to read script 'merchantNodeDestroy.ecl'
Warning! merchantNodeDestroy.ecl does not exist!
Exception caught while loading script merchantNodeDestroy.ecl: Unable to open merchantNodeDestroy.ecl for reading.
Unable to read script 'merchantNodeDestroy.ecl'
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

Also created node item on iteminfo show name: "GargoyleMainHull D1"

Image

.iteminfo of banker node item :)
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

Thanks. You found a bug. When I updated the alternative Distro to be HSA compliant I had to update the ObjType numbers for the nodes because they conflicted with new graphic art in the High Seas client. I changed them in the itemdesc file but the scripts, createnode.src for example, got overlooked. So it was using the old objtype number to create the node which corresponds to the ship parts in HSA. I've updated the repo. So just download and recompile.

It looks like from your console output that the scripts didn't compile properly. The merchant node system is in ...\pkg\systems\merchantnodes. Make sure those *.ecl files exist after you compile all the scripts.

I have found that using the starthere.bat, or starthere.sh, file to compile the scripts doesn't halt the process on an error. So some scripts may not compile and you aren't aware of it.I prefer running ecompile from the command line. That way it stops when it encounters an error.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

bodom wrote:if you are working on Windows, it's normal: blame the OS for ignoring the case :D

Code: Select all

git mv -f OldFile oldfile
should do the trick anyway
Thanks Bodom. Yeah I figured it was because I'm using Windows. I thought that the Git client would be system agnostic but I suppose it uses Windows APIs which are case insensitive.
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

Yukiko wrote: It looks like from your console output that the scripts didn't compile properly. The merchant node system is in ...\pkg\systems\merchantnodes. Make sure those *.ecl files exist after you compile all the scripts.

I have found that using the starthere.bat, or starthere.sh, file to compile the scripts doesn't halt the process on an error. So some scripts may not compile and you aren't aware of it.I prefer running ecompile from the command line. That way it stops when it encounters an error.
All script was compiled succesfully.

Code: Select all

Compiling: /home/ancaria/099-new/pkg/systems/merchantnodes/merchantNodeDestroy.src
Writing:   /home/ancaria/099-new/pkg/systems/merchantnodes/merchantNodeDestroy.ecl
Writing:   /home/ancaria/099-new/pkg/systems/merchantnodes/merchantNodeDestroy.lst
Writing:   /home/ancaria/099-new/pkg/systems/merchantnodes/merchantNodeDestroy.dbg
Writing:   /home/ancaria/099-new/pkg/systems/merchantnodes/merchantNodeDestroy.dbg.txt
Writing:   /home/ancaria/099-new/pkg/systems/merchantnodes/merchantNodeDestroy.dep
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

Check the case of the name of the merchantnodeDestroy script in \pkg\systems\ merchantnodes

It's probably the same issue as with the commands. I bet the itemdesc file has the destroy script spelled with the mixed case name but the actual script name is all lowercase. I'll look at it later today too.
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

After redownload reo and recompile, banker node works! :)

@Yukiko
Can you provide me with uoconvert.cfg file for HSA? Now when I convert I get missing things assuming that they are Houses. :P
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

Glad to hear that.

I get the same errors. I haven't had time to research the problem yet. I'll look into it later today. By the way, I have the data files for the world that have all the decorations, doors etc. I can't remember if I uploaded the them to the repo but if I didn't I will later. I'm off to bed soon. Not sure where you are on the planet but I live in the US but I work nights. So please be patient.

I do appreciate your help in testing the Distro. It's never been run on a Linux machine and I didn't have a lot of testing after I made it HSA compliant. I still don't have custom housing or the large ships scripted. I might leave that for someone else to do.
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

@Yukiko I am from Poland for me is end of workday for now: 3;40 PM to be exact. ;)

So you do not have uoconvert.cfg for HSA :( maybe I will try to create one by checking what are the missing IDs :)
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

No. I don't know if anyone has made a uoconvert for HSA. I'll see what I can do later.
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm

Re: Banker

Post by bodom »

There is an "UseNewHSAFormat" in uoconvert... do you mean it?

http://docs.polserver.com/pol099/config ... onvert.cfg
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

@bodom I mean all the IDs in uoconvert.cfg, there are gaps between cfg file and MUL files so uoconver show warnings.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

aderal,
Here is a uoconvert.cfg file with the missing multis added. I want to thank Agata for posting his version of the World of Dreams scripts from which I drew some of these multi numbers. The other ones I added under houses. They technically aren't houses. They appear to be such things as ready made quest camps or small gardens. Unfortunately there are only three categories for multis and they certainly aren't boats or stairs. So that's why I placed them in the "houses" category. I will add this to the repo as well but I figured I'd post it here to help speed things up for you.

Code: Select all

LOSOptions
{
	// UseNoShoot means uoconvert will determine whether or not something blocks LOS by use of
	// the NoShoot tiledata flag instead of the Blocking tiledata flag.  A couple of special
	// cases exist for secret door items and blocking items that are walls(in both cases, LOS
	// will be hindered), but otherwise the NoShoot tiledata flag will be used.  This should
	// make many blocking, yet not really LOS blocking items no longer block sight, such as
	// candelabras, lamp posts, and such.
	
	// LOSThroughWindows only matters if UseNoShoot is 1.  If LOSThroughWindows is 1, then
	// items marked as windows in tiledata will not impede LOS.
	// Both of these options default to false.  When UseNoShoot is false, the old method of
	// determining sight blocking as being equivalent to ability to pass will be used for LOS.
	
	UseNoShoot		0
	LOSThroughWindows	0
}

StaticOptions
{
	MaxStaticsPerBlock 		1000
	WarningStaticsPerBlock		1000
	ShowIllegalGraphicWarning	1
}

TileOptions
{
	ShowRoofAndPlatformWarning	0
}

ClientOptions
{
    UseNewHSAFormat 1
}

MultiTypes
{
//	Boats 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17
	Boats 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47
	
	Houses	0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x87 0x8c 0x8d 0x96 0x98 0x9a 0x9c 0x9e 0xa0 0xa2 0xC8 0xC9 0xCA 0x1f4 0x1f5 0x1f6 0x3e8 0x3e9 0x3ea 0x3eb 0x7d0 0x7d1 0x7d2 0x7d3 0x7d4 0x7d5 0x7d6 0x7d7 0xbb8 0xfa0 0xfa1 0xfa2 0xfa3 0xfa4 0xfa5 0xfa6 0xfa7 0xfa8 0xfa9 0xfaa 0xfab 0xfac 0x1388 0x13ec 0x13ed 0x13ee 0x13ef 0x13f0 0x13f1 0x13f8 0x13f9 0x13fa 0x13fb 0x13fc 0x13fd 0x13fe 0x1404 0x1405 0x1406 0x1407 0x1408 0x1409 0x140a 0x140b 0x1410 0x1411 0x1412 0x1413 0x1414 0x1415 0x1416 0x1417 0x1418 0x141c 0x141d 0x141e 0x141f 0x1420 0x1421 0x1422 0x1423 0x1424 0x1425 0x1428 0x1429 0x142a 0x142b 0x142c 0x142d 0x142e 0x142f 0x1430 0x1431 0x1432 0x1435 0x1436 0x1437 0x1438 0x1439 0x143a 0x143b 0x143c 0x143d 0x143e 0x143f 0x1442 0x1443 0x1444 0x1445 0x1446 0x1447 0x1448 0x1449 0x144a 0x144b 0x144f 0x1450 0x1451 0x1452 0x1453 0x1454 0x1455 0x1456 0x1457 0x145c 0x145d 0x145e 0x145f 0x1460 0x1461 0x1462 0x1463 0x1469 0x146a 0x146b 0x146c 0x146d 0x146e 0x146f 0x1476 0x1477 0x1478 0x1479 0x147a 0x147b 0x1770 0x1771 0x1772 0x1773 0x1774 0x1775 0x1776 0x1777 0x1778 0x1779 0x177A 0x177B 0x1D4C

//	Stairs 0x1db0 0x1db1 0x1db2 0x1db3 0x1db4 0x1db5 0x1db6 0x1db7 0x1db8 0x1db9 0x1dba 0x1dbb 0x1dbc 0x1dbd 0x1dbe 0x1dbf 0x1dc0 0x1dc1 0x1dc2 0x1dc3 0x1dc4 0x1dc5 0x1dc6 0x1dc7 0x1dc8 0x1dc9 0x1dca 0x1dcb 0x1dcc 0x1dcd 0x1dce 0x1dcf 0x1dd0 0x1dd1 0x1dd2 0x1dd3 0x1dd4 0x1dd7 
	Stairs  0x1db0 0x1db1 0x1db2 0x1db3 0x1db4 0x1db5 0x1db6 0x1db7 0x1db8 0x1db9 0x1dba 0x1dbb 0x1dbc 0x1dbd 0x1dbe 0x1dbf 0x1dc0 0x1dc1 0x1dc2 0x1dc3 0x1dc4 0x1dc5 0x1dc6 0x1dc7 0x1dc8 0x1dc9 0x1dca 0x1dcb 0x1dcc 0x1dcd 0x1dce 0x1dcf 0x1dd0 0x1dd1 0x1dd2 0x1dd3 0x1dd4 0x1dd7 0x1dd8 0x1dd9 0x1dda 0x1ddb 0x1ddc 0x1ddd 0x1dde 0x1ddf 0x1de0 0x1de1 0x1de2 0x1de3 0x1de4 0x1de5 0x1de6 0x1de7 0x1de8 0x1de9 0x1dea 0x1deb 0x1dec 0x1ded 0x1dee 0x1def 0x1df0 0x1df1 0x1df2 0x1df3
}

Mounts
{
	// If this element exists, and if Tiles exist within it, then those tiles with the graphic IDs
	// listed will be considered to be mounts by uoconvert and will set the layer to be the
	// mount layer and it will set the tile to be equippable.
	Tiles  0x3e90 0x3e91 0x3e92 0x3e94 0x3e95 0x3e97 0x3e98 0x3e9a 0x3e9b 0x3e9c 0x3e9d 0x3e9e 0x3e9f 0x3ea0 0x3ea1 0x3ea2 0x3ea3 0x3ea4 0x3ea5 0x3ea6 0x3ea7 0x3ea8 0x3ea9 0x3eaa 0x3eab 0x3eac 0x3ead 0x3eaf 0x3eb0 0x3eb1 0x3eb2 0x3eb3 0x3eb4 0x3eb5 0x3eb6 0x3eb7 0x3eb8 0x3eba 0x3ebb 0x3ebc 0x3ebd 0x3ebe 0x3f6f
}
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

@Yukiko, thanks for the file, there are still some missing but as you said these, from 0x1F41 to 0x211F are some kind of houses.

PS. I can not find 0x2*** IDs in UOFiddler :P
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

I am any getting any missing multis with the updated uoconvert.cfg file. What version of HSA are you running?
PS. I can not find 0x2*** IDs in UOFiddler
You mean multis above 0x2xxx? I don't see those either in Fiddler. But as I said I am not getting the errors you are getting. So maybe I don't have the same version of HSA that you do.
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

http://files.theabyss.ru/uokr/2D.rar this is the version I am ussing for my testings, it is HSA 7.0.34.22. Maybe you can provide yours?
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Banker

Post by Yukiko »

Your version is a little newer than mine. I am on 7.0.27.9

That might be why you are getting other errors from uoconvert.

I can make my version available for you to download if you need it but since yours is a newer one I don't think it would benefit you. I am downloading yours so I can add the additional missing multis to uoconvert.cfg

Thanks for the feedback on the Distro.

Hopefully the POL Core devs will include an HSA version of uoconvert.cfg in the Core repo once we get it finished. ;)
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Banker

Post by boberski »

Yes I hope so to :)
Post Reply