Jump to content

Need a traveling Merchant


tiebearius

Recommended Posts

I'm making weapons for thieves, The weapons are almost done(the easy part) .My Ideal Idea would be able to have a Traveling merchant that goes from(warps?) Town to town, Hopefully in no order. Also I would like to put level rest. on the weapons , So what weapon is offered would depend how high in the thieves guild you are. Is this possible?
Link to comment
Share on other sites

The travelling merchant must be possible because there is a travelling merchants mod already available IIRC on Morrowind Summit. I believe it is called Ashlander Caravans or something like that where they alternate between Suran, Ald Ruhn, Balmora and one other town for selling goods.
Link to comment
Share on other sites

More like a startscript with the following sort of structure:

 

Begin MWS_TravelExec
;Because I can, damnit!

Float LocalDaysPassed;When the script is idle, this does the action presented in its name -- otherwise, it's used to hold things in the short term
Short DPDifference
Short CurrentLocation
Float XOrigin
Float YOrigin
Float ZOrigin

Set DPDifference to ( DaysPassed - LocalDaysPassed )

If ( DPDifference >= 20 );This should be changed to the number of days that need to pass until the option to change to another location should appear

 Set LocalDaysPassed to Random 6;This should be exchanged with the amount of locations that the objects can move to, multiplied by the inverse of the probability that a move is actually going to take place when an oppurtunity to do so is presented

 While ( LocalDaysPassed == CurrentLocation );If there is supposed to be a change in location, but LocalDaysPassed is pointing toward the current location, reroll until we get it right
   Set LocalDaysPassed to Random 6;Same value you used as an argument in the last line you had with a Random in it
 EndWhile

 If ( LocalDaysPassed == 5 );Start with the number you came up with in the previous line, subtract it by one, and you'll get the first condition.  Keep going down in your conditions until you've included a possibility for all the desinations you want to include.
   Set XOrigin to 6;Origin for all X axis positions when the merchant is in the town linked to LocalDaysPassed == 5
   Set YOrigin to 6;...All Y axis positions...
   Set ZOrigin to 6;...All Z axis positions...
   Set CurrentLocation to 5
 ElseIf ( LocalDaysPassed == 4 )
   Set XOrigin to 6
   Set YOrigin to 6
   Set ZOrigin to 6
   Set CurrentLocation to 4
 ElseIf ( LocalDaysPassed == 3 )
   Set XOrigin to 6
   Set YOrigin to 6
   Set ZOrigin to 6
   Set CurrentLocation to 3
 EndIf

 Set LocalDaysPassed to ( XOrigin + 6 );X axis offset for MWS_TM_Cart
 MWS_TM_Cart->SetPos X LocalDaysPassed
 Set LocalDaysPassed to ( YOrigin + 6 );Y axis offset...
 MWS_TM_Cart->SetPos Y LocalDaysPassed
 Set LocalDaysPassed to ( ZOrigin + 6 );Z axis offset...
 MWS_TM_Cart->SetPos Z LocalDaysPassed

 Set LocalDaysPassed to ( XOrigin + 6 );This time, the offsets are for MWS_TM_MerchantNPC
 MWS_TM_MerchantNPC00000000->SetPos X LocalDaysPassed
 Set LocalDaysPassed to ( YOrigin + 6 )
 MWS_TM_MerchantNPC00000000->SetPos Y LocalDaysPassed
 Set LocalDaysPassed to ( ZOrigin + 6 )
 MWS_TM_MerchantNPC00000000->SetPos Z LocalDaysPassed

 Set LocalDaysPassed to ( XOrigin + 6 );...And this time, for MWS_TM_Barrel1
 MWS_TM_Barrel1->SetPos X LocalDaysPassed
 Set LocalDaysPassed to ( YOrigin + 6 )
 MWS_TM_Barrel1->SetPos Y LocalDaysPassed
 Set LocalDaysPassed to ( ZOrigin + 6 )
 MWS_TM_Barrel1->SetPos Z LocalDaysPassed

 Set LocalDaysPassed to DaysPassed

EndIf

End

 

...Where MWS_TM_Cart and MWS_TM_Barrel1 are unique objects with persistent references, and MWS_TM_MerchantNPC is a unique NPC.

 

In this example, MWS_TM_Cart will have a starting position of 12, 12, 12, and, each time 20 days passes, will have a one-in-two chance of going to any number of places, including 12, 12, 12; 12, 12, 12; and the exotic 12, 12, 12. The same is true for MWS_TM_MerchantNPC and MWS_TM_Barrel1.

Link to comment
Share on other sites

Yeah, ElseIf is about the same as a CASE with BREAKs. Two things...the zeros on the end, is there a specific number of characters for NPC idents? And would this script make the merchant TRAVEL from town to town, or simply 'warp'? After all, Silt Striders look to have extra room for baggage. Heck, we've all had a character at some point hauling a few kilo-encumbrance units around on fast-travel services.
Link to comment
Share on other sites

<{POST_SNAPBACK}>  Abramul:

 

...Is there a specific number of characters for NPC idents?

 

No -- there isn't a minimum number of charachters, at least. The zeros indicate the instance of the actor this command should be applied to, and are just there for completeness.

 

<{POST_SNAPBACK}>  Abramul:

 

...Would this script make the merchant travel from town to town, or simply "warp?"

 

Good point. I've already thought up a way to implement something that would make the travelling less abrupt, but it's basically just a basic scheduled pack-disappear-unpack action that's latched onto the meat of the script. I'll run it through vi right quick, and apply syntax -- the finished product will be attached to this post when it is ready.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...