PenUltima Online

It is currently Sat Aug 30, 2008 1:15 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: A couple of annoying newbie questions.
PostPosted: Tue Sep 19, 2006 11:26 am 
Offline
User avatar

Joined: Tue Sep 19, 2006 6:27 am
Posts: 58
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 1:02 pm 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 834
Location: Indiana, USA
Sanctuary is a shard, who released copies of their shard scripts and config files.

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

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 1:24 pm 
Online

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1120
Location: Southern Central USA
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 1:51 pm 
Offline
User avatar

Joined: Tue Sep 19, 2006 6:27 am
Posts: 58
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..


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 2:31 pm 
Online

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1120
Location: Southern Central USA
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 2:39 pm 
Online

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1120
Location: Southern Central USA
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 4:29 pm 
Offline
User avatar

Joined: Tue Sep 19, 2006 6:27 am
Posts: 58
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 4:40 pm 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 745
Location: Chicago, IL USA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 5:58 pm 
Offline
User avatar

Joined: Tue Sep 19, 2006 6:27 am
Posts: 58
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 8:55 pm 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 745
Location: Chicago, IL USA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 9:01 pm 
Online

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1120
Location: Southern Central USA
I think you're right CWO. I keep forgetting about the bloody merchant nodes. Hopefully that helps him.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 6:50 am 
Offline
User avatar

Joined: Tue Sep 19, 2006 6:27 am
Posts: 58
Happiness abound! :D 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])])


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 7:08 am 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 745
Location: Chicago, IL USA
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl