PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
A couple of annoying newbie questions.

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095)
Display posts from previous:   

Author Message
Datus



Joined: 19 Sep 2006
Posts: 58

PostPosted: Tue Sep 19, 2006 3:26 pm    Post subject: A couple of annoying newbie questions. Reply with quote

I've been tinkering with a few UO Server emulators now for the past few days. I started with POL095, then went to Sphere, then tried RunUO... now I'm back to POL... for 2 reasons. I found POL to be the easiest OOTB to configure and it has the best documentation. Neither - obviously -is mutually exclusive. Anyway, I forsee a long road in regards to scripting and customization of POL095, and I do plan to take it on quite heavily, as for now though, I have some VERY basic questions.

1. NPCs are not responding to training requests. They only respond to "buy" or "sell" requests. Am I doing something wrong here? I've tried "[name] train", dropping gold on them, with which they take from me, "train","teach", and all combinations in-between. I renamed speech.mul and still nothing.

***UPDATE***
OK I figured out the first answer by digging through merchant.src. "vendor train" ...now I just have to figure out how to change this.

2. What are these Sanctuary scripts I keep reading about and where can I grab them?

Anyway thanks for any help. Everyone here will no doubt be hearing more from me!! Wink

Also, I try pretty hard to search the forums for answers to my questions, so forgive me if I've missed anything.

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Tue Sep 19, 2006 5:02 pm    Post subject: Reply with quote

Sanctuary is a shard, who released copies of their shard scripts and config files.

And.... someone who uses search!? OMG.... YAY! hehe

Author Message
Yukiko



Joined: 02 Feb 2006
Posts: 1094
Location: Southern Central USA

PostPosted: Tue Sep 19, 2006 5:24 pm    Post subject: Reply with quote

Datus,

Let me recommend that you wait before trying to implement other scripts into POL 95 Distro. First make sure you have a good understanding of eScript and how the Distro works. The reason for this is that if you intend to migrate some of Sanctuary's scripts over or World of Dreams over you'll need to know what's happening in Distro in order to incorporate them.

I would like to welcome you to POL and congratulate you on the fact that you can see a superior emulator when you look at one. I agree that POL is batter documented than any other I have seen. Cannot speak for the OOTB setup though cause I did find RunUO to be easier as far as running and getting logged in though it's been several versions ago since I even looked at it. POL is not that bad configuring it to run. Never used the autoinstaller for POL. So maybe that makes things easier.

As for the "vendor train" issue, how do you want that to work?

Oh and if you want Sanctuary scripts PM me. I got 'em as well as a dozen other old shard's xcriptbases.

Author Message
Datus



Joined: 19 Sep 2006
Posts: 58

PostPosted: Tue Sep 19, 2006 5:51 pm    Post subject: Reply with quote

Hello MaudDib and Yukiko,

Thanks for your replies.

Yukiko I'll take your advice. The "vendor train" command is probably a good place for me to get my hands dirty. For learning purposes, I just want to change it so that a user only needs to type "train" to get a list of available skills a vendor will train. I tried fiddling with merchants.src and merchants.lst ... I changed the line that read (txt["merchant train"]) to (txt["train"]) ... then I basicaly did the same thing in the merchant.lst ... didn't work of course and I didn't think it would be that easy. Hehe..

Author Message
Yukiko



Joined: 02 Feb 2006
Posts: 1094
Location: Southern Central USA

PostPosted: Tue Sep 19, 2006 6:31 pm    Post subject: Reply with quote

Did you recompile the scripts?

POL is different than RunUO in that the scripts do not automatically compile at server runtime.

The merchant commands for training as I recall are

"vendor train" gets a list of skills the vendor can train the player in. If you have a skill higher than the amount of points a vendor trains then that skill will not exist in the list given by the vendor.

"Vendor train" <skill_name> will cause the vendor to ask fior the appropriate gold from the player. Then dropping that gold on the vendor's head will get the player trained.

Author Message
Yukiko



Joined: 02 Feb 2006
Posts: 1094
Location: Southern Central USA

PostPosted: Tue Sep 19, 2006 6:39 pm    Post subject: Reply with quote

Oh one thing more. The src files are the ones you modify to make script changes.

*.lst files are generated by eCompile in the event you need to do some deep debugging. They contain low level info such as Program Counter (PC) numbers and functions being performed at the PC.

Author Message
Datus



Joined: 19 Sep 2006
Posts: 58

PostPosted: Tue Sep 19, 2006 8:29 pm    Post subject: Reply with quote

Ok well, I compiled the merchant.src and threw all the output files(.ecl, .lst, .dep, .dbg) into /scripts/ai/ where they belong. Doesn't work.

the line I edited in merchant.src -

before:
Quote:
elseif((txt["vendor train"]) || (txt["vendor teach"]) || (txt["merchant train"]) || (txt["merchant teach"]))


after:
Quote:
elseif((txt["train"]) || (txt["teach"]) || (txt["train"]) || (txt["teach"]))


Is there anything else I need to update to force the changes to take effect?

Author Message
CWO



Joined: 04 Feb 2006
Posts: 699
Location: Chicago, IL USA

PostPosted: Tue Sep 19, 2006 8:40 pm    Post subject: Reply with quote

well, the .src is the only thing you have to ever change. The other files are just generated off of the src when compiled. If the server is running when compiling the script, all you need to do is in game, type .unload (scriptname)

so say its named vendor.src, I compile it and in game type .unload vendor

Now since this is an NPC, this is a more special case. The script is always running so it has to be restarted. For NPCs, this is easy, just type .restart and target the vendor. Now try to say your command.

Author Message
Datus



Joined: 19 Sep 2006
Posts: 58

PostPosted: Tue Sep 19, 2006 9:58 pm    Post subject: Reply with quote

CWO thanks for the helpful info. I tried everything you said, and I restarted the server. Unfortunately it's still not working... I don't understand it. It seems as if the server is looking somewhere else for "vendor train" or "merchant train" commands rather then the merchant.src I've modified and compiled because even with the modifications, all merchants still respond to "merchant train" and "merchant teach". Any ideas?

Thanks.

Author Message
CWO



Joined: 04 Feb 2006
Posts: 699
Location: Chicago, IL USA

PostPosted: Wed Sep 20, 2006 12:55 am    Post subject: Reply with quote

Just picked up the distro scriptpack and looked at it and I think I found where the problem is. My scriptbase works a little differently than distro's and where you changed it would have worked in mine. In mine, the vendor script does all the speech processing where in the distro, it seems the merchant's node does the processing and sends the result to the vendor script... But anyway, look for the script
pkg/systems/merchantnode/merchantNodeControl.src

this starts at line 303 in the script (fresh from the zip)
Code:

   // If the character wants to do something with a vendor:
   if (text["buy"] || text["sell"] || text["train"] || text["teach"]||(pass))
      
      // Just pick the nearest vendor if the player isn't specific.
      if( text["merchant"] || text["vendor"] || (pass) )
         var dis := 7;
         foreach mob in npclist
            if(CheckLineOfSight(who, mob))
               var dst := dist(who, mob);
               if(dst < dis)
                  dis := dst;
                  npc := mob;
               endif
            endif
         endforeach
      endif

      // Has the player said the name of the vendor?  Use that.
      var vendorname;
      foreach mob in npclist
         if(CheckLineOfSight(who, mob))
            vendorname := splitwords(mob.name);
            if (text[lower(vendorname[1])])
               npc := mob;
            endif
         endif
      endforeach
   endif


change all of this to

Code:

   // If the character wants to do something with a vendor:
   if (text["buy"] || text["sell"] || text["train"] || text["teach"]||(pass))

      // Has the player said the name of the vendor?  Use that.
      var vendorname;
      foreach mob in npclist
         if(CheckLineOfSight(who, mob))
            vendorname := splitwords(mob.name);
            if (text[lower(vendorname[1])])
               npc := mob;
            endif
         endif
      endforeach
      
      // Just pick the nearest vendor if the player isn't specific.
      if (!npc)
         var dis := 7;
         foreach mob in npclist
            if(CheckLineOfSight(who, mob))
               var dst := dist(who, mob);
               if(dst < dis)
                  dis := dst;
                  npc := mob;
               endif
            endif
         endforeach
      endif
   endif


I have not tested this code, I havent even tried to compile it but hopefully this will solve it and hopefully I was looking at the right spot. Change, compile, reboot the shard.

My basic changes:
it was looking for any vendor first (if you said vendor or merchant) then it would look if you called a specific vendor name. I switched it so if you called the vendor name, it would be processed first and if none found, then look for any vendor. I also removed the IF statement with the "vendor" and "merchant" in it.

Author Message
Yukiko



Joined: 02 Feb 2006
Posts: 1094
Location: Southern Central USA

PostPosted: Wed Sep 20, 2006 1:01 am    Post subject: Reply with quote

I think you're right CWO. I keep forgetting about the bloody merchant nodes. Hopefully that helps him.

Author Message
Datus



Joined: 19 Sep 2006
Posts: 58

PostPosted: Wed Sep 20, 2006 10:50 am    Post subject: Reply with quote

Happiness abound! Very Happy It did work. There is one small problem though. I think something somewhere is doing some kind of word count. If I type, "train" it gives the list of skills the vendor/merchant will train - which is exactly how I wanted it to work. However to inquire about a skill I need to type in [randomword] train [skillname]. It fails to just work with , "train [skillname]" ... and the preceeding word can be anything of course like, "jackanape train skillname". Additionaly, if the skill name is two words like, "arms lore" then "train arms lore" wont work either even though it seemingly meets the 3 word count... but "teach me arms lore" will work and even "train me arms lore" hehe. Now I'm going to take a guess, but most likely I'm wrong... do the following two lines from merchantNodeControl.src have anything to do with it?

Code:
vendorname := splitwords(mob.name);
            if (text[lower(vendorname[1])])

Author Message
CWO



Joined: 04 Feb 2006
Posts: 699
Location: Chicago, IL USA

PostPosted: Wed Sep 20, 2006 11:08 am    Post subject: Reply with quote

dang now I just found out why they did that...

They put vendor or merchant as the first word so when it trains, it only has to look at the third and possibly fourth word to see what the skill is. Vendor or merchant replaces the word that could have also been the person's name (dont know how many people use that unless theres a million vendors around but its a feature). No worries though, theres still a way to work around it.

going back to this code block...

Code:

      // Just pick the nearest vendor if the player isn't specific.
      if (!npc)
         var dis := 7;
         foreach mob in npclist
            if(CheckLineOfSight(who, mob))
               var dst := dist(who, mob);
               if(dst < dis)
                  dis := dst;
                  npc := mob;
               endif
            endif
         endforeach
      endif


change to

Code:

       // Just pick the nearest vendor if the player isn't specific.
      if (!npc)
         var dis := 7;
         var newtxt := SplitWords[text][1];
         if( lower(newtxt) == "train" || lower(newtxt) == "teach" )
            text := "vendor "+ text;
         endif
         foreach mob in npclist
            if(CheckLineOfSight(who, mob))
               var dst := dist(who, mob);
               if(dst < dis)
                  dis := dst;
                  npc := mob;
               endif
            endif
         endforeach
      endif


now what you pointed out in the bottom of your post is

vendorname = SplitWords(mob.name);
this line splits the words in the vendor name up into an array. This way we can do whats next...

if (text[lower(vendorname[1])])
which this looks if vendorname[1] (the first word in the vendor's name) is in the text. And the lower().. all strings done by comparison are almost always converted to upper or lower case so they can compare correctly.

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095) All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty