merchant quest on a new map

For questions relating to POL scripting (not necessarily related to WoD)

Moderators: Siobhan, Sebastian, Drocket

merchant quest on a new map

Postby Longshadow on Thu Jan 02, 2003 1:37 pm

Got a different map than the OSI map. Want to get the merchant quests working. If I modify the file scripts\include\towns.inc to have the towns that are on my map, do I have to also change pkg\npcs\townfolk\merchants\merchant_quest.src because I don't have 13 towns? I see this bit of code
var mytown := FindMyTown (merchant);
var chosentown := mytown;
if (!chosentown or RandomInt (4) = 1)
chosentown := RandomInt (13) + 1;
endif


Say I had only 5 towns. What would I have to change this too? I assume the 13 would become a 5, but what is that RandomInt (4) about?

Anything else I would need to change that I'm not noticing?

Thanks for any help.
Longshadow
Newbie Lord
 
Posts: 35
Joined: Tue Oct 08, 2002 10:07 pm
Location: My island sanctuary

Postby Senaldun on Thu Jan 02, 2003 4:25 pm

I am just guessing here but I think I am right

The 4 is a random variable used to determine if the quest calls for you to deliver the package to the town you are currently in or another town. It has a 75% chance of being in the same town and that 1 stands for the 25% of the package needing to be delivered to another town.
Senaldun
Jr. Newbie
 
Posts: 2
Joined: Wed Dec 25, 2002 4:42 pm

Postby Drocket on Thu Jan 02, 2003 7:28 pm

Yep, that's basically it.
Drocket
Site Admin
 
Posts: 820
Joined: Mon Oct 07, 2002 2:54 am

Postby Longshadow on Fri Jan 03, 2003 1:12 pm

I changed the towns.inc and the merchant_quest.src and recompiled the merchant_quest.ecl, and now the merchants always say THIS the first time you say quest to one:

"Well, I could... Hmm... No, never mind. Come back later."

Then after that, they will only say THIS:

"I don't have anything I need delivered right now, I'm afraid"

Did I miss anything? Any steps I should have done? Anything I should check? Will they eventually hand out quests?

Thanks.
Longshadow
Newbie Lord
 
Posts: 35
Joined: Tue Oct 08, 2002 10:07 pm
Location: My island sanctuary

Postby Longshadow on Mon Jan 06, 2003 5:10 am

Bumping it to try to get D's attention :P
Longshadow
Newbie Lord
 
Posts: 35
Joined: Tue Oct 08, 2002 10:07 pm
Location: My island sanctuary

Postby Lyl on Mon Jan 06, 2003 6:53 am

Code: Select all
   var townmerchantarray := GetGlobalProperty ("#merchants_of_town_" + chosentown);
   if (!townmerchantarray)
      PrintTextAbovePrivate(merchant, "Well, I could...  Hmm...  No, never mind.  Come back later.", player);
      EraseObjProperty (player, "#merchantquestthing");
      return;
   endif


Basicly there is no list of merchants for the town the merchant wants to send you to.
A merchant adds itself to the global array of merchants for the town it is in when it is created. It uses FindMyTown (which returns an number) to tell what town they are in.


You probably need to rewrite the function FindMyTown to apply to your new areas. And you might also need to respawn(slay) all your merchants after that. And make sure
Code: Select all
   if (!chosentown or RandomInt (4) = 1)
      chosentown := RandomInt (13) + 1;
   endif
matches the new amount of towns you have.



Makes me wonder how accurate these global arrays are after time. There should be something that cleans them, or merchants would try to send people to nonexistant merchants over and over. I would put cleaning code in with
Code: Select all
   repeat
      tries := tries + 1;
      var chosenmerchantserial := townmerchantarray [RandomInt (total_merchants + 1)];
      chosenmerchant := SystemFindObjectBySerial (chosenmerchantserial);
   until (chosenmerchant or tries > 10);
   
   if (!chosenmerchant or chosenmerchant = merchant)
      PrintTextAbovePrivate(merchant, "I have some stuff I need delivered, but I don't think they're in.", player);
      EraseObjProperty (player, "#merchantquestthing");
      return;
   endif
Lyl
Regular Poster
 
Posts: 109
Joined: Fri Oct 11, 2002 1:04 am


Return to Scripting Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron