More like a startscript with the following sort of structure:
CODE
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.